Skip to main content

🔗 pysimplesps - SPS MML Configuration Parser & Topology Generator

Python 3.12+ License: MIT Code style: black

🚀 Transform boring MML configurations into beautiful, interactive network topologies

pysimplesps is a comprehensive Python library that parses Huawei SPS (Signaling Point Systems) MML configurations and generates structured JSON data or stunning D3.js topology visualizations. Say goodbye to boring MML dumps and hello to intuitive network understanding!

✨ Features

🎯 Multi-Format Support

  • Links Configuration - Diameter, M2UA, M3UA, MTP links parsing
  • DMRT - Diameter Routing configuration analysis
  • AVPMED - AVP Mediation rules and transformations

📊 Output Formats

  • JSON - Structured data for programmatic analysis
  • D3.js Topology - Interactive network visualizations
  • HTML - Self-contained visualization files

🛠️ Enterprise Features

  • Comprehensive error handling and validation
  • Rich logging with loguru
  • Extensive test coverage with pytest
  • Module execution support (python -m pysimplesps)
  • Programmatic API for integration

🚀 Quick Start

Installation

# Install pysimplesps
pip install -e .

# Or install with development dependencies
pip install -e .[dev]

Module Execution

# Run as Python module
python -m pysimplesps links links.txt
python -m pysimplesps dmrt dmrt1.txt dmrt2.txt
python -m pysimplesps avpmed avpmed.txt

# With options
python -m pysimplesps links links.txt -o output.json
python -m pysimplesps links links.txt -f topology -o network.html
python -m pysimplesps dmrt dmrt_host.txt dmrt_id.txt -v

Programmatic Usage

from pysimplesps import SPSUnifiedLinksParser, SPSDiameterRoutingParser, SPSAVPMediationParser

# Parse links configuration
parser = SPSUnifiedLinksParser("spsdmlinks.txt")
config = parser.parse_file()
parser.print_summary()
parser.save_json("output.json")

# Parse DMRT configuration
dmrt_parser = SPSDiameterRoutingParser()
dmrt_parser.parse_file("spsdmrt_host.txt")
dmrt_parser.parse_file("spsdmrt_id.txt")
dmrt_config = dmrt_parser.get_config()

# Parse AVPMED configuration
avp_parser = SPSAVPMediationParser("spsavpmediation.txt")
avp_config = avp_parser.parse_file()

📋 Command Reference

Links Parser

python -m pysimplesps links <input_file> [OPTIONS]

Options:
  -o, --output PATH     Output file path
  -f, --format FORMAT   Output format: json|topology [default: json]
  -v, --verbose         Enable verbose logging

DMRT Parser

python -m pysimplesps dmrt <input_files>... [OPTIONS]

Options:
  -o, --output PATH     Output file path
  -f, --format FORMAT   Output format: json|topology [default: json]  
  -v, --verbose         Enable verbose logging

AVPMED Parser

python -m pysimplesps avpmed <input_file> [OPTIONS]

Options:
  -o, --output PATH     Output file path
  -v, --verbose         Enable verbose logging

🎨 Examples

Parse SPS Links Configuration

# Basic JSON output
python -m pysimplesps links spsdmlinks.txt

# Save to file with topology visualization
python -m pysimplesps links spsdmlinks.txt -f topology -o network_topology.html

# Verbose parsing with detailed logs
python -m pysimplesps links spsdmlinks.txt -v -o detailed_links.json

Diameter Routing Analysis

# Parse multiple DMRT files
python -m pysimplesps dmrt spsdmrt_host.txt spsdmrt_id.txt spsdmrt_ip.txt

# Generate routing topology
python -m pysimplesps dmrt dmrt_config.txt -f topology -o routing_flow.html

AVP Mediation Processing

# Parse mediation rules
python -m pysimplesps avpmed spsavpmediation.txt -o mediation_config.json

🏗️ Architecture

pysimplesps/
├── __main__.py         # 🚀 Module execution entry point
├── links2json.py       # 🔗 Links configuration parser  
├── links2topo.py       # 🌐 Links topology generator
├── dmrt2json.py        # 📡 DMRT configuration parser
├── dmrt2topo.py        # 🔄 DMRT topology generator  
├── avpmed2json.py      # 🔧 AVPMED configuration parser
└── __init__.py         # 📦 Package initialization

🧪 Testing

Run the comprehensive test suite:

# Run all tests
pytest

# Run with coverage
pytest --cov=pysimplesps --cov-report=html

# Run specific test categories
pytest -m unit         # Unit tests only
pytest -m integration  # Integration tests only
pytest -v              # Verbose output

# Run test script
python run_tests.py

📊 Sample Output

JSON Structure

{
  "diameter_peers": [...],
  "diameter_link_sets": [...], 
  "diameter_links": [...],
  "mtp_destination_points": [...],
  "metadata": {
    "parsed_at": "2025-08-03T...",
    "total_peers": 4,
    "total_link_sets": 6,
    "total_links": 12,
    "unique_ips": ["172.21.1.101", "172.21.1.102"],
    "unique_networks": ["172.21.1.0/24"]
  }
}

Topology Features

  • Interactive D3.js visualizations
  • Color-coded node types (Diameter, MTP, M2UA, M3UA)
  • Drag-and-drop network exploration
  • Connection details on hover
  • Responsive design

🎯 Supported MML Commands

Links Configuration

  • ADD DMPEER - Diameter peers
  • ADD DMLKS - Diameter link sets
  • ADD DMLNK - Diameter links
  • ADD N7DSP - MTP destination points
  • ADD N7LKS - MTP link sets
  • ADD N7LNK - MTP links

DMRT Configuration

  • ADD DMROUTERESULT - Route results
  • ADD DMROUTEENTRANCE - Route entrances
  • ADD DMROUTEEXIT - Route exits
  • ADD DMROUTERULE_* - Routing rules

AVPMED Configuration

  • ADD MEDFILTER - Mediation filters
  • ADD MEDACTION - Mediation actions
  • ADD MEDRULE - Mediation rules
  • MOD DMPEER - Peer assignments
  • MOD SFP - Software parameters

🔧 Development

Setup Development Environment

# Clone repository
git clone https://github.com/fxyzbtc/pysimplesps.git
cd pysimplesps

# Install in development mode
pip install -e .[dev]

# Run linting
ruff check pysimplesps/
ruff format pysimplesps/

# Type checking
mypy pysimplesps/

Contributing Guidelines

  1. 🍴 Fork the repository
  2. 🌟 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 📝 Make your changes with tests
  4. ✅ Run the test suite (pytest)
  5. 🚀 Submit a pull request

📚 Documentation

🤝 Support

📄 License

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

🙏 Acknowledgments

  • Built with ❤️ for telecommunications engineers
  • Powered by Python 3.12+ and modern tooling
  • Inspired by the need to make MML configurations more accessible

⭐ Star this repo if pysimplesps helps you visualize your networks! ⭐

Made with 🔥 by fxyzbtc

🎨 Examples

Parse SPS Links Configuration

# Basic JSON output
pysimplesps links spsdmlinks.txt

# Save to file with topology visualization
pysimplesps links spsdmlinks.txt -f topology -o network_topology.html

# Verbose parsing with detailed logs
pysimplesps links spsdmlinks.txt -v -o detailed_links.json

Diameter Routing Analysis

# Parse multiple DMRT files
pysimplesps dmrt spsdmrt_host.txt spsdmrt_id.txt spsdmrt_ip.txt

# Generate routing topology
pysimplesps dmrt dmrt_config.txt -f topology -o routing_flow.html

AVP Mediation Processing

# Parse mediation rules
pysimplesps avpmed spsavpmediation.txt -o mediation_config.json

🏗️ Architecture

pysimplesps/
├── cli.py              # 🎯 Main CLI interface with Typer
├── links2json.py       # 🔗 Links configuration parser  
├── links2topo.py       # 🌐 Links topology generator
├── dmrt2json.py        # 📡 DMRT configuration parser
├── dmrt2topo.py        # 🔄 DMRT topology generator  
├── avpmed2json.py      # 🔧 AVPMED configuration parser
├── __main__.py         # 🚀 Module execution entry point
└── __init__.py         # 📦 Package initialization

🧪 Testing

Run the comprehensive test suite:

# Run all tests
pytest

# Run with coverage
pytest --cov=pysimplesps --cov-report=html

# Run specific test categories
pytest -m unit         # Unit tests only
pytest -m integration  # Integration tests only
pytest -v              # Verbose output

📊 Sample Output

JSON Structure

{
  "diameter_peers": [...],
  "diameter_link_sets": [...], 
  "diameter_links": [...],
  "mtp_destination_points": [...],
  "metadata": {
    "parsed_at": "2025-08-03T...",
    "total_peers": 4,
    "total_link_sets": 6,
    "total_links": 12,
    "unique_ips": ["172.21.1.101", "172.21.1.102"],
    "unique_networks": ["172.21.1.0/24"]
  }
}

Topology Features

  • Interactive D3.js visualizations
  • Color-coded node types (Diameter, MTP, M2UA, M3UA)
  • Drag-and-drop network exploration
  • Connection details on hover
  • Responsive design

🎯 Supported MML Commands

Links Configuration

  • ADD DMPEER - Diameter peers
  • ADD DMLKS - Diameter link sets
  • ADD DMLNK - Diameter links
  • ADD N7DSP - MTP destination points
  • ADD N7LKS - MTP link sets
  • ADD N7LNK - MTP links

DMRT Configuration

  • ADD DMROUTERESULT - Route results
  • ADD DMROUTEENTRANCE - Route entrances
  • ADD DMROUTEEXIT - Route exits
  • ADD DMROUTERULE_* - Routing rules

AVPMED Configuration

  • ADD MEDFILTER - Mediation filters
  • ADD MEDACTION - Mediation actions
  • ADD MEDRULE - Mediation rules
  • MOD DMPEER - Peer assignments
  • MOD SFP - Software parameters

🔧 Development

Setup Development Environment

# Clone repository
git clone https://github.com/fxyzbtc/pysimplesps.git
cd pysimplesps

# Install in development mode
pip install -e .[dev]

# Run linting
ruff check pysimplesps/
ruff format pysimplesps/

# Type checking
mypy pysimplesps/

Contributing Guidelines

  1. 🍴 Fork the repository
  2. 🌟 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 📝 Make your changes with tests
  4. ✅ Run the test suite (pytest)
  5. 🚀 Submit a pull request

📚 Documentation

🤝 Support

📄 License

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

🙏 Acknowledgments

  • Built with ❤️ for telecommunications engineers
  • Powered by Python 3.12+ and modern tooling
  • Inspired by the need to make MML configurations more accessible

⭐ Star this repo if pysimplesps helps you visualize your networks! ⭐

Made with 🔥 by fxyzbtc

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysimplesps-0.2.1.tar.gz (103.5 kB view details)

Uploaded Source

Built Distribution

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

pysimplesps-0.2.1-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file pysimplesps-0.2.1.tar.gz.

File metadata

  • Download URL: pysimplesps-0.2.1.tar.gz
  • Upload date:
  • Size: 103.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.25

File hashes

Hashes for pysimplesps-0.2.1.tar.gz
Algorithm Hash digest
SHA256 568a9bae2b299dc673188461e8a5d04c5de479922cccf30310b869f1dc04b6d4
MD5 40ba1ebff36ed4ab9b2482b1434e1f31
BLAKE2b-256 ac4ed3c0227785e1744f67e1032612aef390fc39f6dad63a168eda1f6d0192d3

See more details on using hashes here.

File details

Details for the file pysimplesps-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pysimplesps-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 051000933dbda55ac52d8cc1f957295dc81b6389f076324926d845a8425427da
MD5 3fcaac5fbb3beb7d2b610325411d566d
BLAKE2b-256 937aa0aa87cfd9d433f510c78d3b71a5ebfccf6ae449dd9d1ab8345ddd0435ec

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 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