Sibi Toolkit: A collection of tools for Data Analysis/Engineering.
Project description
SibiFlux: The Production Data Toolkit
SibiFlux is a production-grade data engineering toolkit designed for Python 3.11+. It provides a unified ecosystem for project scaffolding, declarative datacube management, automated resource generation, and agentic interoperability through the Model Context Protocol (MCP).
Key Features
- Declarative Datacubes: Define data structures in YAML and auto-generate specialized Python classes.
- Automated Init Engine: Transform modular YAML configs and
.envfiles into strongly-typed Pydanticsettings.py. - High-Performance Storage: Unified fsspec and PyArrow storage registry with depot isolation and path traversal protection.
- Agentic Ready: Native MCP (Model Context Protocol) integration to expose your data pipelines directly to AI agents.
- Scalable Workloads: First-class support for Dask and distributed computing.
- Geospatial Power: Integrated OSMnx helpers and PBF handling for complex GIS workflows.
Tech Stack
- Core: Python 3.11+
- Configuration: Pydantic Settings v2
- CLI Framework: Typer
- Data Engineering: Pandas, PyArrow, Dask
- Storage Layer: fsspec, s3fs
- Databases: SQLAlchemy, Clickhouse, MySQL, PostgreSQL
- Web/API: FastAPI, Uvicorn, MCP
- Orchestration: Docker, Docker Compose, uv
Prerequisites
- Python 3.11+
- uv: Extremely fast Python package manager.
- Docker & Docker Compose: For local services (Postgres, Clickhouse).
- Poethepoet: Task runner (installed via dev dependencies).
Getting Started
1. Clone & Install
git clone https://github.com/lvalverdeb/sibi-flux.git
cd sibi-flux
uv sync --all-extras
2. Environment Setup
Copy the example environment file:
cp .env.linux .env
Initialize the project configuration:
# This generates conf/settings.py and conf/credentials/
sibi-flux env --env-file .env
3. Start Local Infrastructure
docker-compose up -d
4. Project Scaffolding
# Initialize a new project structure
sibi-flux init my_project --app
# Create a specific application within the project
sibi-flux create_app my_app
5. Datacube Workflow
# Propose cubes from a database domain
sibi-flux propose-cubes my_db_domain my_app
# Generate the app-specific extensions
sibi-flux create-cubes my_app
Architecture
Directory Structure
├── src/sibi_flux/
│ ├── init/ # Project bootstrapping & logic generation
│ ├── datacube/ # Datacube orchestration, discovery & mapping
│ ├── storage/ # Unified storage manager (fsspec + pyarrow)
│ ├── mcp/ # MCP Router & Resource registration
│ ├── osmnx_helper/ # Geospatial PBF handling & Graph loading
│ ├── config/ # Unified settings & config management
│ ├── parquet/ # Optimized parquet I/O with gatekeeping
│ ├── df_helper/ # Rich DataFrame manipulation utils
│ └── orchestration/ # Dask/Distributed workload management
├── conf/ # Generated configuration (settings.py)
├── solutions/ # Reference implementations & examples
├── test_prj/ # Standard test project layout
└── Dockerfile # Production-grade container image
Data Lifecycle
- Declarative Phase: Developers define discovery rules and datacube mappings in
conf/discovery_params.yaml. - Generation Phase:
sibi-flux dccommands scan data sources and generate Python wrappers. - Runtime Phase:
ProjectServicedetects the root and loads environment-specificsettings.py.StorageManagerestablishes connections to S3/WebDAV/Local.Datacubeinstances provide high-level abstractions over PyArrow/Dask.
- Exposure Phase: The
MCP Routerregisters datacubes as resources for external consumption (e.g., by LLM agents).
Unified Storage Registry
SibiFlux implements a robust storage registry that isolates distinct "depots" (e.g., bronze, silver, gold).
- Isolation: Each depot is mapped to a designated path.
- Performance: Automatic switching between
fsspecandNative C++ PyArrow S3FileSystem. - Security: Built-in path traversal protection (blocking
..in joined segments).
Environment Configuration
Required Variables
| Variable | Description | Default |
|---|---|---|
DB_URL |
Primary database connection string | sqlite:///:memory: |
FS_TYPE |
Storage type (s3, file, webdav) |
s3 |
STORAGE_PATH |
Base path for all data artifacts | - |
Modular YAMLs
The init engine populates conf/ with modular YAML files:
storage.yaml: S3 layouts and filesystem definitions.databases.yaml: Database connection mapping.osmnx.yaml: Geospatial storage references.
Available Scripts (Poe)
| Command | Description |
|---|---|
poe dev |
Start development server with reload |
poe test |
Run the full pytest suite |
poe dc-sync |
Synchronize datacube registry |
poe dc-discover |
Discover new data structures |
poe test-snapshots |
Run regression snapshot tests |
Testing
SibiFlux uses complex snapshot-based testing for code generation verification.
# Run all tests
pytest tests/
# Update snapshots (Golden Masters)
UPDATE_SNAPSHOTS=1 pytest
Deployment
Docker
The project includes a production-ready multi-stage Dockerfile.
docker build -t sibi-flux:latest .
Docker Compose
The docker-compose.yml orchestrates:
- API: The main SibiFlux web service (FastAPI).
- Dask Scheduler: For distributed task execution.
- Postgres/Clickhouse: Local data stores for development.
Troubleshooting
- ImportError: Ensure you have run
uv syncto install all dependencies. - Connection Error: Check your
.envvariables and ensure Docker services are running. - Storage Risk: If you see "Security Risk: Path traversal detected," ensure your dynamic paths do not contain
..or absolute prefixes.
Contributing
- Follow the Conventional Commits standard.
- Ensure all tests pass (
poe test). - Add snapshots for any new code generation logic.
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 sibi_flux-2026.2.5.tar.gz.
File metadata
- Download URL: sibi_flux-2026.2.5.tar.gz
- Upload date:
- Size: 220.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4de0d212fb39fd79e6c80effb77dbf36f31255de32232f55d2b827a9fa380ffb
|
|
| MD5 |
6f282a96b741fb82d5881dc05156c61c
|
|
| BLAKE2b-256 |
d6937d06c881bace21a627c31bb971b66d9c8c012d3551f193990619de9e176d
|
File details
Details for the file sibi_flux-2026.2.5-py3-none-any.whl.
File metadata
- Download URL: sibi_flux-2026.2.5-py3-none-any.whl
- Upload date:
- Size: 279.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5789f3572a32647d196cd168b8af230f2736e009438969d01d3b9d58c3b34ab1
|
|
| MD5 |
907f5f8c4c40c0f7c5161ce31b183887
|
|
| BLAKE2b-256 |
6655b64160b743e91e383554152c3d3227a7fad0db8c73dd8bf5320bbda9190f
|