Skip to main content

Asyncio-based Python driver for esmdMQ

Project description

esmd-pysdk

Asyncio-based Python driver for esmdMQ. This project lives at the repo root and is parallel to drivers/.

Requirements

  • Python 3.10+
  • lz4 (see requirements.txt or pyproject.toml)

Quick Start

pip install -r requirements.txt

Install from PyPI:

pip install esmd-pysdk

Check installed SDK version:

python -c "import esmd_pysdk; print(esmd_pysdk.__version__)"

Producer example:

python examples/producer.py

Consumer example:

python examples/consumer.py

Query example:

python examples/query.py

Matrix example:

python examples/matrix.py

Delete example:

python examples/delete.py

Schedule example (DelayTime + Punctual):

python examples/schedule.py

Notes

  • JSON serialization is canonicalized (sorted keys, compact separators) to keep hash routing consistent with Go.
  • Driver uses asyncio; call APIs inside an event loop.
  • Producer schedule:
    • ScheduleMode.SERVER_TIME: 服务端当前时间(默认)
    • ScheduleMode.DELAY_TIME: 延迟投递,参数单位为毫秒(例如 2000
    • ScheduleMode.PUNCTUAL: 绝对时间投递,参数为 Unix 毫秒时间戳(例如 int(time.time() * 1000) + 5000
  • Consumer delay:
    • DelayMode.BASE_SERVER: 基于服务端时间消费(推荐默认)
    • DelayMode.IGNORE_DELAY: 忽略延迟立即消费
    • DelayMode.TIME_DELAY: 指定延迟窗口(毫秒)

Recommended Demo Flow

# 1) 先写入一条固定索引数据
python examples/producer.py

# 2) 查询和矩阵查询(使用与 producer 一致的 filter)
python examples/query.py
python examples/matrix.py

# 3) 删除同一条件下的数据
python examples/delete.py

Release Notes

  • Version is managed in pyproject.toml ([project].version).
  • Release guide: RELEASING.md (TestPyPI -> PyPI).

Pre-release checklist:

# 1) version check
python - <<'PY'
import re
print(re.search(r'^version\\s*=\\s*\"([^\"]+)\"', open('pyproject.toml').read(), re.M).group(1))
PY

# 2) tests
python -m pytest tests

# 3) build + metadata check
python -m build
python -m twine check dist/*

# 4) install/import smoke
python -m venv .venv-release
source .venv-release/bin/activate
python -m pip install --upgrade pip
python -m pip install dist/*.whl
python -c "import esmd_pysdk; print('import ok')"

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

esmd_pysdk-0.1.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

esmd_pysdk-0.1.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: esmd_pysdk-0.1.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for esmd_pysdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f303c6eeb3e262d2acf507694335b553b8db144da9b969dd985ce9c41074bd8f
MD5 c55cc70fc2dc9c1e03a975e9f2bc6296
BLAKE2b-256 37e2668e7fc915d3ed14e0a051da9a24b1e821fda7bc3c77e71bdeb550ae4507

See more details on using hashes here.

File details

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

File metadata

  • Download URL: esmd_pysdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for esmd_pysdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c7d5d7551f48c9f304b891db8278345ee2b2501a27980e9c9c788c581953479
MD5 cdef2b163d08afbce9da91199be2f8f3
BLAKE2b-256 0a71077b700803e63333f64029289a1d149fa3ece93a44cfbc463decf7ba0c60

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