{"id":15568527,"url":"https://github.com/cetanu/envoy_data_plane","last_synced_at":"2025-10-02T23:34:44.052Z","repository":{"id":44537809,"uuid":"235751771","full_name":"cetanu/envoy_data_plane","owner":"cetanu","description":"A conversion of envoyproxy/data-plane-api into Python dataclasses using betterproto","archived":false,"fork":false,"pushed_at":"2024-12-24T00:35:12.000Z","size":1156,"stargazers_count":17,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T23:54:08.774Z","etag":null,"topics":["envoy","envoy-data-plane","envoy-xds","envoyproxy","python-library"],"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/cetanu.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}},"created_at":"2020-01-23T08:19:06.000Z","updated_at":"2024-11-14T20:33:52.000Z","dependencies_parsed_at":"2023-11-13T08:29:29.685Z","dependency_job_id":"9258fdf1-dd96-4679-b6d7-90a7969e6635","html_url":"https://github.com/cetanu/envoy_data_plane","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":0.4181818181818182,"last_synced_commit":"4228c7f6ba879016406305412da58521c62dade0"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cetanu%2Fenvoy_data_plane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cetanu%2Fenvoy_data_plane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cetanu%2Fenvoy_data_plane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cetanu%2Fenvoy_data_plane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cetanu","download_url":"https://codeload.github.com/cetanu/envoy_data_plane/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235049007,"owners_count":18927715,"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":["envoy","envoy-data-plane","envoy-xds","envoyproxy","python-library"],"created_at":"2024-10-02T17:16:36.942Z","updated_at":"2025-10-02T23:34:38.627Z","avatar_url":"https://github.com/cetanu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envoy_data_plane\n\nA conversion of envoyproxy/data-plane-api protocol buffers into Python dataclasses using betterproto\n\n## Intended usage\n\nThis is a helper library that allows importing every type available in the envoy API.\n\nOne use-case might be generating Envoy configuration using a Python script.\n\nIn my case, I will use this library in my custom built control-plane, \nso that I have autocompletion in my IDE, and a basic form of validation.\n\nIn future, this may also help with building an idiomatic GRPC control-plane in Python.\n\n## Installation\n\nThis package is published to PyPI:\n\n```shell script\npython -m pip install envoy_data_plane\n```\n\n## Installing specific XDS revisions\n\nThere are branches available with compiled python protobuf files.  \nTo install them, you can use the following syntax:\n\n```shell script\npip install git+https://github.com/cetanu/envoy_data_plane@\u003cBRANCH NAME\u003e\n```\n\nExamples:\n\n```\npip install git+https://github.com/cetanu/envoy_data_plane@envoy_v1.13.7\npip install git+https://github.com/cetanu/envoy_data_plane@envoy_v1.16.2\npip install git+https://github.com/cetanu/envoy_data_plane@envoy_v1.17.2\npip install git+https://github.com/cetanu/envoy_data_plane@envoy_v1.18.2\npip install git+https://github.com/cetanu/envoy_data_plane@envoy_v1.19.0\n```\n\nNot all versions may be available. Raise an issue if you need another one added.\n\n## Example\n\n```python\nimport stringcase\nimport json\nimport envoy_data_plane.envoy.api.v2 as envoy\n\nroute_config = envoy.RouteConfiguration(\n    name='MyRouteConfig',\n    virtual_hosts=[\n        envoy.route.VirtualHost(\n            name='SomeWebsite',\n            domains=['foobar.com'],\n            routes=[\n                envoy.route.Route(\n                    name='catchall',\n                    match=envoy.route.RouteMatch(\n                        prefix='/'\n                    ),\n                    direct_response=envoy.route.DirectResponseAction(\n                        status=200,\n                        body=envoy.core.DataSource(\n                            inline_string='Hello there'\n                        )\n                    )\n                )\n            ]\n        )\n    ]\n)\n\nresponse = envoy.DiscoveryResponse(\n    version_info='0',\n    resources=[\n        route_config\n    ],\n)\n\nprint(\n    json.dumps(response.to_dict(casing=stringcase.snakecase), indent=2)\n)\n```\n\nResult:\n```\n{\n  \"version_info\": \"0\",\n  \"resources\": [\n    {\n      \"name\": \"MyRouteConfig\",\n      \"virtual_hosts\": [\n        {\n          \"name\": \"SomeWebsite\",\n          \"domains\": [\n            \"foobar.com\"\n          ],\n          \"routes\": [\n            {\n              \"name\": \"catchall\",\n              \"match\": {\n                \"prefix\": \"/\",\n                \"headers\": [],\n                \"query_parameters\": []\n              },\n              \"direct_response\": {\n                \"status\": 200,\n                \"body\": {\n                  \"inline_string\": \"Hello there\"\n                }\n              },\n              \"request_headers_to_add\": [],\n              \"response_headers_to_add\": []\n            }\n          ],\n          \"virtual_clusters\": [],\n          \"rate_limits\": [],\n          \"request_headers_to_add\": [],\n          \"response_headers_to_add\": []\n        }\n      ],\n      \"response_headers_to_add\": [],\n      \"request_headers_to_add\": []\n    }\n  ]\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcetanu%2Fenvoy_data_plane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcetanu%2Fenvoy_data_plane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcetanu%2Fenvoy_data_plane/lists"}