{"id":29537914,"url":"https://github.com/openziti/ziti-sdk-py","last_synced_at":"2026-02-10T19:08:35.597Z","repository":{"id":37775678,"uuid":"486215589","full_name":"openziti/ziti-sdk-py","owner":"openziti","description":"Ziti SDK for Python","archived":false,"fork":false,"pushed_at":"2026-01-26T14:43:27.000Z","size":466,"stargazers_count":86,"open_issues_count":14,"forks_count":7,"subscribers_count":10,"default_branch":"main","last_synced_at":"2026-01-27T03:30:41.486Z","etag":null,"topics":["appsec","netsec","openziti","python","sdk","security","zero-trust","zero-trust-network","zero-trust-network-access","zero-trust-security","zerotrust","ztna"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openziti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-27T14:00:13.000Z","updated_at":"2026-01-26T14:43:30.000Z","dependencies_parsed_at":"2024-07-18T19:28:57.420Z","dependency_job_id":"4c1fe669-ac5d-4d6c-adc6-558cae121a8b","html_url":"https://github.com/openziti/ziti-sdk-py","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/openziti/ziti-sdk-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openziti","download_url":"https://codeload.github.com/openziti/ziti-sdk-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29313094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T17:48:59.043Z","status":"ssl_error","status_checked_at":"2026-02-10T17:45:37.240Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["appsec","netsec","openziti","python","sdk","security","zero-trust","zero-trust-network","zero-trust-network-access","zero-trust-security","zerotrust","ztna"],"created_at":"2025-07-17T04:43:09.154Z","updated_at":"2026-02-10T19:08:35.589Z","avatar_url":"https://github.com/openziti.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Ziggy loves python](https://raw.githubusercontent.com/openziti/branding/main/images/banners/Python.jpg)\n\n# Python SDK for OpenZiti\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://openziti.discourse.group/\"\u003e\n    \u003cimg src=\"https://img.shields.io/discourse/users?server=https%3A%2F%2Fopenziti.discourse.group\" alt=\"Discourse\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/openziti/ziti-sdk-py\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/openziti/ziti-sdk-py\" alt=\"GitHub Stars\"\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/openziti/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/dd/openziti\" alt=\"Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#support\"\u003eSupport\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\nThe Python SDK for [OpenZiti](https://github.com/openziti/ziti) is a library that enables you to integrate zero trust network connectivity into your Python \napplications, and establish secure connections with remote network resources over an OpenZiti network. The SDK also \nsimplifies the process of adding secure, zero-trust network connectivity built into your Python application. It's so \nsimple that it can be done in just two lines of code!\n\nOpenZiti is an open-source project that provides secure, zero-trust networking for applications running on any platform.\n\nMore specifically, the SDK allows you to integrate zero trust at the application level. This means your data is never \nexposed outside the application environment providing you with end-to-end encryption for ultimate security. See other \nzero trust models [here](https://docs.openziti.io/docs/learn/core-concepts/zero-trust-models/overview).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./images/ztaa-model-overview.png\" alt=\"Zero-trust-application-access\"\u003e\n\u003c/p\u003e\n\n## Getting Started\n\nIf you don't already have an OpenZiti network running, you can follow our [express install guides](https://docs.openziti.io/docs/learn/quickstarts/network/) \nto set up the network that fits your needs. Or, you can try [CloudZiti](https://netfoundry.io/pricing/) for free, check out more [here](https://docs.openziti.io/).\n\n### Installing the SDK\n\nThe Python SDK for OpenZiti is distributed via the Python Package Index (PyPI) and can be installed using \n[`pip`](https://pypi.org/project/openziti/) package manager.\n\n```shell\npip install openziti\n```\n\n### Using Ziti Python SDK\n\nWith just two lines of code, you can turn your plain old web server into a secure, zero-trust embedded application. \nBelow is an example of just how simple it is to get started.\n\nProvide a hostname, and port for your application, a simple monkey patch, and you're ready to go. You don't even need to \nknow what a monkey patch is! However, if you're interested in what a monkey patch is, expand the block below.\n\u003cdetails\u003e\n   \u003csummary\u003eWhat is Monkey Patching?\u003c/summary\u003e\n\n   \u003e Monkey patching allows developers to modify functionality for code even when they may not have access to the \n   \u003e original source code. Because Python has a dynamic object model allowing developers to modify objects at runtime. \n   \u003e Monkey patching allows developers to point a function call to any function they want. We can even implement our \n   \u003e own function that doesn't exist in the source code.\n   \u003e \n   \u003e The way this Python SDK uses monkey patching is to override existing functionality in socket handling by the \n   \u003e [socket module](https://docs.python.org/3/library/socket.html).\n   \u003e \n   \u003e Taking a look at the code below, the key lines are the last two. You can see how, for each monkey patched function, \n   \u003e we're telling that function call on the `sock` object to be directed to the function held in `_patch_methods`. \n   \u003e Therefore, this SDK can be used on any application that doesn't manage its own sockets.\n   \u003e ```python\n   \u003e def __init__(self, **kwargs):\n   \u003e     self.orig_socket = sock.socket\n   \u003e     sock.socket = _patchedSocket(kwargs)\n   \u003e     self.orig_methods = {m: sock.__dict__[m] for m, _ in\n   \u003e                          _patch_methods.items()}\n   \u003e     for m_name, _ in _patch_methods.items():\n   \u003e         sock.__dict__[m_name] = _patch_methods[m_name]\n   \u003e ```\n\n   \u003c/details\u003e\n\n```python\ncfg = dict(ztx=openziti.load('/path/to/identity.json'), service=\"name-of-ziti-service\")\nopenziti.monkeypatch(bindings={('127.0.0.1', 8000): cfg})\n```\n\nOr try our decorator pattern with a function annotation\n\n```python\n@openziti.zitify(bindings={('127.0.0.1', 18080): {'ztx': '/path/to/identity.json', 'service': 'name-of-ziti-service'}})\ndef yourFunction():\n```\n\nThe `binding` dictionary configures what happens when the code tries to open a server socket. Standard network addresses \nare mapped to ziti service configurations. For example, with his configuration\n\n```python\nbindings = {\n   ('0.0.0.0', 8080): { 'ztx': 'my-identity.json', 'service':'my-service' }\n}\n```\n\nwhen application opens a server socket and binds to address `0.0.0.0:8080` it will actually bind to the ziti service named `my-service`.\n\nBinding addresses can be specified with tuples, strings, or ints(ports). `('0.0.0.0', 8080)`, `'0.0.0.0:8080'`, `':8080'`, `8080` \nare all considered and treated the same.\n\n## Examples\n\nTry it out yourself with one of our [examples](sample%2FREADME.md)\n\n* [Flazk](sample/flask-of-ziti)\n* [Echo Server](sample/ziti-echo-server)\n* [HTTP Server](sample/ziti-http-server)\n* [Ziti Requests](sample/ziti-requests)\n* [Ziti Socket](sample/ziti-socket)\n* [Ziti urllib3](sample/ziti-urllib3)\n* [S3 Log Uploader (boto3)](sample/s3z)\n\n## Support\n\n### Looking for Help?\n\nPlease use these community resources for getting help. We use GitHub [issues](https://github.com/openziti/ziti-sdk-py/issues)\nfor tracking bugs and feature requests and have limited bandwidth to address them.\n\n- Read the [offical docs](https://docs.openziti.io/docs/learn/introduction/)\n- Join our [Developer Community](https://openziti.org)\n- Participate in discussion on [Discourse](https://openziti.discourse.group/)\n\n## Contributing\n\nDo you want to get your hands dirty and help make OpenZiti better? Contribute to the OpenZiti open-source project \nthrough bug reports, bug fixes, documentation, etc. Check out our guide on contributing to our projects [here](https://docs.openziti.io/policies/CONTRIBUTING.html).\n\n## License\n\n[Apache 2.0](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenziti%2Fziti-sdk-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenziti%2Fziti-sdk-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenziti%2Fziti-sdk-py/lists"}