Skip to main content

Python SDK for Soi Gia

Project description

soigia

soigia is a Python SDK for dataframe workflows, internal UI screens, shared YAML configuration, and business pipelines.

Getting Started

pip install soigia
import soigia

df = soigia.DataTable({"name": ["alice"], "age": [19]})
print(df)

For local development:

pip install -e .

What It Includes

  • soigia.datatable.DataTable for pandas-like data work with extra helpers.
  • soigia.ui for Streamlit-based internal screens.
  • soigia.pipeline.BasePipeline for business workflows.
  • soigia.config for shared YAML configuration and multi-account storage.

Quick Examples

DataTable

from soigia.datatable import DataTable

df = DataTable({"name": ["alice", "bob"], "age": [19, 24]})
print(df.objects.filter(age__gte=20).values("name", "age"))

UI

from soigia.ui import ui

orders = [
    {"id": 1, "customer": "Alice", "amount": 120.0, "status": "paid"},
    {"id": 2, "customer": "Bob", "amount": 88.5, "status": "pending"},
]


@ui.page("Orders")
def orders_page(ctx):
    ui.text("Order Dashboard")
    keyword = ui.text_input("Search")
    ui.metric("Total orders", len(orders))
    ui.table(lambda: [row for row in orders if keyword.value.lower() in row["customer"].lower()])


ui.run()

Pipeline

from soigia.pipeline import BasePipeline


class SalesPipeline(BasePipeline):
    stages = ["normalize", "summarize"]

    def load_data(self):
        return build_orders()

    def normalize(self):
        self.data_df = self.data_df.copy()
        self.data_df["amount"] = self.data_df["amount"].astype(float)

    def summarize(self):
        self.model.total_rows = len(self.data_df)


pipeline = SalesPipeline(name="sales")
result = pipeline.run()
print(result.summary_path)

Documentation

Configuration

Use soigia.config to load and save a shared config.yaml file for the whole project.

Pipeline modules can also auto-load a config.yaml file placed next to the pipeline file. It is exposed as self.config with dot access:

if self.config.min_amount:
    ...

Examples

Run the bundled demos:

python -m examples.pipeline_final_template
python -m examples.pipeline_yaml_config_demo
make ui-config
make ui
make ui-users
make ui-csv
make ui-markdown
make ui-jinja

Release

Build distribution artifacts:

python -m pip install --upgrade build
python -m build

Upload to PyPI:

python -m pip install --upgrade twine
python -m twine upload dist/*

Run the test suite before release:

python -m pytest tests -q

Publish Checklist

  1. Bump the version in pyproject.toml.
  2. Update CHANGELOG.md.
  3. Run python -m pytest tests -q.
  4. Run python -m build --no-isolation.
  5. Upload with python -m twine upload dist/*.
  6. Tag the release in git.

Project Layout

  • soigia/
  • examples/
  • docs/
  • tests/

Generated Files

  • data/<ClassName>/<step>.csv
  • data/<ClassName>/<ClassName>.csv
  • data/<ClassName>/<ClassName>.sqlite3
  • data/<ClassName>/<ClassName>.parquet
  • data/<ClassName>/pipeline_summary.md
  • logs/<ClassName>.log

Optional Features

  • Google Sheets helpers usually need gspread and Google service-account support.
  • Shared account config screens need pyyaml.
  • Jinja template examples need jinja2.
  • Excel helpers need an Excel engine such as openpyxl.
  • Parquet and Feather helpers need a parquet/arrow backend such as pyarrow.
  • Fake data helpers work best with faker, but soigia also includes a small fallback generator.

Core Ideas

DataTable keeps the pandas mental model, but adds a few opinionated helpers:

  • objects for queryset-style chaining
  • values() for record-style output
  • filter() and exclude() for row filtering
  • order_by() and distinct() for common table operations
  • join() for relational merges
  • validate_schema() for lightweight schema checks
  • init_versions(), snapshot(), and auto_version() for version tracking

Security Note

from_pickle() should only be used with trusted input. Pickle files can execute code during loading.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soigia-0.1.7.tar.gz (68.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soigia-0.1.7-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file soigia-0.1.7.tar.gz.

File metadata

  • Download URL: soigia-0.1.7.tar.gz
  • Upload date:
  • Size: 68.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for soigia-0.1.7.tar.gz
Algorithm Hash digest
SHA256 aa74935f02ec21c14e2376cea80f4c28975dbddc296ca8f9366835a3306970c7
MD5 72d007dd2fd5900a8635f62d93055e18
BLAKE2b-256 2df0656b48a3600c1d03fecee666da7b9784a74f4f12c40d5bef84793afe038f

See more details on using hashes here.

File details

Details for the file soigia-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: soigia-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for soigia-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 31d743fdd3409d91fd228e1188fd201ab37796c08606844bb08b12f7c0cada66
MD5 0bd57af7f867a39db187cf096f99dd52
BLAKE2b-256 2a836824a4452be4a9b8c782f8e42687b71c0e937c16faffa86962db350fd0e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page