{"id":21232853,"url":"https://github.com/kougen/py-repositories","last_synced_at":"2025-07-25T21:33:30.750Z","repository":{"id":229240485,"uuid":"776211908","full_name":"kougen/py-repositories","owner":"kougen","description":"A library which implements the repository pattern for multiple providers","archived":false,"fork":false,"pushed_at":"2024-06-16T20:57:19.000Z","size":58,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-16T20:48:28.378Z","etag":null,"topics":["helpful","json","package","pip","postgresql","python","repository-pattern","solid-principles"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyrepositories/","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/kougen.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}},"created_at":"2024-03-22T22:56:55.000Z","updated_at":"2024-04-10T11:38:14.000Z","dependencies_parsed_at":"2024-04-03T20:30:38.803Z","dependency_job_id":null,"html_url":"https://github.com/kougen/py-repositories","commit_stats":null,"previous_names":["kougen/py-repositories"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kougen%2Fpy-repositories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kougen%2Fpy-repositories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kougen%2Fpy-repositories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kougen%2Fpy-repositories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kougen","download_url":"https://codeload.github.com/kougen/py-repositories/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217317,"owners_count":20903037,"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":["helpful","json","package","pip","postgresql","python","repository-pattern","solid-principles"],"created_at":"2024-11-20T23:54:56.297Z","updated_at":"2025-04-04T17:21:46.317Z","avatar_url":"https://github.com/kougen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python SOLID Repository pattern implementations\n\nThis repository contains a simple implementation of the Repository pattern in Python. The implementation is based on the SOLID principles.\n\nIt supports:\n- PostgreSQL\n- JSON\n\n## Usage\n\nCheck the ./scripts/main.py for a full example.\n\n```py\n\n# main.py\n\n# ...\n\n# Define the fields for the table and entities\n\ndatasource = DataSource()\n\ntable = JsonTable('users', os.path.join(path_root, 'scripts', 'data'), fields)\ndatasource.add_table(table)\n\ndatasource.clear('users')\n\ndummy_users = [\n    User('John Doe', 'test@asd.com', 'johndoe'),\n    User('Jane Doe', 'test3@asd.com', 'janedoe'),\n    User('Mary Poppins', 'poppinst@industry.com', 'marypoppins'),\n]\n\nfor user in dummy_users:\n    datasource.insert('users', user)\n\nfilters = [\n    Filter([\n        FilterCondition('name', 'Doe', FilterTypes.CONTAINS),\n        FilterCondition('email', 'test@asd.com', FilterTypes.EQUAL)\n    ]),\n    Filter([\n        FilterCondition('name', 'Mary', FilterTypes.CONTAINS),\n    ])\n]\n\nfor user in datasource.get_by_filters('users', filters):\n    print(user)\n\nprint(\"Unique\") \nmary = datasource.get_unique('users', 'username', 'marypoppins')\nprint(mary)\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkougen%2Fpy-repositories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkougen%2Fpy-repositories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkougen%2Fpy-repositories/lists"}