A Python application for powering other python applications to send SMS messages globally with number validation and restrictions by Tarmica Chiwara
Project description
Chromastone SMS App
Chromastone is a Python application designed to simplify the process of sending SMS messages. Utilizing a straightforward API, Chromastone ensures that destination numbers are validated and messages are efficiently delivered while adhering to specified constraints.
Features
- Validation of destination numbers to ensure they are in international format without the '+' prefix.
- Enforcement of message length to not exceed 100 characters.
- Easy integration with existing Python applications.
Installation
To use Chromastone, you need to install the required dependencies first. It is recommended to use a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
After activating the virtual environment, install the dependencies:
pip install requests pydantic
Configuration
Before you can start sending SMS messages, ensure you have an API key from the SMS service provider. You will need to replace 'your_api_key_here' in the code with your actual API key.
Usage
To send an SMS using Chromastone, instantiate the Chromastone
class with your API key and call the send_sms
method with the source number, destination number, and message:
from chromastone import Chromastone
chromastone = Chromastone(api_key='your_api_key_here')
chromastone.send_sms(source_number='1234567890', destination_number='263771123456', message='Hello, world!')
Ensure the destination number is in the correct format and the message does not exceed 100 characters.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
Acknowledgments
- Thanks to the Pydantic library for providing robust data validation.
- Gratitude to the Requests library for simplifying HTTP requests in Python.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file chromastone-0.1.9.tar.gz
.
File metadata
- Download URL: chromastone-0.1.9.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99b37e4bb3d1c2ec33786ae54b1c732558338483ef2e991a29206b96b2da4886 |
|
MD5 | aad264e568711b9a09092cf2f3fa174c |
|
BLAKE2b-256 | 28dff50bcc512093f9cea8d6ea4838f90dce1b7fd0c13114f43d365194f5b0f9 |
File details
Details for the file chromastone-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: chromastone-0.1.9-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07c1a42ee26b2710a204d68fc65c8e0fea60bf09ebb1e8e49e1556a7c82195ed |
|
MD5 | 871d4e67d74a3bf5e7d2a5d65d1ec2ad |
|
BLAKE2b-256 | 7a871a34f1bb0c4440fbd527fbb95d7a8efcd1336810825ee33a673d10d5a1c4 |