Skip to main content

OTP Sanly — Python SDK

Türkmençe | Русский | English

Official SDK for OTP Sanly — SMS & Email OTP authentication for Turkmenistan.

Install

pip install otp-sanly

Quick start

from otp_sanly import OtpSanly

sanly = OtpSanly(api_key="YOUR_API_KEY")

# Send an OTP
sent = sanly.send_otp(
    phone="+99361234567",  # Turkmenistan numbers only for SMS. Use `email=` instead for worldwide delivery.
    project="My App",
    lang="ru",  # "tk" | "ru" | "en" — which language to send the OTP in
)
print(sent.otp_id, sent.message)

# Verify the code the user entered
verified = sanly.verify_otp(phone="+99361234567", code="123456")
if verified.success:
    ...  # proceed — the code was correct

Sandbox mode

Create a sandbox API key in your dashboard to test your integration for free, without sending real SMS/email. The OTP code is returned directly in the response:

sent = sanly.send_otp(phone="+99361234567")
print(sent.code)  # only present for sandbox keys

Error handling

Failed requests raise OtpSanlyError, which includes the HTTP status and the raw response body:

from otp_sanly import OtpSanly, OtpSanlyError

try:
    sanly.send_otp(phone="+99361234567")
except OtpSanlyError as err:
    print(err.status, err, err.body)

Full API reference

See https://otp.sanly.dev/developers for the complete API reference, webhook docs, and framework-specific examples in other languages.

License

MIT

Download files

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

Source Distribution

otp_sanly-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

otp_sanly-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file otp_sanly-1.0.0.tar.gz.

File metadata

  • Download URL: otp_sanly-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otp_sanly-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a5f153b558b249c8561387b85019f2efc672cc842eaf429168f2774d07b7dc56
MD5 45cdbb5cafc716713f093c7903b409e4
BLAKE2b-256 767c2fc6f8e0d01eff0cf731617c4bd3fa4784ede379504f449e904ea9581c43

See more details on using hashes here.

Provenance

The following attestation bundles were made for otp_sanly-1.0.0.tar.gz:

Publisher: publish.yml on sanly-dev/otp-sanly-python

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

File details

Details for the file otp_sanly-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: otp_sanly-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otp_sanly-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0cd789e131eb6e09bfaa4d3b52684731aeaa6b6841f79c6f24e1bc5100a1eb0
MD5 1dc9d7926dc1c7e36a2b92e98bfeee88
BLAKE2b-256 f09fcbe7cd1b7af8691fe79b9e8238ba63ff4204c8cb51d913c47794ea67179b

See more details on using hashes here.

Provenance

The following attestation bundles were made for otp_sanly-1.0.0-py3-none-any.whl:

Publisher: publish.yml on sanly-dev/otp-sanly-python

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

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