# Python JSON:API Standard (PyJAS)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/PyJAS)
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
![GitHub License](https://img.shields.io/github/license/kmbhm1/PyJAS)
[![codecov](https://codecov.io/github/kmbhm1/PyJAS/graph/badge.svg?token=PYOJPJTOLM)](https://codecov.io/github/kmbhm1/PyJAS)
![PyPI - Downloads](https://img.shields.io/pypi/dm/PyJAS)
**PyJAS** is a Python library that provides seamless integration of the [JSON:API](https://jsonapi.org/) 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:
```bash
pip install pyjas
```
## Quick Start
Here's a simple example of how to integrate PyJAS with Pydantic & FastAPI:
```python
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](https://kmbhm1.github.io/PyJAS/).
## Documentation
Comprehensive documentation is available on our [MkDocs site](https://kmbhm1.github.io/PyJAS/).
## Contributing
Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for more information.
## License
This project is licensed under the [MIT License](LICENSE).
## Contact
For questions or support, please open an issue on [GitHub](https://github.com/kmbhm1/PyJAS/issues).
## Acknowledgements
- Inspired by the [JSON specification](https://jsonapi.org/).
- Built using [Pydantic](https://pydantic-docs.helpmanual.io/) & [FastAPI](https://fastapi.tiangolo.com/).
Raw data
{
"_id": null,
"home_page": "https://kmbhm1.github.io/PyJAS",
"name": "pyjas",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "json, jsonapi, api, rest, json:api specification, json:api, pydantic, flask, fastapi, sqlalchemy, django",
"author": "K Boehm",
"author_email": "kmbhm1@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/20/04/31efacba91afa6078679e8bcd37f5886f1e0db32fcb6f329e5658609a485/pyjas-0.2.1.tar.gz",
"platform": null,
"description": "# Python JSON:API Standard (PyJAS)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/PyJAS)\n[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)\n![GitHub License](https://img.shields.io/github/license/kmbhm1/PyJAS)\n[![codecov](https://codecov.io/github/kmbhm1/PyJAS/graph/badge.svg?token=PYOJPJTOLM)](https://codecov.io/github/kmbhm1/PyJAS)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/PyJAS)\n\n**PyJAS** is a Python library that provides seamless integration of the [JSON:API](https://jsonapi.org/) specification with Pydantic and FastAPI. It simplifies the process of building standards-compliant APIs, ensuring consistency and interoperability across your applications.\n\n## Features\n\n- **Standards Compliance:** Adheres strictly to the JSON:API specification.\n- **Pydantic Models:** Utilizes Pydantic for data validation and serialization.\n- **FastAPI Integration:** Easily integrates with FastAPI to build high-performance APIs.\n- **Flexible Configuration:** Customize behaviors to fit your project's requirements.\n- **Extensible:** Supports extensions and customizations for advanced use cases.\n\n## Installation\n\nYou can install PyJAS via pip:\n\n```bash\npip install pyjas\n```\n\n## Quick Start\n\nHere's a simple example of how to integrate PyJAS with Pydantic & FastAPI:\n\n```python\nfrom fastapi import FastAPI\nfrom pyjas.v1_1 import Document, ResourceObject\n\napp = FastAPI()\n\nclass Article(ResourceObject):\n type_: str = \"articles\"\n id_: str\n attributes: dict\n\n@app.get(\"/articles/{article_id}\", response_model=Document)\nasync def get_article(article_id: str):\n article = Article(id_=article_id, attributes={\"title\": \"PyJAS\"})\n return Document(data=article)\n```\n\nFor a complete example, visit our [Documentation Site](https://kmbhm1.github.io/PyJAS/).\n\n## Documentation\n\nComprehensive documentation is available on our [MkDocs site](https://kmbhm1.github.io/PyJAS/).\n\n## Contributing\n\nContributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for more information.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contact\n\nFor questions or support, please open an issue on [GitHub](https://github.com/kmbhm1/PyJAS/issues).\n\n\n## Acknowledgements\n\n- Inspired by the [JSON specification](https://jsonapi.org/).\n- Built using [Pydantic](https://pydantic-docs.helpmanual.io/) & [FastAPI](https://fastapi.tiangolo.com/).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An implementation of the JSON:API Standard in Python.",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://kmbhm1.github.io/PyJAS",
"Repository": "https://github.com/kmbhm1/PyJAS"
},
"split_keywords": [
"json",
" jsonapi",
" api",
" rest",
" json:api specification",
" json:api",
" pydantic",
" flask",
" fastapi",
" sqlalchemy",
" django"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b7d68a9f08727ba411365548ac2612ba58fc10fbc5b39d408095f2694c6a4a5f",
"md5": "dd6897b08792c5a6ed6c1ca6292f2aba",
"sha256": "6b27c5ddff7991d5ca0858dc01ee9061439625ede868c90c265ea3851e3a2f5e"
},
"downloads": -1,
"filename": "pyjas-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd6897b08792c5a6ed6c1ca6292f2aba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 12885,
"upload_time": "2024-12-24T18:01:55",
"upload_time_iso_8601": "2024-12-24T18:01:55.264246Z",
"url": "https://files.pythonhosted.org/packages/b7/d6/8a9f08727ba411365548ac2612ba58fc10fbc5b39d408095f2694c6a4a5f/pyjas-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "200431efacba91afa6078679e8bcd37f5886f1e0db32fcb6f329e5658609a485",
"md5": "0b690d241b42bc85c1d5e49671b50153",
"sha256": "bec3837d0dbbef4f837306c2af7f161356ed7b07ba85394a2a1190bd427ef227"
},
"downloads": -1,
"filename": "pyjas-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "0b690d241b42bc85c1d5e49671b50153",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 14254,
"upload_time": "2024-12-24T18:01:57",
"upload_time_iso_8601": "2024-12-24T18:01:57.812446Z",
"url": "https://files.pythonhosted.org/packages/20/04/31efacba91afa6078679e8bcd37f5886f1e0db32fcb6f329e5658609a485/pyjas-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-24 18:01:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kmbhm1",
"github_project": "PyJAS",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyjas"
}