{"id":18931963,"url":"https://github.com/crflynn/protobuf-init","last_synced_at":"2025-04-15T16:33:32.573Z","repository":{"id":57455143,"uuid":"437215001","full_name":"crflynn/protobuf-init","owner":"crflynn","description":"python protoc plugin for generating __init__.py (init) files","archived":false,"fork":false,"pushed_at":"2022-12-07T20:37:23.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T23:43:23.211Z","etag":null,"topics":["init","protobuf","protoc","protocol-buffers","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/crflynn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-11T07:17:37.000Z","updated_at":"2022-12-16T11:02:57.000Z","dependencies_parsed_at":"2023-01-24T22:15:30.363Z","dependency_job_id":null,"html_url":"https://github.com/crflynn/protobuf-init","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fprotobuf-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fprotobuf-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fprotobuf-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fprotobuf-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crflynn","download_url":"https://codeload.github.com/crflynn/protobuf-init/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249108484,"owners_count":21214002,"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":["init","protobuf","protoc","protocol-buffers","python"],"created_at":"2024-11-08T11:47:28.707Z","updated_at":"2025-04-15T16:33:32.226Z","avatar_url":"https://github.com/crflynn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protobuf-init\n\nTo install:\n\n```bash\npip install protobuf-init\n```\n\nThis package will create `__init__.py` files when compiling `*.proto` files. Optionally, it will create relative imports from generated `*_pb.py`, `*_pb_grpc.py`, and `*_grpc.py` files from `protobuf`, `grpcio`, and `grpclib` packages, respectively.\n\nUsing the `protos` folder of this project as an example, the following command will generate the contents of the `example` package, also in this project (assuming `grpcio-tools` is installed):\n\n```bash\nexport PROTO_PATH=./protos\nexport GEN_PATH=.\npython -m grpc_tools.protoc \\\n    --python_out=$GEN_PATH \\\n    --mypy_out=$GEN_PATH \\\n    --init_python_out=$GEN_PATH \\\n    --init_python_opt=imports=protobuf+grpcio+grpclib \\\n    --grpc_python_out=$GEN_PATH \\\n    --grpclib_python_out=$GEN_PATH \\\n    --proto_path=$PROTO_PATH \n    $(find $PROTO_PATH -name '*.proto')\n```\n\nThe `--init_python_out=$GEN_PATH` flag indicates to call the plugin to create the init files.\n\nThe `--init_python_opt=imports=protobuf+grpcio+grpclib` indicates which relative imports to include in the init files. Allowed options are `protobuf`, `grpcio`, `grpclib`, separated by `+`. (Note that both grpcio and grpclib generate `\u003cServiceName\u003eStub` objects which would collide in the init file.)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fprotobuf-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrflynn%2Fprotobuf-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fprotobuf-init/lists"}