{"id":44794350,"url":"https://github.com/jaykv/mongospecs","last_synced_at":"2026-02-16T12:25:34.537Z","repository":{"id":237620922,"uuid":"723586846","full_name":"jaykv/mongospecs","owner":"jaykv","description":"mongo odm for pydantic, msgspec, and attrs","archived":false,"fork":false,"pushed_at":"2024-12-16T04:17:24.000Z","size":931,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T21:24:56.856Z","etag":null,"topics":["mongodb","odm","python"],"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/jaykv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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-11-26T06:06:35.000Z","updated_at":"2024-12-16T04:14:29.000Z","dependencies_parsed_at":"2024-05-02T21:08:41.635Z","dependency_job_id":"2f51cfe7-60bc-4110-862c-74ec7b654744","html_url":"https://github.com/jaykv/mongospecs","commit_stats":null,"previous_names":["jaykv/mongospecs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jaykv/mongospecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykv%2Fmongospecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykv%2Fmongospecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykv%2Fmongospecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykv%2Fmongospecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaykv","download_url":"https://codeload.github.com/jaykv/mongospecs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykv%2Fmongospecs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29507902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mongodb","odm","python"],"created_at":"2026-02-16T12:25:33.839Z","updated_at":"2026-02-16T12:25:34.532Z","avatar_url":"https://github.com/jaykv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongospecs\n\nBuilt on top of the https://github.com/GetmeUK/MongoFrames ODM, with:\n- Pydantic (`BaseModel`), attrs (`@define`), and msgspec (`Struct`) support for defining schema models (specs)\n- Type-hints\n- *Spec adapters*\n  - Build a spec out of existing BaseModels, attrs classes, or Structs\n- *Raw BSON encode/decode for specs/mongo documents*\n## Install\nChoose from one of the following:\n* `pip install mongospecs` for msgspec only\n* `pip install mongospecs[pydantic]` for msgspec and pydantic only\n* `pip install mongospecs[attrs]` for msgspec and attrs only\n* `pip install mongospecs[pydantic,attrs]` for msgspec, pydantic, and attrs\n\n### Example\n```python\n# Import Spec, either...\n## 1. with pydantic:\nfrom mongospecs.pydantic import Spec\n\n## 2. with msgspec:\nfrom mongospecs.msgspec import Spec\n\n## 3. with attrs:\nfrom mongospecs.attrs import Spec\n\n# Define schema model\nclass Dragon(Spec):\n    _collection = \"dragons\" # Optional. If not defined, uses the class name by default.\n\n    name: str\n    breed: Optional[str] = None\n\n# create\nburt = Dragon(name=\"Burt\", breed=\"Cold-drake\")\nprint(burt.name)  # Burt\nprint(burt.breed) # Cold-drake\n\n# insert\nburt.insert()\nprint(burt.id)  # inserted document ObjectId\n\n# fetch\ndoc = Dragon.find_one({\"name\": \"Burt\"})  # returns raw mongo document\n\n# delete\nburt.delete()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaykv%2Fmongospecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaykv%2Fmongospecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaykv%2Fmongospecs/lists"}