Skip to main content

📦 Asanak SMS Client (Python)

یک کلاینت پایتونی برای ارسال پیامک از طریق API Asanak

🚀 نصب پکیج

از PyPI:

pip install asanak-sms-client

از GitHub:

pip install git+https://github.com/Asanak-Team/python-sms-client

📚 استفاده از کلاینت

from asanak_sms_client import AsanakSMSClient

client = AsanakSMSClient("username", "password")

1- ارسال پیامک تکی یا چند مقصدی

try:
    data = client.send_sms("9821X", "0912000000", "کد تست 1234")
    print(data)
except Exception as e:
    print(e)

2- ارسال پیامک نظیر به نظیر (P2P)

try:
    data = client.send_p2p(["9821XX1", "9821XX2"], ["0912000000", "0912000001"], ["کد تست 1234", "کد تست 4567"], [True, False])
    print(data)
except Exception as e:
    print(e)

3- ارسال پیامک خدماتی با قالب (OTP)

try:
    data = client.send_template(1234, {"code": "1234"}, "0912000000", True)
    print(data)
except Exception as e:
    print(e)

4- استعلام وضعیت پیامک

try:
    data = client.msg_status(['12345678', '12345679'])
    print(data)
except Exception as e:
    print(e)

5- مشاهده موجودی اعتبار پیامکی

try:
    data = client.get_credit()
    print(data["credit"])
except Exception as e:
    print(e)

6- مشاهده موجودی اعتبار پیامکی (ریال)

try:
    data = client.get_rial_credit()
    print(data["credit"])
except Exception as e:
    print(e)

7- دریافت لیست قالب‌های پیامک

try:
    data = client.get_templates()
    print(data)
except Exception as e:
    print(e)

📝 پارامتر‌های ورودی

  • username: نام کاربری از API Asanak
  • password: رمز عبور از API Asanak
  • base_url: آدرس سرور API Asanak (پیش‌فرض: https://sms.asanak.ir)

📝 پارامتر‌های خروجی

{
    "meta": {
        "status": int,
        "message": string
    },
    "data": list
}

Metadata

Release files for asanak-sms-client 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asanak-sms-client 0.0.0
File Size Uploaded Provenance
asanak_sms_client-0.0.0.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asanak-sms-client 0.0.0
File Interpreter ABI Platform
asanak_sms_client-0.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / asanak_sms_client-0.0.0.tar.gz

Download URL asanak_sms_client-0.0.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
69f0216603aea153e9111e08e5e4d608d881266a7c5f1def4a35b8bbbcfb092e
BLAKE2b-256 checksum
How to use checksums
4d8146266fac90e91d507f9943adb9e75725ddae8cd315912e68678e622aec1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release files / asanak_sms_client-0.0.0-py3-none-any.whl

Download URL asanak_sms_client-0.0.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4b6f6f02166974c469446b0abb63eac30e902b032e759b5ec080c3e9e3d24fc
BLAKE2b-256 checksum
How to use checksums
a6f12ea8a05faa8d80d755dbe2412600b7a06b7151bc3299dd8562f19dcc3a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Security for asanak-sms-client 0.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page