https://github.com/kmbhm1/pyjas
A Python tool to implement JSON-API Standard Responses.
https://github.com/kmbhm1/pyjas
json-api python3
Last synced: 3 months ago
JSON representation
A Python tool to implement JSON-API Standard Responses.
- Host: GitHub
- URL: https://github.com/kmbhm1/pyjas
- Owner: kmbhm1
- License: mit
- Created: 2024-08-20T22:33:18.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-16T13:22:26.000Z (4 months ago)
- Last Synced: 2025-02-10T19:04:34.055Z (3 months ago)
- Topics: json-api, python3
- Language: Python
- Homepage: https://kmbhm1.github.io/PyJAS/
- Size: 850 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# Python JSON:API Standard (PyJAS)

[](https://pydantic.dev)

[](https://codecov.io/github/kmbhm1/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, ResourceObjectapp = 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/).