{"id":19236729,"url":"https://github.com/mpetazzoni/sseclient","last_synced_at":"2025-05-15T16:07:27.013Z","repository":{"id":57470789,"uuid":"53699894","full_name":"mpetazzoni/sseclient","owner":"mpetazzoni","description":"Pure-Python Server Side Events (SSE) client","archived":false,"fork":false,"pushed_at":"2024-03-01T17:29:29.000Z","size":44,"stargazers_count":210,"open_issues_count":10,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-10T03:22:57.933Z","etag":null,"topics":["library","python","server-sent-events","sse","sseclient"],"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/mpetazzoni.png","metadata":{"files":{"readme":"README.rst","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":"2016-03-11T22:15:14.000Z","updated_at":"2025-05-05T14:56:33.000Z","dependencies_parsed_at":"2024-06-18T14:06:50.523Z","dependency_job_id":null,"html_url":"https://github.com/mpetazzoni/sseclient","commit_stats":{"total_commits":39,"total_committers":8,"mean_commits":4.875,"dds":0.3589743589743589,"last_synced_commit":"052edbf8b3cdabdd00adc8f8122948acbbc43428"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetazzoni%2Fsseclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetazzoni%2Fsseclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetazzoni%2Fsseclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetazzoni%2Fsseclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpetazzoni","download_url":"https://codeload.github.com/mpetazzoni/sseclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374475,"owners_count":22060611,"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":["library","python","server-sent-events","sse","sseclient"],"created_at":"2024-11-09T16:22:52.233Z","updated_at":"2025-05-15T16:07:26.994Z","avatar_url":"https://github.com/mpetazzoni.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Server Side Events (SSE) client for Python\n==========================================\n\nA Python client for SSE event sources that seamlessly integrates with\n``urllib3`` and ``requests``.\n\nInstallation\n------------\n\n.. code::\n\n    $ pip install sseclient-py\n\nUsage\n-----\n\n.. code:: python\n\n    import json\n    import pprint\n    import sseclient\n\n    def with_urllib3(url, headers):\n        \"\"\"Get a streaming response for the given event feed using urllib3.\"\"\"\n        import urllib3\n        http = urllib3.PoolManager()\n        return http.request('GET', url, preload_content=False, headers=headers)\n\n    def with_requests(url, headers):\n        \"\"\"Get a streaming response for the given event feed using requests.\"\"\"\n        import requests\n        return requests.get(url, stream=True, headers=headers)\n\n    def with_httpx(url, headers):\n        \"\"\"Get a streaming response for the given event feed using httpx.\"\"\"\n        import httpx\n        with httpx.stream('GET', url, headers=headers) as s:\n            # Note: 'yield from' is Python \u003e= 3.3. Use for/yield instead if you\n            # are using an earlier version.\n            yield from s.iter_bytes()\n\n\n    url = 'http://domain.com/events'\n    headers = {'Accept': 'text/event-stream'}\n    response = with_urllib3(url, headers)  # or with_requests(url, headers)\n    client = sseclient.SSEClient(response)\n    for event in client.events():\n        pprint.pprint(json.loads(event.data))\n\nResources\n=========\n\n-  http://www.w3.org/TR/2009/WD-eventsource-20091029/\n-  https://pypi.python.org/pypi/sseclient-py/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpetazzoni%2Fsseclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpetazzoni%2Fsseclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpetazzoni%2Fsseclient/lists"}