Skip to main content

Lightweight AWS SNS client for Python with topic management, subscriptions, and single/batch publishing with W3C trace headers.

Project description

finalsa SNS client

Lightweight AWS SNS client for Python with:

  • Topic discovery/creation and basic subscription helpers
  • Single and batch message publishing
  • Default W3C trace headers and produced-at timestamp on messages
  • Minimal test client for local/testing (SnsClientTest)

Install

Requires Python 3.10+.

uv add finalsa-sns-client

Quick start

from finalsa.sns.client import SnsClientImpl

client = SnsClientImpl()

# Ensure a topic exists
client.get_or_create_topic("orders")

# Publish a string payload
client.publish("orders", "hello world")

# Publish a dict payload with default trace headers
client.publish_message("orders", {"id": 1, "status": "created"})

# Publish in batch (up to 10 per batch)
client.publish_messages_batch("orders", [{"id": i} for i in range(5)])

Testing locally

Use the in-memory client:

from finalsa.sns.client import SnsClientTest

client = SnsClientTest()
client.publish_message("test", {"ok": True})
assert client.messages("test")[0] == {"ok": True}

Run tests:

uv run -m pytest -q

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finalsa_sns_client-2.2.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finalsa_sns_client-2.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file finalsa_sns_client-2.2.1.tar.gz.

File metadata

  • Download URL: finalsa_sns_client-2.2.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.12

File hashes

Hashes for finalsa_sns_client-2.2.1.tar.gz
Algorithm Hash digest
SHA256 1021d9c5682525092ffa60d42472239466d99914d79b5e770114396ba4fbbee9
MD5 9929d4542de35aa0110acfeef01adb4c
BLAKE2b-256 01563f958e0eb980b3ac7d1aa1ca1242df239c5caa2b0ded971e388155d868d0

See more details on using hashes here.

File details

Details for the file finalsa_sns_client-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for finalsa_sns_client-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a46548e656a363b0bcae2ab8e286eb018a05b93ee95ecba147be208b192833
MD5 741af78c78aa93790cda102ade919879
BLAKE2b-256 09e11cbe3b0af419f98f7bd757155790d948a859c9804f8f483f5db7b8de0154

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page