Add your description here
Project description
SecondMate
SecondMate is a modern data catalog and exploration tool built with a high-performance Python backend and a dynamic React frontend. It provides a seamless interface for managing data catalogs, namespaces, and tables, with built-in support for Apache Iceberg and PySpark.
🚀 Key Features
- Dynamic Catalog Browser: Navigate through your data hierarchy (Catalogs -> Namespaces -> Tables) with an intuitive tree view.
- Data Preview: Instantly query and visualize data from your tables.
- Integrated Querying: Built-in support for executing queries against your data lake.
- Iceberg Native: Designed with Apache Iceberg in mind, including automatic sample data initialization.
- Modern UI: Built with React 19, TypeScript, and Vite, featuring a responsive design with resizable panels and a premier dark-mode aesthetic.
🛠️ Tech Stack
Frontend
- Framework: React 19 + TypeScript
- Build Tool: Vite
- State Management: Zustand
- Component: Monaco Editor, React Resizable Panels
- Styling: Lucide React (Icons), CSS Modules
Backend
- Framework: FastAPI
- Data Processing: PySpark 4.0+ (Development build)
- Table Format: Apache Iceberg
- Server: Uvicorn
📦 Installation & Setup
Prerequisites
- Node.js (v18+ recommended)
- Python 3.11+
- Java 17+ (for PySpark)
- uv (recommended for Python dependency management)
1. Development Environment
SecondMate includes a unified development script that starts both the FastAPI backend and Vite frontend together.
# Clone the repository and enter the directory
git clone <repository-url>
cd secondmate
# Install frontend dependencies
npm install
# Create a virtual environment and install backend dependencies using uv
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
# Start the development server (runs both backend and frontend)
chmod +x dev.sh
./dev.sh
- The UI will be available at
http://localhost:5173. - The API will be available at
http://localhost:8000. - Automatic API docs at
http://localhost:8000/docs.
2. Manual/Separate Setup
Frontend (Vite Server):
npm install
npm run dev
Backend (FastAPI Server):
uv venv
source .venv/bin/activate
uv pip install -e .
uvicorn secondmate.main:app --reload --host 0.0.0.0 --port 8000
3. Production Build
When building for production, the Vite frontend compiles into the Python package (secondmate/static), which is then served by FastAPI.
# Build the frontend (outputs to secondmate/static)
npm run build
# Install the Python package and run the CLI
uv pip install -e .
secondmate --port 4050
The app will be available at http://localhost:4050 serving both UI and API.
4. Verification
Several scripts are available to verify your installation and configuration:
# Ensure frontend is built first
npm run build
# Run asset verification
python verify_assets.py
# Run configuration injection verification
python verify_injection.py
# Run conditional data/provider logic verification
python verify_conditional_data.py
📚 API Endpoints
The backend exposes several key endpoints for metadata and data retrieval:
GET /health: Service health check.GET /info: Spark session and application details.GET /catalogs: List all available catalogs.GET /catalogs/{catalog_name}/namespaces: List namespaces within a catalog.GET /catalogs/{catalog_name}/namespaces/{namespace}/tables: List tables within a namespace.GET /query: Execute a sample query (currently fetchesuser.ipgeo).
🔌 Custom Spark Providers
SecondMate allows you to provide your own Spark session by implementing a custom Spark provider. This is useful for connecting to existing Spark clusters, configuring specific catalogs (like AWS Glue or Hive), or applying custom security settings.
1. Create a Provider Class
Your custom provider must implement the SparkProvider protocol (defined in secondmate/providers/spark_interface.py). It needs a get_session() method that returns a pyspark.sql.SparkSession.
Example my_provider.py:
from pyspark.sql import SparkSession
from secondmate.providers.spark_interface import SparkProvider
class MyCustomSparkProvider(SparkProvider):
def get_session(self) -> SparkSession:
return (
SparkSession.builder
.appName("SecondMate-Custom")
.config("spark.sql.catalog.my_catalog", "org.apache.iceberg.spark.SparkCatalog")
# ... additional configuration ...
.getOrCreate()
)
2. Deploying the Provider
To use your custom provider, set the SPARK_PROVIDER_CLASS environment variable to the full import path of your class before starting SecondMate.
export SPARK_PROVIDER_CLASS="my_module.my_provider.MyCustomSparkProvider"
secondmate --port 4050
SecondMate will dynamically load your provider class and use it to obtain the Spark session for all operations.
🧪 Sample Data
On startup, the backend automatically initializes a local Spark Iceberg environment with the following sample tables:
user.ipgeo(1000 rows)user.sales.transactionsuser.finance.budget
Enjoy exploring your data with SecondMate!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secondmate-0.11.1.tar.gz.
File metadata
- Download URL: secondmate-0.11.1.tar.gz
- Upload date:
- Size: 3.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c0fbdfb78c8d452598b6325fc303577f00d3fc480617c216153f7ce969c630
|
|
| MD5 |
c30cda3b3c82796293136d21da70491d
|
|
| BLAKE2b-256 |
06c8b77a8544fbe49fe708bff660091959f496bc10daf89d644663e967c50d4d
|
Provenance
The following attestation bundles were made for secondmate-0.11.1.tar.gz:
Publisher:
ci.yml on Cbeaucl/secondmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secondmate-0.11.1.tar.gz -
Subject digest:
50c0fbdfb78c8d452598b6325fc303577f00d3fc480617c216153f7ce969c630 - Sigstore transparency entry: 1673690067
- Sigstore integration time:
-
Permalink:
Cbeaucl/secondmate@1c025b6b5af7840c5aec0ad7af29800df107c23b -
Branch / Tag:
refs/tags/v0.11.1 - Owner: https://github.com/Cbeaucl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@1c025b6b5af7840c5aec0ad7af29800df107c23b -
Trigger Event:
push
-
Statement type:
File details
Details for the file secondmate-0.11.1-py3-none-any.whl.
File metadata
- Download URL: secondmate-0.11.1-py3-none-any.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
274fdd3f45618569e257ff67e4e236847b654eac572266226599cc597fc5c408
|
|
| MD5 |
e6332fb1f2e40df23f4f298364e9f669
|
|
| BLAKE2b-256 |
d3e4c9b62835ff609d03142c29c5d7961244c69ff805d44213d7f16c94cbb8ca
|
Provenance
The following attestation bundles were made for secondmate-0.11.1-py3-none-any.whl:
Publisher:
ci.yml on Cbeaucl/secondmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secondmate-0.11.1-py3-none-any.whl -
Subject digest:
274fdd3f45618569e257ff67e4e236847b654eac572266226599cc597fc5c408 - Sigstore transparency entry: 1673690089
- Sigstore integration time:
-
Permalink:
Cbeaucl/secondmate@1c025b6b5af7840c5aec0ad7af29800df107c23b -
Branch / Tag:
refs/tags/v0.11.1 - Owner: https://github.com/Cbeaucl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@1c025b6b5af7840c5aec0ad7af29800df107c23b -
Trigger Event:
push
-
Statement type: