{"id":"ca196b9e-964b-4d7c-8282-0123b3cfa8e5","shortId":"Crx2ed","kind":"skill","title":"azure-eventhub-py","tagline":"Azure Event Hubs SDK for Python streaming. Use for high-throughput event ingestion, producers, consumers, and checkpointing.","description":"# Azure Event Hubs SDK for Python\n\nBig data streaming platform for high-throughput event ingestion.\n\n## Installation\n\n```bash\npip install azure-eventhub azure-identity\n# For checkpointing with blob storage\npip install azure-eventhub-checkpointstoreblob-aio\n```\n\n## Environment Variables\n\n```bash\nEVENT_HUB_FULLY_QUALIFIED_NAMESPACE=<namespace>.servicebus.windows.net\nEVENT_HUB_NAME=my-eventhub\nSTORAGE_ACCOUNT_URL=https://<account>.blob.core.windows.net\nCHECKPOINT_CONTAINER=checkpoints\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.eventhub import EventHubProducerClient, EventHubConsumerClient\n\ncredential = DefaultAzureCredential()\nnamespace = \"<namespace>.servicebus.windows.net\"\neventhub_name = \"my-eventhub\"\n\n# Producer\nproducer = EventHubProducerClient(\n    fully_qualified_namespace=namespace,\n    eventhub_name=eventhub_name,\n    credential=credential\n)\n\n# Consumer\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=namespace,\n    eventhub_name=eventhub_name,\n    consumer_group=\"$Default\",\n    credential=credential\n)\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `EventHubProducerClient` | Send events to Event Hub |\n| `EventHubConsumerClient` | Receive events from Event Hub |\n| `BlobCheckpointStore` | Track consumer progress |\n\n## Send Events\n\n```python\nfrom azure.eventhub import EventHubProducerClient, EventData\nfrom azure.identity import DefaultAzureCredential\n\nproducer = EventHubProducerClient(\n    fully_qualified_namespace=\"<namespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    credential=DefaultAzureCredential()\n)\n\nwith producer:\n    # Create batch (handles size limits)\n    event_data_batch = producer.create_batch()\n    \n    for i in range(10):\n        try:\n            event_data_batch.add(EventData(f\"Event {i}\"))\n        except ValueError:\n            # Batch is full, send and create new one\n            producer.send_batch(event_data_batch)\n            event_data_batch = producer.create_batch()\n            event_data_batch.add(EventData(f\"Event {i}\"))\n    \n    # Send remaining\n    producer.send_batch(event_data_batch)\n```\n\n### Send to Specific Partition\n\n```python\n# By partition ID\nevent_data_batch = producer.create_batch(partition_id=\"0\")\n\n# By partition key (consistent hashing)\nevent_data_batch = producer.create_batch(partition_key=\"user-123\")\n```\n\n## Receive Events\n\n### Simple Receive\n\n```python\nfrom azure.eventhub import EventHubConsumerClient\n\ndef on_event(partition_context, event):\n    print(f\"Partition: {partition_context.partition_id}\")\n    print(f\"Data: {event.body_as_str()}\")\n    partition_context.update_checkpoint(event)\n\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=\"<namespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    consumer_group=\"$Default\",\n    credential=DefaultAzureCredential()\n)\n\nwith consumer:\n    consumer.receive(\n        on_event=on_event,\n        starting_position=\"-1\",  # Beginning of stream\n    )\n```\n\n### With Blob Checkpoint Store (Production)\n\n```python\nfrom azure.eventhub import EventHubConsumerClient\nfrom azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore\nfrom azure.identity import DefaultAzureCredential\n\ncheckpoint_store = BlobCheckpointStore(\n    blob_account_url=\"https://<account>.blob.core.windows.net\",\n    container_name=\"checkpoints\",\n    credential=DefaultAzureCredential()\n)\n\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=\"<namespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    consumer_group=\"$Default\",\n    credential=DefaultAzureCredential(),\n    checkpoint_store=checkpoint_store\n)\n\ndef on_event(partition_context, event):\n    print(f\"Received: {event.body_as_str()}\")\n    # Checkpoint after processing\n    partition_context.update_checkpoint(event)\n\nwith consumer:\n    consumer.receive(on_event=on_event)\n```\n\n## Async Client\n\n```python\nfrom azure.eventhub.aio import EventHubProducerClient, EventHubConsumerClient\nfrom azure.identity.aio import DefaultAzureCredential\nimport asyncio\n\nasync def send_events():\n    credential = DefaultAzureCredential()\n    \n    async with EventHubProducerClient(\n        fully_qualified_namespace=\"<namespace>.servicebus.windows.net\",\n        eventhub_name=\"my-eventhub\",\n        credential=credential\n    ) as producer:\n        batch = await producer.create_batch()\n        batch.add(EventData(\"Async event\"))\n        await producer.send_batch(batch)\n\nasync def receive_events():\n    async def on_event(partition_context, event):\n        print(event.body_as_str())\n        await partition_context.update_checkpoint(event)\n    \n    async with EventHubConsumerClient(\n        fully_qualified_namespace=\"<namespace>.servicebus.windows.net\",\n        eventhub_name=\"my-eventhub\",\n        consumer_group=\"$Default\",\n        credential=DefaultAzureCredential()\n    ) as consumer:\n        await consumer.receive(on_event=on_event)\n\nasyncio.run(send_events())\n```\n\n## Event Properties\n\n```python\nevent = EventData(\"My event body\")\n\n# Set properties\nevent.properties = {\"custom_property\": \"value\"}\nevent.content_type = \"application/json\"\n\n# Read properties (on receive)\nprint(event.body_as_str())\nprint(event.sequence_number)\nprint(event.offset)\nprint(event.enqueued_time)\nprint(event.partition_key)\n```\n\n## Get Event Hub Info\n\n```python\nwith producer:\n    info = producer.get_eventhub_properties()\n    print(f\"Name: {info['name']}\")\n    print(f\"Partitions: {info['partition_ids']}\")\n    \n    for partition_id in info['partition_ids']:\n        partition_info = producer.get_partition_properties(partition_id)\n        print(f\"Partition {partition_id}: {partition_info['last_enqueued_sequence_number']}\")\n```\n\n## Best Practices\n\n1. **Use batches** for sending multiple events\n2. **Use checkpoint store** in production for reliable processing\n3. **Use async client** for high-throughput scenarios\n4. **Use partition keys** for ordered delivery within a partition\n5. **Handle batch size limits** — catch ValueError when batch is full\n6. **Use context managers** (`with`/`async with`) for proper cleanup\n7. **Set appropriate consumer groups** for different applications\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| references/checkpointing.md | Checkpoint store patterns, blob checkpointing, checkpoint strategies |\n| references/partitions.md | Partition management, load balancing, starting positions |\n| scripts/setup_consumer.py | CLI for Event Hub info, consumer setup, and event sending/receiving |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["azure","eventhub","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-azure-eventhub-py","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-eventhub-py","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34928 github stars · SKILL.md body (6,966 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T18:50:30.483Z","embedding":null,"createdAt":"2026-04-18T21:32:26.335Z","updatedAt":"2026-04-24T18:50:30.483Z","lastSeenAt":"2026-04-24T18:50:30.483Z","tsv":"'-1':316 '-123':261 '0':247 '1':575 '10':193 '2':582 '3':591 '4':600 '5':610 '6':621 '7':631 'account':77,342 'action':681 'aio':60 'applic':638,675 'application/json':506 'appropri':633 'ask':719 'async':395,409,415,437,443,447,462,593,626 'asyncio':408 'asyncio.run':487 'authent':83 'await':432,439,458,481 'azur':2,5,23,44,47,57 'azure-eventhub':43 'azure-eventhub-checkpointstoreblob-aio':56 'azure-eventhub-pi':1 'azure-ident':46 'azure.eventhub':90,156,268,327 'azure.eventhub.aio':399 'azure.eventhub.extensions.checkpointstoreblob':331 'azure.identity':86,161,335 'azure.identity.aio':404 'balanc':655 'bash':40,63 'batch':180,186,188,202,211,214,217,219,228,231,242,244,255,257,431,434,441,442,577,612,618 'batch.add':435 'begin':317 'best':573 'big':29 'blob':52,321,341,647 'blob.core.windows.net':79,344 'blobcheckpointstor':148,333,340 'bodi':497 'boundari':727 'catch':615 'checkpoint':22,50,80,82,289,322,338,347,366,368,382,386,460,584,644,648,649 'checkpointstoreblob':59 'clarif':721 'cleanup':630 'clear':694 'cli':659 'client':132,134,396,594 'consist':251 'consum':20,116,117,127,150,291,302,308,350,361,389,474,480,634,664 'consumer.receive':309,390,482 'contain':81,345 'content':642 'context':275,374,452,623 'creat':179,207 'credenti':94,114,115,130,131,175,305,348,364,413,427,428,477 'criteria':730 'custom':501 'data':30,185,213,216,230,241,254,284 'def':271,370,410,444,448 'default':129,304,363,476 'defaultazurecredenti':88,95,163,176,306,337,349,365,406,414,478 'deliveri':606 'describ':682,698 'differ':637 'enqueu':570 'environ':61,710 'environment-specif':709 'event':6,17,24,37,64,70,138,140,144,146,153,184,198,212,215,223,229,240,253,263,273,276,290,311,313,372,375,387,392,394,412,438,446,450,453,461,484,486,489,490,493,496,527,581,661,667 'event.body':285,379,455,512 'event.content':504 'event.enqueued':521 'event.offset':519 'event.partition':524 'event.properties':500 'event.sequence':516 'event_data_batch.add':195,220 'eventdata':159,196,221,436,494 'eventhub':3,45,58,75,98,102,110,112,123,125,170,174,297,301,356,360,422,426,469,473,535 'eventhubconsumercli':93,118,142,270,292,329,351,402,464 'eventhubproducercli':92,105,136,158,165,401,417 'except':200 'execut':677 'expert':715 'f':197,222,278,283,377,538,543,563 'file':640,641 'full':204,620 'fulli':66,106,119,166,293,352,418,465 'get':526 'group':128,303,362,475,635 'handl':181,611 'hash':252 'high':15,35,597 'high-throughput':14,34,596 'hub':7,25,65,71,141,147,528,662 'id':239,246,281,547,550,554,561,566 'ident':48 'import':87,91,157,162,269,328,332,336,400,405,407 'info':529,533,540,545,552,556,568,663 'ingest':18,38 'input':724 'instal':39,42,55 'key':250,259,525,603 'last':569 'limit':183,614,686 'load':654 'manag':624,653 'match':695 'miss':732 'multipl':580 'my-eventhub':73,100,172,299,358,424,471 'name':72,99,111,113,124,126,171,298,346,357,423,470,539,541 'namespac':68,96,108,109,121,122,168,295,354,420,467 'new':208 'number':517,572 'one':209 'order':605 'output':704 'overview':685 'partit':235,238,245,249,258,274,279,373,451,544,546,549,553,555,558,560,564,565,567,602,609,652 'partition_context.partition':280 'partition_context.update':288,385,459 'pattern':646 'permiss':725 'pip':41,54 'platform':32 'posit':315,657 'practic':574 'print':277,282,376,454,511,515,518,520,523,537,542,562 'process':384,590 'produc':19,103,104,164,178,430,532 'producer.create':187,218,243,256,433 'producer.get':534,557 'producer.send':210,227,440 'product':324,587 'progress':151 'proper':629 'properti':491,499,502,508,536,559 'purpos':135 'py':4 'python':10,28,84,154,236,266,325,397,492,530 'qualifi':67,107,120,167,294,353,419,466 'rang':192 'read':507 'receiv':143,262,265,378,445,510 'refer':639 'references/checkpointing.md':643 'references/partitions.md':651 'reliabl':589 'remain':226 'requir':723 'review':716 'safeti':726 'scenario':599 'scope':697 'scripts/setup_consumer.py':658 'sdk':8,26 'send':137,152,205,225,232,411,488,579 'sending/receiving':668 'sequenc':571 'servicebus.windows.net':69,97,169,296,355,421,468 'set':498,632 'setup':665 'simpl':264 'size':182,613 'skill':673,689 'skill-azure-eventhub-py' 'source-sickn33' 'specif':234,711 'start':314,656 'stop':717 'storag':53,76 'store':323,339,367,369,585,645 'str':287,381,457,514 'strategi':650 'stream':11,31,319 'substitut':707 'success':729 'task':693 'test':713 'throughput':16,36,598 'time':522 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'track':149 'treat':702 'tri':194 'type':133,505 'url':78,343 'use':12,576,583,592,601,622,671,687 'user':260 'valid':712 'valu':503 'valueerror':201,616 'variabl':62 'within':607 'workflow':679","prices":[{"id":"ac79dbd4-68b3-4d06-9fc4-2502ccaf9d49","listingId":"ca196b9e-964b-4d7c-8282-0123b3cfa8e5","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:32:26.335Z"}],"sources":[{"listingId":"ca196b9e-964b-4d7c-8282-0123b3cfa8e5","source":"github","sourceId":"sickn33/antigravity-awesome-skills/azure-eventhub-py","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-eventhub-py","isPrimary":false,"firstSeenAt":"2026-04-18T21:32:26.335Z","lastSeenAt":"2026-04-24T18:50:30.483Z"}],"details":{"listingId":"ca196b9e-964b-4d7c-8282-0123b3cfa8e5","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"azure-eventhub-py","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34928,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T06:41:17Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"2061636fca1be80b6bd67825bc0b2ee79607e601","skill_md_path":"skills/azure-eventhub-py/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-eventhub-py"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"azure-eventhub-py","description":"Azure Event Hubs SDK for Python streaming. Use for high-throughput event ingestion, producers, consumers, and checkpointing."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-eventhub-py"},"updatedAt":"2026-04-24T18:50:30.483Z"}}