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
- Clone the repository:
git clone https://github.com/yourusername/telecomfaker.git
cd telecomfaker
- Create and activate a virtual environment:
# Using venv
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -r requirements.txt
- 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
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d422548b5065ef6c715dd0419d89c3b8f014839b63d6d719bb949ca0c54b94b5
|
|
| MD5 |
acaf76af7f465f049fbb4119586cc9a5
|
|
| BLAKE2b-256 |
be1a9bfc22556f7daee9cebc4c0bc06d8f2dd6fbef4db554096de7b5bfea8e98
|
Provenance
The following attestation bundles were made for telecomfaker-0.1.0.tar.gz:
Publisher:
publish.yml on StefanStuehrmann/telecomfaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telecomfaker-0.1.0.tar.gz -
Subject digest:
d422548b5065ef6c715dd0419d89c3b8f014839b63d6d719bb949ca0c54b94b5 - Sigstore transparency entry: 196940769
- Sigstore integration time:
-
Permalink:
StefanStuehrmann/telecomfaker@9fa0731d89c9c844d87d7538e8f934d16007319e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/StefanStuehrmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9fa0731d89c9c844d87d7538e8f934d16007319e -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06554746da7111d77d753a055c5e3c19493525bb14b869b17f77ebcc71b133e1
|
|
| MD5 |
21e291576ab97651f8ed17e0073a5aa6
|
|
| BLAKE2b-256 |
d558175182a2eccce4cf59be40dafab40a4c28dc99c6ac0770e4391c80543ce5
|
Provenance
The following attestation bundles were made for telecomfaker-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on StefanStuehrmann/telecomfaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telecomfaker-0.1.0-py3-none-any.whl -
Subject digest:
06554746da7111d77d753a055c5e3c19493525bb14b869b17f77ebcc71b133e1 - Sigstore transparency entry: 196940773
- Sigstore integration time:
-
Permalink:
StefanStuehrmann/telecomfaker@9fa0731d89c9c844d87d7538e8f934d16007319e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/StefanStuehrmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9fa0731d89c9c844d87d7538e8f934d16007319e -
Trigger Event:
release
-
Statement type: