{"id":16096865,"url":"https://github.com/miksus/red-bird","last_synced_at":"2026-04-20T16:05:52.007Z","repository":{"id":38417892,"uuid":"469222489","full_name":"Miksus/red-bird","owner":"Miksus","description":"Repository Patterns for Python","archived":false,"fork":false,"pushed_at":"2023-10-06T17:34:31.000Z","size":455,"stargazers_count":166,"open_issues_count":15,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-10T17:44:02.459Z","etag":null,"topics":["database","mongodb","orm","repository-pattern","sql"],"latest_commit_sha":null,"homepage":"https://red-bird.readthedocs.io","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/Miksus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Miksus"}},"created_at":"2022-03-12T23:17:37.000Z","updated_at":"2024-10-01T05:32:39.000Z","dependencies_parsed_at":"2024-06-18T19:48:09.911Z","dependency_job_id":"efa7c625-a498-4d9d-9bfa-5050b78ea506","html_url":"https://github.com/Miksus/red-bird","commit_stats":{"total_commits":303,"total_committers":1,"mean_commits":303.0,"dds":0.0,"last_synced_commit":"c76a5e480830228330eca88c6bca0bf63ccbc34f"},"previous_names":["miksus/red-base"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miksus%2Fred-bird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miksus%2Fred-bird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miksus%2Fred-bird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miksus%2Fred-bird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Miksus","download_url":"https://codeload.github.com/Miksus/red-bird/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"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":["database","mongodb","orm","repository-pattern","sql"],"created_at":"2024-10-09T17:44:05.389Z","updated_at":"2026-04-20T16:05:51.962Z","avatar_url":"https://github.com/Miksus.png","language":"Python","funding_links":["https://github.com/sponsors/Miksus"],"categories":[],"sub_categories":[],"readme":"![Red Bird](https://raw.githubusercontent.com/Miksus/red-bird/master/docs/logo.svg)\n\n\n# Repository Patterns for Python\n\u003e Generic database implemetation for SQL, MongoDB and in-memory lists\n\n---\n\n[![Pypi version](https://badgen.net/pypi/v/redbird)](https://pypi.org/project/redbird/)\n[![build](https://github.com/Miksus/red-bird/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Miksus/red-bird/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/Miksus/red-bird/branch/master/graph/badge.svg?token=GVBWCKHL1N)](https://codecov.io/gh/Miksus/red-bird)\n[![Documentation Status](https://readthedocs.org/projects/red-bird/badge/?version=latest)](https://red-bird.readthedocs.io)\n[![PyPI pyversions](https://badgen.net/pypi/python/redbird)](https://pypi.org/project/redbird/)\n\nRepository pattern is a technique to abstract the data access from\nthe domain/business logic. In other words, it decouples the database \naccess from the application code. The aim is that the code runs the \nsame regardless if the data is stored to an SQL database, NoSQL \ndatabase, file or even as an in-memory list.\n\nRead more about the repository patterns in the [official documentation](https://red-bird.readthedocs.io).\n\n## Why?\n\nRepository pattern has several benefits over embedding the \ndatabase access to the application:\n\n- Faster prototyping and development\n- Easier to migrate the database\n- More readable code, Pythonic\n- Unit testing and testing in general is safer and easier \n\n## Features\n\nMain features:\n\n- Support for Pydantic models for data validation\n- Identical way to create, read, update and delete (CRUD)\n- Pythonic and simple syntax\n- Support for more complex queries (greater than, not equal, less than etc.)\n\nSupported repositories:\n\n- SQL\n- MongoDB\n- In-memory (Python list)\n- JSON files\n- CSV file\n\n## Examples\n\nFirst, we create a simple repo:\n\n```python\nfrom redbird.repos import MemoryRepo\nrepo = MemoryRepo()\n```\n\n\u003e Note: the following examples work on any repository, not just in-memory repository.\n\nAdding/creating items:\n\n```python\nrepo.add({\"name\": \"Anna\", \"nationality\": \"British\"})\n```\n\nReading items:\n\n```python\nrepo.filter_by(name=\"Anna\").all()\n```\n\nUpdating items:\n\n```python\nrepo.filter_by(name=\"Anna\").update(nationality=\"Finnish\")\n```\n\nDeleting items:\n\n```python\nrepo.filter_by(name=\"Anna\").delete()\n```\n\nSee more from the [official documentation](https://red-bird.readthedocs.io).\n\n## Author\n\n* **Mikael Koli** - [Miksus](https://github.com/Miksus) - koli.mikael@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiksus%2Fred-bird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiksus%2Fred-bird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiksus%2Fred-bird/lists"}