{"id":19844579,"url":"https://github.com/beanieodm/bunnet","last_synced_at":"2025-06-15T09:09:20.550Z","repository":{"id":62706131,"uuid":"561901545","full_name":"BeanieODM/bunnet","owner":"BeanieODM","description":"Synchronous Python ODM for MongoDB","archived":false,"fork":false,"pushed_at":"2025-06-02T19:07:16.000Z","size":2509,"stargazers_count":117,"open_issues_count":6,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-08T15:01:47.663Z","etag":null,"topics":["beanie","mongodb","odm","python","synchronous"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeanieODM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2022-11-04T18:51:44.000Z","updated_at":"2025-05-30T08:27:27.000Z","dependencies_parsed_at":"2025-05-19T20:21:32.716Z","dependency_job_id":"7dad7d03-a698-4cad-a904-d91a8f4ab15a","html_url":"https://github.com/BeanieODM/bunnet","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"a6bb240901bb50878b2ccd2ad8ef7eec4f0094ac"},"previous_names":["beanieodm/bunnet","roman-right/bunnet"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/BeanieODM/bunnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeanieODM%2Fbunnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeanieODM%2Fbunnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeanieODM%2Fbunnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeanieODM%2Fbunnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeanieODM","download_url":"https://codeload.github.com/BeanieODM/bunnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeanieODM%2Fbunnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259949683,"owners_count":22936412,"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":["beanie","mongodb","odm","python","synchronous"],"created_at":"2024-11-12T13:04:44.430Z","updated_at":"2025-06-15T09:09:20.527Z","avatar_url":"https://github.com/BeanieODM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![shields badge](https://shields.io/badge/-docs-blue)](https://roman-right.github.io/bunnet/)\n[![pypi](https://img.shields.io/pypi/v/bunnet.svg)](https://pypi.python.org/pypi/bunnet)\n\n[![Bunnet](https://github.com/roman-right/bunnet/raw/main/docs/assets/1.png)](https://github.com/roman-right/bunnet)\n\n*The logo is generated by [WOMBO Dream](https://www.wombo.art)*\n\n## Overview\n\n[Bunnet](https://github.com/roman-right/bunnet) - is a Python object-document mapper (ODM) for MongoDB. It is a synchronous fork of [Beanie ODM](https://github.com/roman-right/beanie).\n\nWhen using Bunnet each database collection has a corresponding `Document` that\nis used to interact with that collection. In addition to retrieving data,\nBunnet allows you to add, update, or delete documents from the collection as\nwell.\n\nBunnet saves you time by removing boilerplate code, and it helps you focus on\nthe parts of your app that actually matter.\n\n## Installation\n\n### PIP\n\n```shell\npip install bunnet\n```\n\n### Poetry\n\n```shell\npoetry add bunnet\n```\n## Example\n\n```python\nfrom typing import Optional\n\nfrom pymongo import MongoClient\nfrom pydantic import BaseModel\n\nfrom bunnet import Document, Indexed, init_bunnet\n\n\nclass Category(BaseModel):\n    name: str\n    description: str\n\n\nclass Product(Document):\n    name: str                          # You can use normal types just like in pydantic\n    description: Optional[str] = None\n    price: Indexed(float)              # You can also specify that a field should correspond to an index\n    category: Category                 # You can include pydantic models as well\n\n\n\n# Bunnet uses Pymongo client under the hood \nclient = MongoClient(\"mongodb://user:pass@host:27017\")\n\n# Initialize bunnet with the Product document class\ninit_bunnet(database=client.db_name, document_models=[Product])\n\nchocolate = Category(name=\"Chocolate\", description=\"A preparation of roasted and ground cacao seeds.\")\n# Bunnet documents work just like pydantic models\ntonybar = Product(name=\"Tony's\", price=5.95, category=chocolate)\n# And can be inserted into the database\ntonybar.insert() \n\n# You can find documents with pythonic syntax\nproduct = Product.find_one(Product.price \u003c 10).run()\n\n# And update them\nproduct.set({Product.name:\"Gold bar\"})\n\n```\n\n## Links\n\n### Documentation\n\n- **[Doc](https://beanieodm.github.io/bunnet/)** - Tutorial, API documentation, and development guidelines.\n\n### Resources\n\n- **[GitHub](https://github.com/roman-right/bunnet)** - GitHub page of the\n  project\n- **[Changelog](https://roman-right.github.io/bunnet/changelog)** - list of all\n  the valuable changes\n- **[Discord](https://discord.gg/29mMrEBvr4)** - ask your questions, share\n  ideas or just say `Hello!!`\n\n----\nSupported by [JetBrains](https://jb.gg/OpenSource)\n\n[![JetBrains](https://raw.githubusercontent.com/roman-right/beanie/main/assets/logo/jetbrains.svg)](https://jb.gg/OpenSource)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanieodm%2Fbunnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeanieodm%2Fbunnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanieodm%2Fbunnet/lists"}