A Python package for accessing and analyzing restaurant data, with built-in support for Clerk authentication and Supabase data storage.
Install directly from GitHub using pip:
pip install git+https://github.com/Waveform-Analytics/resto-analysis.git
Or if you're using uv:
uv pip install git+https://github.com/Waveform-Analytics/resto-analysis.git
The package provides access to three main tables:
-
Users: Combined user data from Clerk and Supabase
user_id
: Unique identifier (from Clerk)email
: User's email (from Clerk)name
: User's name (from Supabase)phone
: Contact number (from Supabase)created_at
: Account creation timestamp (from Supabase)
-
Visits: Restaurant visit records from Supabase
visit_id
: Unique visit identifieruser_id
: ID of the user who made the visitrestaurant_id
: ID of the visited restaurantcreated_at
: Timestamp of the visit
-
Restaurants: Restaurant information from Supabase
id
: Unique restaurant identifieraddress
: Restaurant's physical addressurl
: Restaurant's website URLcode
: Restaurant's unique code
from resto import get_data
# Get data from a single table
users_df = get_data('users')
visits_df = get_data('visits')
restaurants_df = get_data('restaurants')
# Get multiple tables at once
all_data = get_data(['users', 'visits', 'restaurants'])
The package requires the following credentials:
- Clerk Secret Key (for user authentication)
- Supabase URL and Key (for data storage)
You can provide these credentials in two ways:
Set the following environment variables:
export CLERK_SECRET_KEY='your_clerk_secret_key'
export SUPABASE_URL='your_supabase_url'
export SUPABASE_KEY='your_supabase_key'
Pass credentials directly when calling functions:
from resto import get_data
df = get_data(
'users',
clerk_secret_key='your_clerk_secret_key',
supabase_url='your_supabase_url',
supabase_key='your_supabase_key'
)
The package integrates data from multiple sources:
-
Clerk: Primary source for user authentication
- Source of truth for
user_id
andemail
- Complete email data for all users
- Source of truth for
-
Supabase: Primary data storage
- Extended user metadata (name, phone, etc.)
- Visit and restaurant data
- User data linked to Clerk via
id
=user_id
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.