{"id":28656006,"url":"https://github.com/timoniq/coolrepo","last_synced_at":"2025-06-13T08:09:53.582Z","repository":{"id":293845867,"uuid":"969038248","full_name":"timoniq/coolrepo","owner":"timoniq","description":"Viable repository utility for SQLAlchemy-based projects offering builder interface","archived":false,"fork":false,"pushed_at":"2025-05-17T13:18:02.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T14:28:21.723Z","etag":null,"topics":["repository-pattern","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timoniq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-19T08:39:17.000Z","updated_at":"2025-05-17T13:18:06.000Z","dependencies_parsed_at":"2025-05-17T14:28:29.807Z","dependency_job_id":null,"html_url":"https://github.com/timoniq/coolrepo","commit_stats":null,"previous_names":["timoniq/coolrepo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timoniq/coolrepo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoniq%2Fcoolrepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoniq%2Fcoolrepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoniq%2Fcoolrepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoniq%2Fcoolrepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timoniq","download_url":"https://codeload.github.com/timoniq/coolrepo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoniq%2Fcoolrepo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606988,"owners_count":22883564,"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":["repository-pattern","sqlalchemy"],"created_at":"2025-06-13T08:09:52.779Z","updated_at":"2025-06-13T08:09:53.565Z","avatar_url":"https://github.com/timoniq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coolrepo\n\n```python\nclass ClientRepository(BaseRepository[Client]):\n    @queryset_builder\n    def marital_status(self, marital_statuses: list[ClientMaritalStatus]):\n        return self.queryset.filter(Client.marital_status.in_(marital_statuses))\n    \n    @queryset_builder\n    @range_filter\n    def balance_range(self):\n        return Client.balance\n    \n    @queryset_builder\n    @range_filter\n    def created_at_range(self):\n        return Client.created_at\n\n\nasync def find_boyfriend():\n    qs = (\n        ClientRepository()\n        .marital_status([ClientMaritalStatus.SINGLE, ClientMaritalStatus.DIVORCED])\n        .balance_range(min=1_000_000)\n        .all()\n    )\n\n    all_count = await fetch_scalar(session, qs.count())\n    first_page = await fetch_many(session, qs.paginate(page=1, per_page=10))\n\n    print(f\"There are {all_count} available boyfriends\")\n    print(\"Printing first page:\")\n\n    for boyfriend in first_page:\n        print(boyfriend)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoniq%2Fcoolrepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimoniq%2Fcoolrepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoniq%2Fcoolrepo/lists"}