{"id":14979093,"url":"https://github.com/mauro-andre/pyodmongo","last_synced_at":"2025-04-07T06:06:07.822Z","repository":{"id":180548061,"uuid":"613938569","full_name":"mauro-andre/pyodmongo","owner":"mauro-andre","description":"A Python ODM for MongoDB","archived":false,"fork":false,"pushed_at":"2025-03-27T14:30:55.000Z","size":1277,"stargazers_count":43,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T05:04:43.604Z","etag":null,"topics":["async","asyncio","database","fastapi","mongo","mongo-aggregation","mongodb","mongodb-aggregation","nosql","pydantic","pydantic-v2","python","schema"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauro-andre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-14T15:10:48.000Z","updated_at":"2025-03-27T14:29:21.000Z","dependencies_parsed_at":"2024-04-23T22:38:51.769Z","dependency_job_id":"36426b81-4df8-4276-ab36-b320a734944b","html_url":"https://github.com/mauro-andre/pyodmongo","commit_stats":{"total_commits":355,"total_committers":3,"mean_commits":"118.33333333333333","dds":0.008450704225352101,"last_synced_commit":"2aa052c75babcf8b474935b801157810cfe43e67"},"previous_names":["mauro-andre/python_mongo_odm","mauro-andre/pyodmongo"],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauro-andre%2Fpyodmongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauro-andre%2Fpyodmongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauro-andre%2Fpyodmongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauro-andre%2Fpyodmongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauro-andre","download_url":"https://codeload.github.com/mauro-andre/pyodmongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asyncio","database","fastapi","mongo","mongo-aggregation","mongodb","mongodb-aggregation","nosql","pydantic","pydantic-v2","python","schema"],"created_at":"2024-09-24T13:59:12.927Z","updated_at":"2025-04-07T06:06:07.801Z","avatar_url":"https://github.com/mauro-andre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://pyodmongo.dev\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/mauro-andre/pyodmongo/master/docs/assets/images/pyodmongo_Logo_BG_White.png\" alt=\"coverage\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/pyodmongo/\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://img.shields.io/pypi/v/pyodmongo\" alt=\"coverage\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/pyodmongo/\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Python-3.11-green\" alt=\"pre-commit\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pyodmongo.dev/coverage\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fs3.amazonaws.com%2Fpyodmongo.dev%2Fcoverage%2Fcoverage_badge.json\u0026logo=pytest\" alt=\"pre-commit\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/pyodmongo\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://static.pepy.tech/badge/pyodmongo/month\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n**Documentation**: \u003ca href=\"https://pyodmongo.dev\" target=\"_blank\"\u003ehttps://pyodmongo.dev\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/mauro-andre/pyodmongo\" target=\"_blank\"\u003ehttps://github.com/mauro-andre/pyodmongo\u003c/a\u003e\n\n---\n\n**PyODMongo** is a modern Python library that functions as a robust Object-Document Mapper (ODM) for **MongoDB**. Leveraging the power of **Pydantic V2**, it seamlessly bridges the gap between Python and MongoDB, offering an intuitive and efficient way to interact with MongoDB documents.\n\nBy using **PyODMongo**, you can effortlessly map your Python classes to MongoDB documents, allowing for a more Pythonic approach to handling data. This library simplifies the entire process of defining and working with MongoDB collections, documents, and queries.\n\n**PyODMongo** is built on top of **Pydantic V2**, making the `DbModel` class an extension of Pydantic's `BaseModel`. This means that all the rich functionality of Pydantic's `BaseModel`, including **Validators**, **Fields** and **Model Config**, is readily available in `DbModel`.\n\n## Key Features\n\n- **Integration with pydantic**: Leverage the power of pydantic's data validation and modeling capabilities while working with MongoDB data.\n\n- **Automatic Schema Generation**: Define your MongoDB schema using pydantic models, and `pyodmongo` will automatically create the necessary MongoDB collections and ensure data consistency.\n\n- **Query Builder**: Easily construct complex MongoDB queries using Python code, reducing the need for writing raw query strings.\n\n- **Document Serialization**: Serialize and deserialize Python objects to and from MongoDB documents effortlessly.\n\n- **Async Support**: Take advantage of asynchronous programming with `pyodmongo` to enhance the performance of your MongoDB operations.\n\n- **Active Development**: `pyodmongo` is actively developed and maintained, with new features and improvements being regularly added.\n\n## Installation\n\nYou can install `pyodmongo` using pip:\n\n```bash\npip install pyodmongo\n```\n\n## Contributing\n\nContributions to `pyodmongo` are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/mauro-andre/pyodmongo).\n\n## License\n`pyodmongo` is licensed under the MIT License. See the [LICENSE file](https://github.com/mauro-andre/pyodmongo/blob/master/LICENSE) for more information.\n\n\n## Async exemple\n\n```python hl_lines=\"5\"\nfrom pyodmongo import AsyncDbEngine, DbModel\nfrom typing import ClassVar\nimport asyncio\n\nengine = AsyncDbEngine(mongo_uri='mongodb://localhost:27017', db_name='my_db')\n\n\nclass Product(DbModel):\n    name: str\n    price: float\n    is_available: bool\n    _collection: ClassVar = 'products'\n\n\nbox = Product(name='Box', price='5.99', is_available=True)\n\n\nasync def main():\n    result = await engine.save(box)\n\nasyncio.run(main())\n```\n\n## Sync exemple\n\n```python hl_lines=\"4\"\nfrom pyodmongo import DbEngine, DbModel\nfrom typing import ClassVar\n\nengine = DbEngine(mongo_uri='mongodb://localhost:27017', db_name='my_db')\n\n\nclass Product(DbModel):\n    name: str\n    price: float\n    is_available: bool\n    _collection: ClassVar = 'products'\n\n\nbox = Product(name='Box', price='5.99', is_available=True)\n\nresult = engine.save(box)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauro-andre%2Fpyodmongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauro-andre%2Fpyodmongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauro-andre%2Fpyodmongo/lists"}