Skip to main content

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.

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)

Source distribution for telcolib 0.2
File Size Uploaded
telcolib-0.2.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telcolib 0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page