Name | motorhead JSON |
Version |
0.2501.2
JSON |
| download |
home_page | None |
Summary | Async MongoDB with vanilla Pydantic v2+ - made easy. |
upload_time | 2025-01-18 22:20:19 |
maintainer | None |
docs_url | None |
author | Peter Volf |
requires_python | >=3.10 |
license | MIT |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|




**Source code**: [https://github.com/volfpeter/motorhead](https://github.com/volfpeter/motorhead)
**Documentation and examples**: [https://volfpeter.github.io/motorhead](https://volfpeter.github.io/motorhead/)
# Motorhead
Async MongoDB with vanilla Pydantic v2+ - made easy.
Key features:
- Database **model** and API design with vanilla `Pydantic` v2+.
- Relationship support and validation using async **validators and delete rules** with a declarative, decorator-based syntax.
- ODM-like **query builder** for convenient, typed, and Pythonic query construction.
- Declarative **index** specification.
- Typed **utilities** for convenient model and API creation.
- Ready to use, customizable **async service layer** with **transaction support** that integrates all the above to keep your API and business logic clean, flexible, and easy to understand.
- **Simplicity**: by not being a classic ODM, the codebase is very simple and easy to understand (even contribute to) even for relative beginners.
By providing a convenient, declarative middle layer between MongoDB and your API, `motorhead` is halfway between an object document mapper (based on vanilla `Pydantic`) and a database driver (by wrapping the official, async `motor` driver). What's missing is the built-in ODM performance and memory overhead, whose benefits are rarely felt when working with document databases.
See the [full documentation here](https://volfpeter.github.io/motorhead/).
## Installation
The library is available on PyPI and can be installed with:
```console
$ pip install motorhead
```
## Examples
See the [documentation](https://volfpeter.github.io/motorhead/fastapi-example/) for usage and application examples.
## Requirements
The project depends on `motor` (the official asyncio MongoDB driver, which is built on top of `pymongo` and `bson`) and `pydantic` v2+.
## Development
Use `black` for code formatting, `mypy` for static code analysis, `ruff` for linting, and `pytest` (with `pytest-asyncio` and `pytest-docker`) for testing.
The documentation is built with `mkdocs-material` and `mkdocstrings`.
## Contributing
All contributions are welcome.
## Notes
This project is the continuation of [fastapi-motor-oil](https://github.com/volfpeter/fastapi-motor-oil) with support for [Pydantic v2](https://docs.pydantic.dev/latest/migration/), among other improvements. Migration from `fastapi-motor-oil` should be easy, but if you need help, just create an issue in the issue tracker.
## License - MIT
The library is open-sourced under the conditions of the [MIT license](https://choosealicense.com/licenses/mit/).
Raw data
{
"_id": null,
"home_page": null,
"name": "motorhead",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Peter Volf",
"author_email": "do.volfp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1d/67/7b0bb81410cd8353db454ee2983a2d058b81cce7f7b1e6b788884c5f2b2c/motorhead-0.2501.2.tar.gz",
"platform": null,
"description": "\n\n\n\n\n**Source code**: [https://github.com/volfpeter/motorhead](https://github.com/volfpeter/motorhead)\n\n**Documentation and examples**: [https://volfpeter.github.io/motorhead](https://volfpeter.github.io/motorhead/)\n\n# Motorhead\n\nAsync MongoDB with vanilla Pydantic v2+ - made easy.\n\nKey features:\n\n- Database **model** and API design with vanilla `Pydantic` v2+.\n- Relationship support and validation using async **validators and delete rules** with a declarative, decorator-based syntax.\n- ODM-like **query builder** for convenient, typed, and Pythonic query construction.\n- Declarative **index** specification.\n- Typed **utilities** for convenient model and API creation.\n- Ready to use, customizable **async service layer** with **transaction support** that integrates all the above to keep your API and business logic clean, flexible, and easy to understand.\n- **Simplicity**: by not being a classic ODM, the codebase is very simple and easy to understand (even contribute to) even for relative beginners.\n\nBy providing a convenient, declarative middle layer between MongoDB and your API, `motorhead` is halfway between an object document mapper (based on vanilla `Pydantic`) and a database driver (by wrapping the official, async `motor` driver). What's missing is the built-in ODM performance and memory overhead, whose benefits are rarely felt when working with document databases.\n\nSee the [full documentation here](https://volfpeter.github.io/motorhead/).\n\n## Installation\n\nThe library is available on PyPI and can be installed with:\n\n```console\n$ pip install motorhead\n```\n\n## Examples\n\nSee the [documentation](https://volfpeter.github.io/motorhead/fastapi-example/) for usage and application examples.\n\n## Requirements\n\nThe project depends on `motor` (the official asyncio MongoDB driver, which is built on top of `pymongo` and `bson`) and `pydantic` v2+.\n\n## Development\n\nUse `black` for code formatting, `mypy` for static code analysis, `ruff` for linting, and `pytest` (with `pytest-asyncio` and `pytest-docker`) for testing.\n\nThe documentation is built with `mkdocs-material` and `mkdocstrings`.\n\n## Contributing\n\nAll contributions are welcome.\n\n## Notes\n\nThis project is the continuation of [fastapi-motor-oil](https://github.com/volfpeter/fastapi-motor-oil) with support for [Pydantic v2](https://docs.pydantic.dev/latest/migration/), among other improvements. Migration from `fastapi-motor-oil` should be easy, but if you need help, just create an issue in the issue tracker.\n\n## License - MIT\n\nThe library is open-sourced under the conditions of the [MIT license](https://choosealicense.com/licenses/mit/).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async MongoDB with vanilla Pydantic v2+ - made easy.",
"version": "0.2501.2",
"project_urls": {
"Documentation": "https://volfpeter.github.io/motorhead",
"Homepage": "https://github.com/volfpeter/motorhead",
"tracker": "https://github.com/volfpeter/motorhead/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f893fccc25af3d871c10451c79e71a7cbe6b00062ccee42d349b9f818931ebc7",
"md5": "60fbdb5e92c80b576562ded9a3df8ed7",
"sha256": "e22ce3e9490eabb4d9df52d9abf842d9e0f3febeb58e2ab1d6c115f4db55b6ea"
},
"downloads": -1,
"filename": "motorhead-0.2501.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "60fbdb5e92c80b576562ded9a3df8ed7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 21925,
"upload_time": "2025-01-18T22:20:17",
"upload_time_iso_8601": "2025-01-18T22:20:17.783135Z",
"url": "https://files.pythonhosted.org/packages/f8/93/fccc25af3d871c10451c79e71a7cbe6b00062ccee42d349b9f818931ebc7/motorhead-0.2501.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d677b0bb81410cd8353db454ee2983a2d058b81cce7f7b1e6b788884c5f2b2c",
"md5": "c7f595ff82b8f14f618e0d47b8c965e2",
"sha256": "583b9c063086bf5f90ebb31204d08044eb4f49fbd1c50c7031147e9e08b806bd"
},
"downloads": -1,
"filename": "motorhead-0.2501.2.tar.gz",
"has_sig": false,
"md5_digest": "c7f595ff82b8f14f618e0d47b8c965e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 18568,
"upload_time": "2025-01-18T22:20:19",
"upload_time_iso_8601": "2025-01-18T22:20:19.707019Z",
"url": "https://files.pythonhosted.org/packages/1d/67/7b0bb81410cd8353db454ee2983a2d058b81cce7f7b1e6b788884c5f2b2c/motorhead-0.2501.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-18 22:20:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "volfpeter",
"github_project": "motorhead",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "motorhead"
}