An implementation of the JSON:API Standard in Python.
Project description
Python JSON:API Standard (PyJAS)
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
- Inspired by the JSON specification.
- Built using Pydantic & FastAPI.
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
Built Distribution
File details
Details for the file pyjas-0.2.0.tar.gz
.
File metadata
- Download URL: pyjas-0.2.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80fa1ba98a8fa8eeb2c7fdf83838a7ffb9fce0a5304ccd4b30b6f62d2b271874 |
|
MD5 | 292e832fa9905fc519941de2406e618e |
|
BLAKE2b-256 | 1e9a945efb8ec86c696e226e1be089b3b31bb9dd9f26ede60813298732ee5107 |
File details
Details for the file pyjas-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyjas-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f831faec0619337b38db23143c624428753271a5c3d0d8425af305d138a1c64c |
|
MD5 | 4ac262da11adceae22ccc332b6cfd92f |
|
BLAKE2b-256 | 8ba63f1d8a1bb44ab8e98ee2cf32923a59765a14098791de118d010179d636f8 |