Skip to main content

A streaming ingestion and API connector toolkit — the conveyor belt of the data pipeline.

Project description

sushitruck

SushiTruck is the streaming ingestion and API connector toolkit for the food truck fleet — the conveyor belt of the data pipeline.

Just like conveyor belt sushi: data flows continuously past, and you consume exactly what you need, at your own pace.

pip install sushitruck

SushiTruck handles the intake side of a data pipeline: connecting to external APIs, streaming sources, and files/object stores, then normalizing everything into clean pd.DataFrames ready for ThaiTruck (cleaning/merging) and RamenTruck (ML/AI).

External World → SushiTruck (ingest, connect, normalize) →
                 ThaiTruck (clean, merge, profile) →
                 RamenTruck (train, tune, explain)

The Belt

Module Purpose
maki REST API client — auth, pagination, rate limiting, retry
sashimi Local file / S3 / GCS reader — CSV, JSON, JSONL, Parquet, chunked or full
wasabi Nested JSON flattening + schema enforcement
gari Rate limiting, retry with backoff, and circuit breaking
temaki Batch ingestion coordinator — merges files, globs, and API calls into one DataFrame
tobiko Output router — write to local/S3/GCS, or publish to Kafka/Kinesis
nigiri Streaming source adapters — webhook, WebSocket, Kafka, Kinesis

Quick examples

Pull data from a REST API:

from sushitruck import maki

client = maki.MakiClient(
    "https://api.example.com/v2",
    auth={"type": "bearer", "token": "my-token"},
    rate_limit=10.0,
    retries=3,
)

df = client.fetch("/transactions", paginate=True, results_key="data.transactions")

Read a large local or S3 file in memory-safe chunks:

from sushitruck import sashimi

for chunk_df in sashimi.read("big_trades.csv", chunksize=50_000):
    process(chunk_df)

Flatten and normalize a raw payload:

from sushitruck import wasabi

df = wasabi.flatten([{"price": "142.5", "meta": {"source": "bloomberg"}}])
schema = {
    "price": {"dtype": float, "nullable": False},
    "meta_source": {"dtype": str, "nullable": True, "rename": "source"},
}
clean = wasabi.normalize(df, schema)

Coordinate a multi-source batch job:

from sushitruck import temaki

job = (
    temaki.TemakiJob(workers=4, on_error="warn")
    .add_glob("s3://my-bucket/prices/*.parquet", storage="s3")
    .add_api(client, "/supplemental", paginate=True, results_key="data")
    .add_file("local_overrides.csv")
)
result = job.run()
print(result.total_rows, result.sources_failed)

Route the output:

from sushitruck import tobiko

tobiko.send(clean_df, "s3://my-bucket/processed/trades/", format="parquet", partition_by="date")

Optional extras

The core install requires only pandas, numpy, and requests. Everything else is opt-in:

pip install sushitruck              # core: REST APIs, local files, webhook/websocket streaming
pip install sushitruck[kafka]       # + Kafka streaming
pip install sushitruck[kinesis]     # + AWS Kinesis streaming
pip install sushitruck[cloud]       # + S3 and GCS object store
pip install sushitruck[websocket]   # + WebSocket streaming
pip install sushitruck[all]         # everything

Fleet

SushiTruck, ThaiTruck, and RamenTruck are fully independent packages — none imports another. They compose at the application layer through pd.DataFrame.

  • SushiTruck — streaming ingestion & API connectors (this package)
  • ThaiTruck — batch DataFrame cleaning & processing
  • RamenTruck — ML/AI toolkit

See PROJECT.md for full module design details and the roadmap.

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

sushitruck-0.2.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

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

sushitruck-0.2.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file sushitruck-0.2.0.tar.gz.

File metadata

  • Download URL: sushitruck-0.2.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for sushitruck-0.2.0.tar.gz
Algorithm Hash digest
SHA256 69452bd1c049f3261e7fdac213410bcfdf6f8e373230460d076be09039ff9f98
MD5 15ee290f10bd8dcb24bfc396c513bd0d
BLAKE2b-256 c9b691d3fcb6874e60d5489154dd189dd5d639f2b0fb293221f597b764361c4e

See more details on using hashes here.

File details

Details for the file sushitruck-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sushitruck-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for sushitruck-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c8b3dd70e0d516c200bf8118f4c2139cf66157195a9a116ea5369abb660a5ff
MD5 16e4562e5033896b173ce85c687f7fd4
BLAKE2b-256 01a5244e5123bd7eb25106ab5b2a2c873ae6f33501c056d68c9c9a3fd62b0aaa

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