{"id":19013084,"url":"https://github.com/meowmeowcode/misery","last_synced_at":"2025-04-23T00:07:55.200Z","repository":{"id":37749071,"uuid":"482946653","full_name":"meowmeowcode/misery","owner":"meowmeowcode","description":"asyncio-friendly database toolkit","archived":false,"fork":false,"pushed_at":"2023-08-04T07:07:30.000Z","size":172,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T00:07:42.904Z","etag":null,"topics":["asyncio","clickhouse","databases","postgresql","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/meowmeowcode.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,"zenodo":null}},"created_at":"2022-04-18T18:03:52.000Z","updated_at":"2023-09-10T18:21:31.000Z","dependencies_parsed_at":"2025-04-17T05:37:37.425Z","dependency_job_id":"c9782c17-dc24-4de2-9727-a3677e402a6f","html_url":"https://github.com/meowmeowcode/misery","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowcode%2Fmisery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowcode%2Fmisery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowcode%2Fmisery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowcode%2Fmisery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meowmeowcode","download_url":"https://codeload.github.com/meowmeowcode/misery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343944,"owners_count":21415040,"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":["asyncio","clickhouse","databases","postgresql","python"],"created_at":"2024-11-08T19:21:45.721Z","updated_at":"2025-04-23T00:07:55.169Z","avatar_url":"https://github.com/meowmeowcode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/meowmeowcode/misery/blob/clickhouse/docs/source/_static/misery.png\" width=\"200\" alt=\"misery\" /\u003e\n\u003c/p\u003e\n\n\n# Misery\n\nAn **asyncio**-friendly database toolkit that works well with **MyPy**.\n\n## Supported database systems\n\nAt the moment, PostgreSQL and ClickHouse are supported.\n\n## Documentation\n\nThe latest documentation: https://misery.readthedocs.io\n\n## Usage example\n\n```python\nfrom dataclasses import dataclass\nfrom uuid import UUID, uuid4\n\nimport asyncpg\nfrom pypika import Table\nfrom misery.postgres import PostgresRepo\n\n\nconn = await asyncpg.connect(\"postgresql://postgres:password@localhost/postgres\")\n\nawait conn.execute(\n    \"\"\"\n        CREATE TABLE users (\n            id uuid PRIMARY KEY,\n            name text NOT NULL UNIQUE\n        );\n    \"\"\"\n)\n\n\n@dataclass\nclass User:\n    id: UUID\n    name: str\n\n\nclass UsersRepo(PostgresRepo[User]):\n    table = Table(\"users\")\n\n\nusers_repo = UsersRepo(conn)\n\nuser_id = uuid4()\nbob = User(id=user_id, name=\"Bob\")\nawait users_repo.add(bob)\n\nuser = await users_repo.get(id=user_id)\nassert user == bob\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowmeowcode%2Fmisery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeowmeowcode%2Fmisery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowmeowcode%2Fmisery/lists"}