# daisy-sms
Simple daisy sms api wrapper
## Installation
pip install daisy-sms
## Examples
#### Rent a number
```python
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
```python
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
```python
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
```python
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](./LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "daisy-sms",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "python, daisy, daisysms, sms, api, wrapper",
"author": null,
"author_email": "olezx <olekzx@python.com>",
"download_url": "https://files.pythonhosted.org/packages/b0/77/1f00c60798bcec2f046b72453a879918f99fa6b2e4babf157c0051c28774/daisy_sms-1.0.1.tar.gz",
"platform": null,
"description": "# daisy-sms\r\nSimple daisy sms api wrapper\r\n\r\n## Installation\r\n\r\n pip install daisy-sms\r\n\r\n## Examples\r\n\r\n#### Rent a number\r\n\r\n```python\r\nfrom daisy_sms.client import DaisySmsClient, Service\r\n\r\nAPI_KEY = \"YOUR_API_KEY\"\r\n\r\nclient = DaisySmsClient(API_KEY)\r\nclient.rent_number(Service.TINDER, 0.40)\r\n```\r\n\r\n#### Rent multiple numbers\r\n\r\n```python\r\nfrom daisy_sms.client import DaisySmsClient, Service\r\n\r\n\r\nAPI_KEY = \"YOUR_API_KEY\"\r\n\r\nclient = DaisySmsClient(API_KEY)\r\nlist_of_rentals = client.rent_multiple_numbers(Service.TINDER, 10, 0.40)\r\nfor rental in list_of_rentals:\r\n print(rental.id)\r\n print(rental.number)\r\n```\r\n\r\n#### Get code\r\n\r\n```python\r\nfrom daisy_sms.client import DaisySmsClient, Service\r\nfrom daisy_sms.models import ActivationStatus\r\nimport time\r\n\r\nAPI_KEY = \"YOUR_API_KEY\"\r\n\r\nclient = DaisySmsClient(API_KEY)\r\nrent_number_response = client.rent_number(Service.TINDER, 0.40)\r\nget_code_response = client.get_code(rent_number_response.id)\r\ntime.sleep(30)\r\nif get_code_response.status == ActivationStatus.STATUS_OK:\r\n print(get_code_response.code)\r\n```\r\n\r\n#### Error handling\r\n\r\n```python\r\nfrom daisy_sms.client import DaisySmsClient, Service\r\nfrom daisy_sms.exceptions import NotEnoughBalanceLeftError\r\n\r\n\r\nAPI_KEY = \"YOUR_API_KEY\"\r\n\r\nclient = DaisySmsClient(API_KEY)\r\ntry:\r\n rent_number_response = client.rent_number(Service.TINDER, 0.40)\r\nexcept NotEnoughBalanceLeftError as e:\r\n print(e.message)\r\n\r\n```\r\n\r\nThis project, **daisy-sms**, is licensed under the MIT License. \r\nSee the [LICENSE](./LICENSE) file for details.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "simple daisy sms api wrapper",
"version": "1.0.1",
"project_urls": {
"Bug Tracker": "https://github.com/olekzx/daisy-sms/issues",
"Homepage": "https://github.com/olekzx/daisy-sms"
},
"split_keywords": [
"python",
" daisy",
" daisysms",
" sms",
" api",
" wrapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a28df13aba9b05160bbe58c039daf12a21c584a300d0a9669f9a36d33e3356bd",
"md5": "b1f7a0983002dd32318718c4f73b9f37",
"sha256": "7321dbf1b6357c608dcf11cf5020bf014b536573849085d2a84f1ec05680d733"
},
"downloads": -1,
"filename": "daisy_sms-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b1f7a0983002dd32318718c4f73b9f37",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10526,
"upload_time": "2024-12-22T00:49:02",
"upload_time_iso_8601": "2024-12-22T00:49:02.338314Z",
"url": "https://files.pythonhosted.org/packages/a2/8d/f13aba9b05160bbe58c039daf12a21c584a300d0a9669f9a36d33e3356bd/daisy_sms-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0771f00c60798bcec2f046b72453a879918f99fa6b2e4babf157c0051c28774",
"md5": "fb45c0ac10d3cfb29d57ebc1415bc6dd",
"sha256": "e7e6135842e886a56b0c96314de80df37f6240aa2a729d5e18ff1067c314742e"
},
"downloads": -1,
"filename": "daisy_sms-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "fb45c0ac10d3cfb29d57ebc1415bc6dd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7589,
"upload_time": "2024-12-22T00:49:04",
"upload_time_iso_8601": "2024-12-22T00:49:04.872043Z",
"url": "https://files.pythonhosted.org/packages/b0/77/1f00c60798bcec2f046b72453a879918f99fa6b2e4babf157c0051c28774/daisy_sms-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 00:49:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "olekzx",
"github_project": "daisy-sms",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "daisy-sms"
}