{"id":27786327,"url":"https://github.com/clever/discovery-python","last_synced_at":"2025-07-27T03:12:00.959Z","repository":{"id":14424869,"uuid":"53451437","full_name":"Clever/discovery-python","owner":"Clever","description":"Programmatically find service endpoints (i.e. discovery-go for python)","archived":false,"fork":false,"pushed_at":"2025-07-19T15:14:01.000Z","size":23,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":62,"default_branch":"master","last_synced_at":"2025-07-19T19:12:49.659Z","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/Clever.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"2016-03-08T23:00:57.000Z","updated_at":"2024-09-23T14:58:47.000Z","dependencies_parsed_at":"2025-04-30T16:01:03.460Z","dependency_job_id":"bd899c5e-6404-4842-b302-58a9cc0c5745","html_url":"https://github.com/Clever/discovery-python","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Clever/discovery-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Fdiscovery-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Fdiscovery-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Fdiscovery-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Fdiscovery-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clever","download_url":"https://codeload.github.com/Clever/discovery-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Fdiscovery-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267293933,"owners_count":24065335,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-04-30T15:59:42.078Z","updated_at":"2025-07-27T03:12:00.907Z","avatar_url":"https://github.com/Clever.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discovery-python\n\nThis library programmatically finds endpoints for dependencies. Similar to [discovery-go](https://github.com/Clever/discovery-go) and [disocvery-node](https://github.com/Clever/discovery-node).\n\nSee [Service Discovery](https://clever.atlassian.net/wiki/spaces/ENG/pages/116686857/Discovery) for more details.\n\n## Installation\n\n### pip\n\nAssuming discovery v0.1.0 is being installed:\n\n```sh\npip install git+https://github.com/Clever/discovery-python.git@v0.1.0\n```\n\n### setup.py\n\n```python\nfrom setuptools import setup\n\n# Assuming discovery v0.1.0 is being installed:\nsetup(\n\n    # ...\n\n    install_requires=['discovery==0.1.0'],\n    dependency_links=[\n      'https://github.com/Clever/discovery-python/tarball/v0.1.0#egg=discovery-0.1.0'\n    ],\n\n    # ...\n\n)\n```\n\n## Usage\n\n```python\nimport discovery\n\ntry:\n\tstoked_url = discovery.url('stoked', 'thrift')\n\n\tstoked_host_and_port = discovery.host_port('stoked', 'thrift')\n\n\tstoked_host = discovery.host('stoked', 'thrift')\n\n\tstoked_port = discovery.port('stoked', 'thrift')\n\n  clever_com_url = discovery.external_url('clever.com')\n\nexcept discovery.MissingEnvironmentVariableError as e:\n\tprint 'ERROR: Stoked discovery failed: {}.'.format(e)\n\n```\n\n## Development\n\n### Publishing a new version\n\n1. Bump the version in the `VERSION` file and update the changelog in `CHANGES.md`.\n2. Merge your changes into `master`.\n3. Checkout `master`\n4. Run the publish script:\n\n    ```sh\n    ./publish.sh\n    ```\n\n### Implementation Details\n\nCurrently, `discovery-{go,node,python}` looks for environment variables with the following format:\n\n```\nSERVICE_{SERVICE_NAME}_{EXPOSE_NAME}_{PROTO,HOST,PORT}\n```\n\nThese environment variables are autogenerated by our deployment tooling.\nThree env-vars are created for each app listed in the `dependencies` section of caller's launch yaml.\n\nFor example, if an app lists `district-authorizations` as a dependency, fab and catapult will generate this env-vars triplet:\n\n```bash\nSERVICE_DISTRICT_AUTHORIZATIONS_HTTP_PROTO = \"http\"\nSERVICE_DISTRICT_AUTHORIZATIONS_HTTP_HOST = \"district-authorizations.ops.clever.com\"\nSERVICE_DISTRICT_AUTHORIZATIONS_HTTP_PORT = \"80\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Fdiscovery-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclever%2Fdiscovery-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Fdiscovery-python/lists"}