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
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
tinycontracts-0.1.2.tar.gz
(36.5 kB
view details)
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52a7412c87b8443cb6c304baa1b1e03c3c2b170294d168662e441de3143ae98f
|
|
| MD5 |
3bd265b207df2a9849bcbc1fabba13da
|
|
| BLAKE2b-256 |
a58d8421df5c9181f3f59c2ddddcade60cecf8f5843a762695c4c69f3d45e5dc
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f7846cd938484b635ec14b90f00200c3305d51c60d7ac98fcff7265fb848f72
|
|
| MD5 |
2850c540d77d79feefd5b160ceca73b0
|
|
| BLAKE2b-256 |
6f9b569ed3514138bb33cd7cfb99cd4fbe08b5e3d59d960b6718ca84ff3aefc3
|