Skip to main content

serve a folder of json/csv/parquet files as a rest api

Project description

tinycontracts

Turn JSON, CSV, and Parquet files into REST APIs instantly.

Install

pip install tinycontracts

Usage

tc ./data

Or with options:

tc ./data --port 8000 --host 0.0.0.0

Example

Given this structure:

data/
  users.json
  orders.csv
  config.json

You get:

GET /users          # list all users
GET /users/1        # get user by id
GET /orders         # list all orders
GET /config         # get config

GET /_help          # api documentation
GET /_schema        # all schemas
GET /docs           # swagger ui

Filtering & Pagination

# filter by field
curl "localhost:4242/users?active=true"

# pagination
curl "localhost:4242/orders?_limit=10&_offset=20"

# sorting
curl "localhost:4242/orders?_sort=-created_at"

# combine
curl "localhost:4242/orders?status=pending&_limit=5&_sort=-amount"

Schema

# all schemas
curl localhost:4242/_schema

# single resource schema
curl localhost:4242/users/_schema

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

tinycontracts-0.1.1.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.

tinycontracts-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file tinycontracts-0.1.1.tar.gz.

File metadata

  • Download URL: tinycontracts-0.1.1.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tinycontracts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8182ae691bbe792bb5fcf553e1f89d4d13262fe3635c210b166b1eeb88269645
MD5 3a3741ed5a608954cdd329d97217f0bc
BLAKE2b-256 2d1a4a7aeb5a92af2989a53bd9df4e89ec62d8c61b38695b8320a44a04420003

See more details on using hashes here.

File details

Details for the file tinycontracts-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinycontracts-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tinycontracts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 193606442bfe9aa853f3501f19bf75a07a4d8572a7a321a9dc14907e01472e64
MD5 324c308286709c346f3e1601432a2347
BLAKE2b-256 60c284cff70e8dfb87f85f6dc2d3b8f8b7ab50ada1f509c3d5f3b9a32270cdae

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