OTP Sanly — Python SDK
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5f153b558b249c8561387b85019f2efc672cc842eaf429168f2774d07b7dc56
|
|
| MD5 |
45cdbb5cafc716713f093c7903b409e4
|
|
| BLAKE2b-256 |
767c2fc6f8e0d01eff0cf731617c4bd3fa4784ede379504f449e904ea9581c43
|
Provenance
The following attestation bundles were made for otp_sanly-1.0.0.tar.gz:
Publisher:
publish.yml on sanly-dev/otp-sanly-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otp_sanly-1.0.0.tar.gz -
Subject digest:
a5f153b558b249c8561387b85019f2efc672cc842eaf429168f2774d07b7dc56 - Sigstore transparency entry: 2572686010
- Sigstore integration time:
-
Permalink:
sanly-dev/otp-sanly-python@932e1e0920634e64a8f8dab33a0507abeef3d01c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/sanly-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932e1e0920634e64a8f8dab33a0507abeef3d01c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0cd789e131eb6e09bfaa4d3b52684731aeaa6b6841f79c6f24e1bc5100a1eb0
|
|
| MD5 |
1dc9d7926dc1c7e36a2b92e98bfeee88
|
|
| BLAKE2b-256 |
f09fcbe7cd1b7af8691fe79b9e8238ba63ff4204c8cb51d913c47794ea67179b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otp_sanly-1.0.0-py3-none-any.whl -
Subject digest:
d0cd789e131eb6e09bfaa4d3b52684731aeaa6b6841f79c6f24e1bc5100a1eb0 - Sigstore transparency entry: 2572686086
- Sigstore integration time:
-
Permalink:
sanly-dev/otp-sanly-python@932e1e0920634e64a8f8dab33a0507abeef3d01c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/sanly-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932e1e0920634e64a8f8dab33a0507abeef3d01c -
Trigger Event:
release
-
Statement type: