{"id":29089806,"url":"https://github.com/benzinga/python-bztcp","last_synced_at":"2025-10-30T05:11:12.801Z","repository":{"id":83531430,"uuid":"45938906","full_name":"Benzinga/python-bztcp","owner":"Benzinga","description":"Benzinga TCP client library for Python.","archived":false,"fork":false,"pushed_at":"2021-09-10T14:37:26.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-28T04:05:07.812Z","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/Benzinga.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-11-10T20:41:41.000Z","updated_at":"2021-09-10T14:37:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"b865dbc1-52d5-4801-83de-9595b7c62df6","html_url":"https://github.com/Benzinga/python-bztcp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Benzinga/python-bztcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benzinga%2Fpython-bztcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benzinga%2Fpython-bztcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benzinga%2Fpython-bztcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benzinga%2Fpython-bztcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Benzinga","download_url":"https://codeload.github.com/Benzinga/python-bztcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benzinga%2Fpython-bztcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265651938,"owners_count":23805449,"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":[],"created_at":"2025-06-28T04:05:05.509Z","updated_at":"2025-10-30T05:11:07.475Z","avatar_url":"https://github.com/Benzinga.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python BzTCP\nThis package provides a pure-Python implementation of the Benzinga TCP protcol.\n\n**-\u003e\u003e Service Deprecated \u003c\u003c-**\n\n# Features\n\n  * Compatible with Python 2.6+ and Python 3.\n  * No external dependencies.\n  * Supports large messages.\n\n# Getting Started\nTo install the library, invoke setup.py as usual:\n\n    python setup.py install\n\nTo test the Python client, you can run the package's built-in demo by running the\nmodule directly. In Python 3 and 2.7+:\n\n    python -m bztcp USERNAME KEY\n\nTo test the Python client with configurable retries, delay and backoff you can run\nthe package's built-in demo by running the module directly. In Python 3 and 2.7+:\n\n    python -m bztcp USERNAME KEY RETRIES DELAY BACKOFF\n\nIn Python 2.6 and under, you will need the following:\n\n    python -m bztcp.__main__ USERNAME KEY\n\nVersions 2.5 and under are untested, but should be possible to support without\ndrastic modifications. Please contact support if you are encountering errors you\nbelieve to be related to Python version.\n\n# Usage\nThe bulk of the work is done by the `bztcp.client.Client` class. To get an idea\nof how to use it, you can check out the demo client at `bztcp/__main__.py`. Here's\na similar example that prints out titles as they come in:\n\n```python\nfrom __future__ import print_function\nfrom bztcp.client import Client\n\nclient = Client(username='USERNAME', key='APIKEY')\nfor content in client.content_items():\n    title = content.get('title', None)\n    print(title)\n```\n\nTo get an idea of how to pass configurable retries, delay and backoff in the\n`bztcp.client.Client` class, here's a similar example using the above code snippet:  \n```python\nfrom __future__ import print_function\nfrom bztcp.client import Client\n\nclient = Client(username='USERNAME', key='APIKEY', retries=5, delay=90, backoff=2)\nfor content in client.content_items():\n    title = content.get('title', None)\n    print(title)\n```\n\nIf you want to get a more granular look at the connection status, \nyou can handle individual messages instead of just content items,\nas well as disconnect the stream on command:\n\n```python\nfrom bztcp.client import Client, STATUS_STREAM\nimport os\n\nclient = Client(username='USERNAME', key='APIKEY')\n\nwhile True:\n    try:\n        msg = client.next_msg()\n        \n        if msg.status == STATUS_STREAM:\n            print(f\"Content item: {msg.data}\")\n        else:\n            print(f\"Status: {msg.status}\")\n    except KeyboardInterrupt as ke:\n        print(f\"Cancelled, disconnecting.\")\n        client.disconnect()\n    except BzException as bze:\n        print(f\"BZ Error: {bze}\")\n        break\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenzinga%2Fpython-bztcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenzinga%2Fpython-bztcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenzinga%2Fpython-bztcp/lists"}