{"id":21017307,"url":"https://github.com/richecr/duck-orm","last_synced_at":"2025-10-19T16:11:59.211Z","repository":{"id":43059471,"uuid":"345492634","full_name":"richecr/duck-orm","owner":"richecr","description":"ORM async for Python","archived":false,"fork":false,"pushed_at":"2024-12-08T05:05:09.000Z","size":637,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T04:51:11.315Z","etag":null,"topics":["assynchronous","database","hacktoberfest","orm","postgresql","python","sql","sqlite3"],"latest_commit_sha":null,"homepage":"https://richecr.github.io/duck-orm/","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/richecr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-03-08T01:06:24.000Z","updated_at":"2025-02-13T21:04:45.000Z","dependencies_parsed_at":"2023-10-03T04:09:54.611Z","dependency_job_id":null,"html_url":"https://github.com/richecr/duck-orm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fduck-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fduck-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fduck-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fduck-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richecr","download_url":"https://codeload.github.com/richecr/duck-orm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254282994,"owners_count":22045131,"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":["assynchronous","database","hacktoberfest","orm","postgresql","python","sql","sqlite3"],"created_at":"2024-11-19T10:18:50.084Z","updated_at":"2025-10-19T16:11:59.114Z","avatar_url":"https://github.com/richecr.png","language":"Python","readme":"# [DuckORM](https://pypi.org/project/duck-orm/)\n\nThe `Duck-ORM` package is an asynchronous ORM for Python, with support for **Postgres** and **SQLite**. ORM is built with:\n\n- [databases](https://github.com/encode/databases)\n\n**Requirements**: Python 3.8+\n\n**Duck-ORM is still under development**.\n\n## Installation\n\n```bash\n$ pip install duck-orm\n```\n\n!!! note\n    Don't forget to install `databases` before installing `duck-orm`. \n\n## Quickstart\n\nFor this example we will create a connection to the SQLite database and create a model.\n\n```bash\n$ pip install databases[sqlite]\n$ pip install ipython\n```\n\nNote that we want to use `ipython` here, because it supports using await expressions directly from the console.\n\n### Creating the connection to the SQLite database:\n\n```Python\nfrom databases import Database\nfrom duck_orm.model import Model\n\ndb = Database('sqlite:///example.db')\nawait db.connect()\n```\n\n### Defining a model:\n\n```Python\nfrom duck_orm.sql import fields as Field\n\nclass Person(Model):\n    __tablename__ = 'persons'\n    __db__ = db\n\n    id: int = Field.Integer(primary_key=True, auto_increment=True)\n    first_name: str = Field.String(unique=True)\n    last_name: str = Field.String(not_null=True)\n    age: int = Field.BigInteger(min_value=18)\n\n# Table creation in the database.\nawait Person.create()\n```\n\n- The `__tablename__` attribute is used to define the table's name in the database.\n- The `__db__` attribute is the instance of the database connection.\n- And then the definition of the fields, their types and restrictions.\n- And finally, the table creation in the database.\n\n## Author\n\n- Rich Ramalho - [@richecr](https://github.com/richecr) - [@richzinho_ecr](https://twitter.com/richzinho_ecr)\n\n## License\n\n`DuckORM` is built as an open-source tool and remains completely free(MIT license).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichecr%2Fduck-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichecr%2Fduck-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichecr%2Fduck-orm/lists"}