{"id":17258503,"url":"https://github.com/thibauts/styx-client-python","last_synced_at":"2025-07-23T06:33:30.975Z","repository":{"id":66214123,"uuid":"349463625","full_name":"thibauts/styx-client-python","owner":"thibauts","description":"Styx client for Python","archived":false,"fork":false,"pushed_at":"2021-03-19T15:19:31.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T09:22:35.846Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thibauts.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":"2021-03-19T15:08:48.000Z","updated_at":"2021-12-21T10:04:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e414b994-b5b2-4429-8d68-9b43103e7924","html_url":"https://github.com/thibauts/styx-client-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thibauts/styx-client-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibauts%2Fstyx-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibauts%2Fstyx-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibauts%2Fstyx-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibauts%2Fstyx-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibauts","download_url":"https://codeload.github.com/thibauts/styx-client-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibauts%2Fstyx-client-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266631474,"owners_count":23959419,"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-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":"2024-10-15T07:20:53.097Z","updated_at":"2025-07-23T06:33:30.952Z","avatar_url":"https://github.com/thibauts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# styx-client-python\n\n## Installing\n\n```bash\n$ git clone https://github.com/dataptive/styx-client-python.git\n$ cd styx-client-python\n$ python3 setup.py install\n```\n\n## Usage\n\nExample producer\n\n```python\nimport asyncio\nfrom styx import Client\n\nasync def main():\n\tclient = Client('localhost:7123')\n\n\tproducer = await client.create_producer('test')\n\tfor i in range(1000):\n\t\tawait producer.write('Hello, Styx!')\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n\nExample consumer\n\n```python\nimport asyncio\nfrom styx import Client\n\nasync def main():\n\tclient = Client('localhost:7123')\n\n\t# whence can be 'start', 'end' or 'origin' and defines the basis for `position`\n\t# position can be negative when using whence='end'\n\t# follow determines if the consumer will wait for incoming records when it has reached the end of log\n\tconsumer = await client.create_consumer('test', whence='start', position=0, follow=True)\n\tasync for record in consumer:\n\t\tprint(record)\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n\nManaging logs\n\n```python\nimport asyncio\nfrom styx import Client\n\nasync def main():\n\tclient = Client('localhost:7123')\n\n\t# Create a log\n\tresult = await client.create_log('test')\n\n\t# List all logs\n\tresult = await client.list_logs()\n\n\t# Fetch info for a particular log\n\tresult = await client.get_log('test')\n\n\t# Delete a log\n\tresult = await client.delete_log('test')\n\n\t# Truncate a log\n\tresult = await client.truncate_log('test')\n\n\t# Backup a log\n\twith open('test.tar.gz', 'wb') as f:\n\t\tawait client.backup_log('test', f)\n\n\t# Restore a log from backup\n\twith open('test.tar.gz', 'rb') as f:\n\t\tawait client.restore_log('test-restore', f)\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibauts%2Fstyx-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibauts%2Fstyx-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibauts%2Fstyx-client-python/lists"}