{"id":28318230,"url":"https://github.com/afuenzalida/firedom","last_synced_at":"2026-04-29T08:33:40.659Z","repository":{"id":213688340,"uuid":"731322689","full_name":"afuenzalida/firedom","owner":"afuenzalida","description":"Simple Firestore ORM for Python.","archived":false,"fork":false,"pushed_at":"2023-12-26T13:00:01.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-14T06:20:23.770Z","etag":null,"topics":["firebase","firestore","orm","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/afuenzalida.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-12-13T20:29:07.000Z","updated_at":"2024-12-29T00:51:27.000Z","dependencies_parsed_at":"2023-12-26T14:27:16.428Z","dependency_job_id":"f70efe5b-477e-47de-af1e-192799aaca91","html_url":"https://github.com/afuenzalida/firedom","commit_stats":null,"previous_names":["afuenzalida/firedom"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/afuenzalida/firedom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afuenzalida%2Ffiredom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afuenzalida%2Ffiredom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afuenzalida%2Ffiredom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afuenzalida%2Ffiredom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afuenzalida","download_url":"https://codeload.github.com/afuenzalida/firedom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afuenzalida%2Ffiredom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32417779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["firebase","firestore","orm","python"],"created_at":"2025-05-25T07:12:13.015Z","updated_at":"2026-04-29T08:33:40.654Z","avatar_url":"https://github.com/afuenzalida.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firedom\n[![Tests](https://github.com/afuenzalida/firedom/actions/workflows/python-test.yml/badge.svg?branch=main)](https://github.com/afuenzalida/firedom/actions/workflows/python-test.yml)\n\n\nSimple Firestore ORM for Python.\n\n## Installation\n\n```shell\npip install firedom\n```\n\n## Getting started\n\n#### Initialize Firedom\n\n```python\nfrom firedom import Firedom\n\n\nfiredom = Firedom(service_account_json_path='your-credentials.json')\n```\n\n#### Define your models\n\nCreate a model for your Firestore collection by inheriting from `Model`:\n\n```python\nfrom dataclasses import dataclass\nfrom firedom import Firedom\n\n\nfiredom = Firedom(service_account_json_path='your-credentials.json')\n\n\n@dataclass\nclass Company(firedom.Model):\n    name: str\n\n\n@dataclass\nclass User(firedom.Model):\n    username: str\n    email: int\n    country: str\n    city: str\n    is_active: bool = True\n    number_of_pets: int = 0\n    company: Company\n\n    class Config:\n        # Required: Field to be used as document ID\n        document_id_field = 'username'\n```\n\n## Manipulate documents\n\n#### Create\n\n```python\ncompany = Company.collection.create(name='Example Company')\n\nuser = User.collection.create(\n    username='afuenzalida',\n    email='afuenzalida@example.com',\n    country='Chile',\n    city='Santiago',\n    company=company,\n)\n```\n\n#### Retrieve\n\n```python\nusers = User.collection.all()\n\nuser = User.collection.get('afuenzalida')\n```\n\n#### Filter\n\n```python\n# All arguments are considered as AND:\nusers = User.collection.where(\n    User.country == 'Chile',\n    User.is_active == True,\n    User.city.is_in(['Santiago', 'Valparaíso']),\n    User.number_of_pets \u003e 1,\n)\n\n# You can filter with OR using the | operator:\nusers = User.collection.where(\n    (User.country == 'Chile') |\n    (User.country == 'China'),\n)\n\n# And you can also filter explicitly with AND using the \u0026 operator:\nusers = User.collection.where(\n    (User.city == 'Santiago') \u0026\n    (User.number_of_pets == 0),\n)\n\n# Full example: Filter by active users from Chile or China:\nusers = User.collection.where(\n    (User.is_active == True) \u0026\n    (\n        (User.country == 'Chile') |\n        (User.country == 'China')\n    ),\n)\n```\n\n#### Sort\n\n```python\nusers = User.collection.where(\n    User.country == 'Chile',\n).order_by(\n    'email',\n    desc=True,\n)\n```\n\n#### Update\n\n```python\nuser = User.collection.get('afuenzalida')\nuser.country = 'Australia'\nuser.save()\n```\n\n#### Delete\n\n```python\nuser = User.collection.get('afuenzalida')\nuser.delete()\n\nUser.collection.all().delete()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafuenzalida%2Ffiredom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafuenzalida%2Ffiredom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafuenzalida%2Ffiredom/lists"}