Skip to main content

A phone number validation library for multiple countries

Project description

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

  1. Clone the repository:

    git clone https://github.com/copyleftdev/telcolib.git
    
  2. Navigate to the project directory:

    cd telcolib
    
  3. 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.


### Notes:
- Update the **Installation** section if the library will be available on PyPI or if there's a different installation process.
- Expand the **Usage** section with more examples or detailed explanation if needed.
- Ensure the **Contributing** and **Contact** sections align with how you want to manage contributions and communication.
- Add any additional information relevant to your project or its community.

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

telcolib-0.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

telcolib-0.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file telcolib-0.1.tar.gz.

File metadata

  • Download URL: telcolib-0.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for telcolib-0.1.tar.gz
Algorithm Hash digest
SHA256 65597f31d11e19c609eeffd8fc062bb90036538168072213b1a7bdbe10572601
MD5 9f0c16ebf7f8330c10ff7a4f5747319b
BLAKE2b-256 8dfd4712fd7b38bfb346463077b839650e7cff12733cd1e6075c192ec28ff3ee

See more details on using hashes here.

File details

Details for the file telcolib-0.1-py3-none-any.whl.

File metadata

  • Download URL: telcolib-0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for telcolib-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20cdab6a2ecab41a0205b480a31857a5c24f81c0c91fb039c25f1a588a6502be
MD5 d08646a198826712e63b9dcf95c5037d
BLAKE2b-256 6a94b49cc272849d74d1d87b2692f69035b2ab43b86097bc9a6944dab8f08c41

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page