# 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/1e/9a/945efb8ec86c696e226e1be089b3b31bb9dd9f26ede60813298732ee5107/pyjas-0.2.0.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.0",
"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": "8ba63f1d8a1bb44ab8e98ee2cf32923a59765a14098791de118d010179d636f8",
"md5": "4ac262da11adceae22ccc332b6cfd92f",
"sha256": "f831faec0619337b38db23143c624428753271a5c3d0d8425af305d138a1c64c"
},
"downloads": -1,
"filename": "pyjas-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4ac262da11adceae22ccc332b6cfd92f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 12863,
"upload_time": "2024-09-25T13:28:28",
"upload_time_iso_8601": "2024-09-25T13:28:28.850768Z",
"url": "https://files.pythonhosted.org/packages/8b/a6/3f1d8a1bb44ab8e98ee2cf32923a59765a14098791de118d010179d636f8/pyjas-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e9a945efb8ec86c696e226e1be089b3b31bb9dd9f26ede60813298732ee5107",
"md5": "292e832fa9905fc519941de2406e618e",
"sha256": "80fa1ba98a8fa8eeb2c7fdf83838a7ffb9fce0a5304ccd4b30b6f62d2b271874"
},
"downloads": -1,
"filename": "pyjas-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "292e832fa9905fc519941de2406e618e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 14239,
"upload_time": "2024-09-25T13:28:30",
"upload_time_iso_8601": "2024-09-25T13:28:30.298405Z",
"url": "https://files.pythonhosted.org/packages/1e/9a/945efb8ec86c696e226e1be089b3b31bb9dd9f26ede60813298732ee5107/pyjas-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-25 13:28:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kmbhm1",
"github_project": "PyJAS",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyjas"
}