Skip to main content

A lightweight WeCom (WeChat Work) webhook client using httpx with custom User-Agent

Project description

qwsend

WeCom (企业微信) webhook client based on httpx with a clear, reusable API. It sets a custom User-Agent built from the project name and version.

  • Sync and async clients
  • Message types: text, markdown/markdown_v2, image, news, file, voice, template_card
  • Media upload helper (file/voice)
  • Simple CLI: qwsend "hello" --key <key>

Install

pip install qwsend

Quick start

from qwsend import WebhookClient

client = WebhookClient(key="<your_key>")
client.send_text("hello world")
client.send_markdown("**bold**")
client.close()

Async:

import asyncio
from qwsend import AsyncWebhookClient

async def main():
    client = AsyncWebhookClient(key="<your_key>")
    await client.send_text("hello async")
    await client.aclose()

asyncio.run(main())

CLI:

# PowerShell
$env:QWSEND_WEBHOOK_KEY = "<your_key>"
qwsend "hello from CLI"
qwsend "**markdown**" --markdown

User-Agent

The client uses a UA like: qwsend/0.1.0 (+https://pypi.org/project/qwsend/).

Tests

  • Dry tests: run without network
  • Wet tests: live webhook calls, enabled when QWSEND_WEBHOOK_KEY is set
pytest -m "not wet"   # dry only
pytest -m wet          # wet only (requires env)

Packaging

This project uses pyproject.toml with setuptools. Build and publish:

python -m build
python -m twine upload dist/*

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

qwsend-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

qwsend-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file qwsend-0.1.0.tar.gz.

File metadata

  • Download URL: qwsend-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwsend-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ffe614462f959ef21428bd5ff0ee5875965ce71032be38b8068486db848163ea
MD5 2c74e4a51e039d4487b09083e5c12ccf
BLAKE2b-256 38e0a318a4768350b376d8514ed07481edafb2e4ad798aebaeec2e393a04bfa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwsend-0.1.0.tar.gz:

Publisher: release.yml on ZhulongNT/qwsend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qwsend-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qwsend-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwsend-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d8e52c4a5d37b9e561a303923b1da2647c430cca9343ce7197ab97c2d7ca85
MD5 50ff774863c448c62821600b2a527f9a
BLAKE2b-256 d79c0e8dd5778e3a1f3685b329e2f69934f6811c51d31ef3208e0c00b96c978d

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwsend-0.1.0-py3-none-any.whl:

Publisher: release.yml on ZhulongNT/qwsend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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