Skip to main content

starlette_jsonapi

A minimal "framework" intended to help write json:api compliant services in async Python, written on top of starlette and marshmallow-jsonapi.

In the maintainer's view, REST frameworks that come with a complete data layer implementation are quite limiting and rarely usable in production systems due to business logic needs or authorization constraints. The default implementation they come with is usually getting in the way, more than helping.

Because of that, starlette_jsonapi does not contain a data layer implementation, so you should be able to pick any available async ORM. This also means that you are going to get a very basic interface for writing a REST resource, with some helpers to make your experience more pleasant, but nothing fancy.

Installing

pip install starlette-jsonapi

Since this project is under development, please pin your dependencies to avoid problems.

Features

  • 100% tests coverage
  • basic json:api serialization
  • including related resources
  • starlette friendly route generation
  • exception handlers to serialize as json:api responses
  • relationship resources
  • sparse fields
  • support for client generated IDs
  • support top level meta objects
  • pagination helpers
  • OpenAPI 3.x (f.k.a Swagger) integration

Todo:

Documentation

Available on Read The Docs

You should take a look at the examples directory for full implementations.

To generate documentation files locally, you should create a virtualenv, then activate it and install the requirements:

cd docs
pip install -r requirements.txt

With the docs virtualenv activated, you can then run make html to generate the HTML files.

The result will be written to docs/build, and you can open docs/build/html/index.html in your browser of choice to view the pages.

Contributing

This project is in its early days, so any help is appreciated.

Running tests:

As simple as running tox.

If you plan to use pyenv and want to run tox for multiple python versions, you can create multiple virtual environments and then make them available to tox by running something like: pyenv shell starlette_jsonapi_venv36 starlette_jsonapi_venv37 starlette_jsonapi_venv38 starlette_jsonapi_venv39.

Metadata

Release files for starlette-jsonapi 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for starlette-jsonapi 2.2.1
File Size Uploaded Provenance Actions
starlette_jsonapi-2.2.1.tar.gz 23.9 kB Without provenance Details for starlette_jsonapi-2.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for starlette-jsonapi 2.2.1
File Interpreter ABI Platform Actions
starlette_jsonapi-2.2.1-py3-none-any.whl Python 3 none any Details for starlette_jsonapi-2.2.1-py3-none-any.whl

Total release size: 50.4 kB

Release files / starlette_jsonapi-2.2.1.tar.gz

Download URL starlette_jsonapi-2.2.1.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
af21fea01876de77c37fbe3c3ac68da41452c89a93bd745182c9ff236172f87a
BLAKE2b-256 checksum
How to use checksums
5525cdd25c278f2846a8299ec0ae2465c30d8299c43d61e5ea3ba22537579021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release files / starlette_jsonapi-2.2.1-py3-none-any.whl

Download URL starlette_jsonapi-2.2.1-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
569d98d39f2d02c40c18469dd24afce632c7caffcb8e79bf437c10b2579cdc32
BLAKE2b-256 checksum
How to use checksums
80d0b3f6c2c7e0d7c3725e86195ab52d999990462d594770655af13a118a7432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Security for starlette-jsonapi 2.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page