telcolib
Overview
telcolib is a Python library designed for validating phone numbers across multiple countries. Utilizing regular expressions, it ensures phone numbers adhere to specific national formats.
Features
- Validates phone numbers from a wide range of countries.
- Easily extendable to include additional countries and formats.
- Simple, straightforward API.
Installation
To install telcolib, run the following command:
pip install telcolib
Alternatively, you can clone the repository and install it manually:
git clone https://github.com/copyleftdev/telcolib.git
cd telcolib
pip install .
Usage
Here's a quick example of how to use telcolib:
from telcolib import PhoneNumberValidator
# Create an instance of the validator
validator = PhoneNumberValidator()
# Validate a phone number
valid = validator.validate('+14445556666', 'USA')
print("Phone number is valid:", valid)
Adding Custom Patterns
To add or update a country's phone number pattern:
validator.add_country_pattern('CountryName', r'^\+CountryCode\d{NumberOfDigits}$')
Development
Prerequisites
- Python 3.6 or higher.
Setting Up a Development Environment
-
Clone the repository:
git clone https://github.com/copyleftdev/telcolib.git
-
Navigate to the project directory:
cd telcolib
-
Install the dependencies:
pip install -r requirements.txt
Running Tests
To run the tests, execute:
pytest tests/
Contributing
Contributions to telcolib are welcome! Feel free to fork the repository and submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For questions or feedback related to telcolib, please open an issue in the GitHub repository.
Release files for telcolib 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| telcolib-0.2.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telcolib-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / telcolib-0.2.tar.gz
| Download URL | telcolib-0.2.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec184db91e10f59fa2a367d9884cca71d7b7b2e1f121cf7617ec7a9c122ce745
|
|
BLAKE2b-256 checksum How to use checksums |
30ebe94619836457f298d7de084bc572b68f3a4b36c4920fe80628618c0994d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / telcolib-0.2-py3-none-any.whl
| Download URL | telcolib-0.2-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3a0b771c7a99282ffb6c1597401c9a28e9115c0fc7a05807fec298286cddb6f
|
|
BLAKE2b-256 checksum How to use checksums |
a8d8f7440c0c43b5e4348b6c9243b7a16e15d5690e887d79513711d106e53b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|