Skip to main content

simple daisy sms api wrapper

Project description

daisy-sms

Simple daisy sms api wrapper

Installation

pip install daisy-sms

Examples

Rent a number

from daisy_sms.client import DaisySmsClient, Service

API_KEY = "YOUR_API_KEY"

client = DaisySmsClient(API_KEY)
client.rent_number(Service.TINDER, 0.40)

Rent multiple numbers

from daisy_sms.client import DaisySmsClient, Service


API_KEY = "YOUR_API_KEY"

client = DaisySmsClient(API_KEY)
list_of_rentals = client.rent_multiple_numbers(Service.TINDER, 10, 0.40)
for rental in list_of_rentals:
    print(rental.id)
    print(rental.number)

Get code

from daisy_sms.client import DaisySmsClient, Service
from daisy_sms.models import ActivationStatus
import time

API_KEY = "YOUR_API_KEY"

client = DaisySmsClient(API_KEY)
rent_number_response = client.rent_number(Service.TINDER, 0.40)
get_code_response = client.get_code(rent_number_response.id)
time.sleep(30)
if get_code_response.status == ActivationStatus.STATUS_OK:
    print(get_code_response.code)

Error handling

from daisy_sms.client import DaisySmsClient, Service
from daisy_sms.exceptions import NotEnoughBalanceLeftError


API_KEY = "YOUR_API_KEY"

client = DaisySmsClient(API_KEY)
try:
    rent_number_response = client.rent_number(Service.TINDER, 0.40)
except NotEnoughBalanceLeftError as e:
    print(e.message)

This project, daisy-sms, is licensed under the MIT License.
See the LICENSE file for details.

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

daisy_sms-1.0.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

daisy_sms-1.0.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file daisy_sms-1.0.2.tar.gz.

File metadata

  • Download URL: daisy_sms-1.0.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for daisy_sms-1.0.2.tar.gz
Algorithm Hash digest
SHA256 23eb39c0bb38f943cac85d0160a4fcf8300afe3ffc59d1b5e3921a9eae72deb1
MD5 9f59e11465b62d2df59c3dcfa0c4b51d
BLAKE2b-256 5a8f9771e43ff406b7b1f31a8a23ab23ce67fc226ba13bb8dab79e62c39732c4

See more details on using hashes here.

File details

Details for the file daisy_sms-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: daisy_sms-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for daisy_sms-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10b3021b48e3681d2e067cbfe2c25c99586d49a084653eb4740bc6b484304469
MD5 61860df209c968437ee17dcb74a3f384
BLAKE2b-256 9b905df95af2d635486754b509014a4199928ad39b0e2a9ef0ecfc26eb7e0600

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