Skip to main content

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

Project description

tinycontracts

Turn any folder of JSON, CSV, or Parquet files into a REST API instantly.

Install

pip install tinycontracts

Usage

tc ./data

That's it. Your files are now API endpoints.

Options

tc ./data -p 8000           # custom port (default: 4242)
tc ./data -H 0.0.0.0        # expose to network
tc --version                # show version

Example

data/
  users.json     ->  GET /users
  orders.csv     ->  GET /orders
  config.json    ->  GET /config

Querying

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

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

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

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

Endpoints

Endpoint Description
/{resource} List all rows
/{resource}/{id} Get by ID
/{resource}/_schema JSON schema
/_help API documentation
/_schema All schemas
/docs Swagger UI

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.2.tar.gz (36.5 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.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tinycontracts-0.1.2.tar.gz
  • Upload date:
  • Size: 36.5 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.2.tar.gz
Algorithm Hash digest
SHA256 52a7412c87b8443cb6c304baa1b1e03c3c2b170294d168662e441de3143ae98f
MD5 3bd265b207df2a9849bcbc1fabba13da
BLAKE2b-256 a58d8421df5c9181f3f59c2ddddcade60cecf8f5843a762695c4c69f3d45e5dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tinycontracts-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f7846cd938484b635ec14b90f00200c3305d51c60d7ac98fcff7265fb848f72
MD5 2850c540d77d79feefd5b160ceca73b0
BLAKE2b-256 6f9b569ed3514138bb33cd7cfb99cd4fbe08b5e3d59d960b6718ca84ff3aefc3

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