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.1.tar.gz (8.9 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.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telecomfaker-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 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.1.tar.gz
Algorithm Hash digest
SHA256 0a2be1b96d7b7cf067f4e2c9624c2ced5c2c5b214fee6567ecd1843a1c1adf7a
MD5 130fdd61c7aced4ca870471d9fd6e1ec
BLAKE2b-256 750a670d68e6df3c03e691340b8086e8a7279da92a412a2d4bc84a5b651118ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for telecomfaker-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: telecomfaker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d881159d067088656b4efe8406ca19b3b062f2819c3745d68b1a610b64cd1e69
MD5 95da4c40c6a01dc98274ff895e4dc897
BLAKE2b-256 40c0477369cd45dc5a4c44f91edb300849efc30a55e7743ad364c0a4bd45b026

See more details on using hashes here.

Provenance

The following attestation bundles were made for telecomfaker-0.1.1-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