Skip to main content

A Python package for generating realistic telecom operator test data

Project description

TelecomFaker

A Python package for generating realistic telecom operator test data. Similar to Faker, but focused on telecom-specific information.

Design

graph TD
    A[TelecomFaker] --> B[DataProvider]
    B --> C[Static JSON Data]
    
    A --> D[Generate Random Operator]
    D --> E[With Country Info]
    D --> F[With Numbering Info]
    D --> G[With Phone Numbers]

Features

  • Generate random telecom operator data with realistic information
  • Access operator details by country, region, or randomly
  • Get accurate numbering information (Prefix, MCC, MNC)
  • Filter operators by size, country, or other attributes
  • Built with real-world telecom data

Installation

For Users

pip install telecomfaker

For Developers

  1. Clone the repository:
git clone https://github.com/yourusername/telecomfaker.git
cd telecomfaker
  1. Create and activate a virtual environment:
# Using venv
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -r requirements.txt
  1. Install the package in development mode:
pip install -e .

Development

Running Tests

Run BDD tests with Behave:

behave

Run unit tests with pytest:

pytest

Quick Start

Python API

from telecomfaker import TelecomFaker

# Create a TelecomFaker instance
faker = TelecomFaker()

# Get a random operator with all associated information
result = faker.generate_operator()
operator = result

print(f"Random Operator: {operator['name']} ({operator['country']})")
print(f"MCC: {operator['mcc']}, MNC: {operator['mnc']}")
print(f"Size: {operator['size']}")
print(f"MVNO: {'Yes' if operator['is_mvno'] else 'No'}")

Command Line Interface

TelecomFaker includes a command-line interface for quick data generation:

# Generate a single operator in text format
telecomfaker

# Generate 5 operators in JSON format
telecomfaker --count 5 --format json

# Generate operators with a specific seed for reproducibility
telecomfaker --seed 42

# Save output to a file
telecomfaker --count 10 --format json --output operators.json

CLI Options

Option Description
--seed SEED Random seed for consistent generation
--count COUNT Number of operators to generate (default: 1)
--format {json,text} Output format (default: text)
--output FILE Output file (default: stdout)

Example Output (Text Format)

Operator: Vodafone
Country: Germany
MCC: 262
MNC: 02
Size: large
Type: MNO

Example Output (JSON Format)

[
  {
    "name": "Vodafone",
    "country": "Germany",
    "mcc": "262",
    "mnc": "02",
    "size": "large",
    "is_mvno": false
  }
]

Data Sources

TelecomFaker uses real-world data compiled from:

  • ITU (International Telecommunication Union)
  • Public MCC/MNC databases
  • Telecom regulatory authorities
  • Open-source telecom data repositories

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

telecomfaker-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telecomfaker-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file telecomfaker-0.1.0.tar.gz.

File metadata

  • Download URL: telecomfaker-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for telecomfaker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d422548b5065ef6c715dd0419d89c3b8f014839b63d6d719bb949ca0c54b94b5
MD5 acaf76af7f465f049fbb4119586cc9a5
BLAKE2b-256 be1a9bfc22556f7daee9cebc4c0bc06d8f2dd6fbef4db554096de7b5bfea8e98

See more details on using hashes here.

Provenance

The following attestation bundles were made for telecomfaker-0.1.0.tar.gz:

Publisher: publish.yml on StefanStuehrmann/telecomfaker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file telecomfaker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: telecomfaker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for telecomfaker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06554746da7111d77d753a055c5e3c19493525bb14b869b17f77ebcc71b133e1
MD5 21e291576ab97651f8ed17e0073a5aa6
BLAKE2b-256 d558175182a2eccce4cf59be40dafab40a4c28dc99c6ac0770e4391c80543ce5

See more details on using hashes here.

Provenance

The following attestation bundles were made for telecomfaker-0.1.0-py3-none-any.whl:

Publisher: publish.yml on StefanStuehrmann/telecomfaker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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