Skip to main content

An implementation of the JSON:API Standard in Python.

Project description

Python JSON:API Standard (PyJAS)

PyPI - Python Version Pydantic v2 GitHub License codecov PyPI - Downloads

PyJAS is a Python library that provides seamless integration of the JSON:API specification with Pydantic and FastAPI. It simplifies the process of building standards-compliant APIs, ensuring consistency and interoperability across your applications.

Features

  • Standards Compliance: Adheres strictly to the JSON:API specification.
  • Pydantic Models: Utilizes Pydantic for data validation and serialization.
  • FastAPI Integration: Easily integrates with FastAPI to build high-performance APIs.
  • Flexible Configuration: Customize behaviors to fit your project's requirements.
  • Extensible: Supports extensions and customizations for advanced use cases.

Installation

You can install PyJAS via pip:

pip install pyjas

Quick Start

Here's a simple example of how to integrate PyJAS with Pydantic & FastAPI:

from fastapi import FastAPI
from pyjas.v1_1 import Document, ResourceObject

app = FastAPI()

class Article(ResourceObject):
    type_: str = "articles"
    id_: str
    attributes: dict

@app.get("/articles/{article_id}", response_model=Document)
async def get_article(article_id: str):
    article = Article(id_=article_id, attributes={"title": "PyJAS"})
    return Document(data=article)

For a complete example, visit our Documentation Site.

Documentation

Comprehensive documentation is available on our MkDocs site.

Contributing

Contributions are welcome! Please see our Contributing Guide for more information.

License

This project is licensed under the MIT License.

Contact

For questions or support, please open an issue on GitHub.

Acknowledgements

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

pyjas-0.2.3.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

pyjas-0.2.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file pyjas-0.2.3.tar.gz.

File metadata

  • Download URL: pyjas-0.2.3.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyjas-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c21b2b7d1975003648a5b9b1fb25232800ef10054206ae62ae24f21a0913dcf9
MD5 bc01535ec1bde5e3b6d57aae9c2d6343
BLAKE2b-256 2d053fe0c4f0e380a2fd0945d10fe3b00062056791be6be67edcb16cec5fd9bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjas-0.2.3.tar.gz:

Publisher: publish.yml on kmbhm1/PyJAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyjas-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pyjas-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyjas-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86b00e26677ccfc5c4eff30daf7bb8f94d85216ed823ed1aa544a2bb3e38862a
MD5 20731ea62a5f98f97fcdf63c95d42987
BLAKE2b-256 d962d03e935015e647c2d4ea0cabbc2a56d63cd27ae8d019c2deb8950f55e4cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjas-0.2.3-py3-none-any.whl:

Publisher: publish.yml on kmbhm1/PyJAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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