{"id":15665186,"url":"https://github.com/newswangerd/django_grpc_querysets","last_synced_at":"2026-04-24T13:31:47.273Z","repository":{"id":235006560,"uuid":"789899064","full_name":"newswangerd/django_grpc_querysets","owner":"newswangerd","description":"Django gRPC client and server that mimics the queryset API","archived":false,"fork":false,"pushed_at":"2024-04-21T21:08:49.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-19T23:05:54.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/newswangerd.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-04-21T21:08:17.000Z","updated_at":"2024-04-21T21:08:53.000Z","dependencies_parsed_at":"2024-04-22T01:32:11.462Z","dependency_job_id":"2001eedb-7340-42ec-bc91-d27eeed0072e","html_url":"https://github.com/newswangerd/django_grpc_querysets","commit_stats":null,"previous_names":["newswangerd/django_grpc_querysets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/newswangerd/django_grpc_querysets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newswangerd%2Fdjango_grpc_querysets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newswangerd%2Fdjango_grpc_querysets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newswangerd%2Fdjango_grpc_querysets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newswangerd%2Fdjango_grpc_querysets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newswangerd","download_url":"https://codeload.github.com/newswangerd/django_grpc_querysets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newswangerd%2Fdjango_grpc_querysets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32225732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-03T13:45:13.174Z","updated_at":"2026-04-24T13:31:47.257Z","avatar_url":"https://github.com/newswangerd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC Querysets\n\nThis library provides a gRPC client and server that allows for Django querysets to be executred remotetly.\n\n## Demo\n\n### Server\nCreate a management command for running the gRPC process:\n\n```python\nfrom concurrent import futures\n\nimport grpc\nfrom django.core.management.base import BaseCommand\nfrom grpc_querysets.server import QueryServer\nfrom grpc_querysets.lib import query_pb2_grpc\n\nfrom test_app import serializers\n\n\nclass Command(BaseCommand):\n\n    def handle(self, *args, **options):\n        port = \"50051\"\n        server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))\n\n        # Registers type \"test\" with TestModelSerializer\n        query_pb2_grpc.add_RemoteQuerysetServicer_to_server(\n            QueryServer({\"test\": serializers.TestModelSerializer}), server\n        )\n        server.add_insecure_port(\"[::]:\" + port)\n        server.start()\n        print(\"Server started, listening on \" + port)\n        server.wait_for_termination()\n```\n\nLaunch the gRPC server with `$ python manage.py start_grpc_server`\n\n### Client\n\nWith the server set up, we can now interract with our Django app using an API client that mimics the Django queryset API.\n\n\n```\n$ python manage.py shell\n\n\u003e\u003e\u003e from test_app import serializers\n\u003e\u003e\u003e from grpc_querysets.grpc_queryset import RemoteQueryset\n\u003e\u003e\u003e qs = RemoteQueryset(serializers.TestModelSerializer, \"test\")\n\n\u003e\u003e\u003e qs.create(name=\"foo\", f1=\"other field\")\nsending request\nrequest finished in 0.008120059967041016 seconds\n{'name': 'foo', 'f1': 'other field', 'f2': None, 'my_fk': None}\n\n\u003e\u003e\u003e qs.count()\nsending request\nrequest finished in 0.005173921585083008 seconds\n1\n\n\u003e\u003e\u003e qs.create(name=\"foo2\")\nsending request\nrequest finished in 0.008412837982177734 seconds\n{'name': 'foo2', 'f1': None, 'f2': None, 'my_fk': None}\n\n\u003e\u003e\u003e qs.create(name=\"my_name\")\nsending request\nrequest finished in 0.006021261215209961 seconds\n{'name': 'my_name', 'f1': None, 'f2': None, 'my_fk': None}\n\n\u003e\u003e\u003e list(qs.all())\nsending request\nrequest finished in 0.006189823150634766 seconds\nrequest finished in 0.0001957416534423828 seconds\nrequest finished in 0.00018596649169921875 seconds\n[{'name': 'foo', 'f1': 'other field', 'f2': None, 'my_fk': None}, {'name': 'foo2', 'f1': None, 'f2': None, 'my_fk': None}, {'name': 'my_name', 'f1': None, 'f2': None, 'my_fk': None}]\n\n\u003e\u003e\u003e list(qs.exclude(name__icontains=\"foo\"))\nsending request\nrequest finished in 0.00799417495727539 seconds\n[{'name': 'my_name', 'f1': None, 'f2': None, 'my_fk': None}]\n\n\u003e\u003e\u003e list(qs.filter(name__icontains=\"foo\"))\nsending request\nrequest finished in 0.005292177200317383 seconds\nrequest finished in 0.00015282630920410156 seconds\n[{'name': 'foo', 'f1': 'other field', 'f2': None, 'my_fk': None}, {'name': 'foo2', 'f1': None, 'f2': None, 'my_fk': None}]\n\n\u003e\u003e\u003e qs.filter(name__icontains=\"foo\").count()\nsending request\nrequest finished in 0.006677865982055664 seconds\n2\n\n\u003e\u003e\u003e qs.all().delete()\nsending request\nrequest finished in 0.009694814682006836 seconds\n\n\u003e\u003e\u003e qs.count()\nsending request\nrequest finished in 0.004435062408447266 seconds\n0\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewswangerd%2Fdjango_grpc_querysets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewswangerd%2Fdjango_grpc_querysets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewswangerd%2Fdjango_grpc_querysets/lists"}