From 9fbdad45a81829c3e9e9c5e3e6c912eeb6f361d3 Mon Sep 17 00:00:00 2001 From: OpticalFlyer Date: Thu, 17 Apr 2025 07:36:23 -0500 Subject: [PATCH] Bootstrapped --- pyproject.toml | 32 ++++++++++++++++++++++++++++++++ setup.cfg | 10 ++++++++++ src/pyhld/__init__.py | 7 +++++++ src/pyhld/cli.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 src/pyhld/__init__.py create mode 100644 src/pyhld/cli.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a38bcc3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "pyhld" +version = "0.1.0" +description = "Fiber to the Home High Level Design CLI Tool" +readme = "README.md" +requires-python = ">=3.8" +license = "MIT" +authors = [ + { name = "Your Name", email = "your.email@example.com" } +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Telecommunications Industry", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +dependencies = [ + "click>=8.1.8", + "rich>=14.0.0", +] + +[project.scripts] +pyhld = "pyhld.cli:main" + +[tool.hatch.build.targets.wheel] +packages = ["src/pyhld"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..622d115 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,10 @@ +[metadata] +license_files = LICENSE + +[options] +package_dir= + =src +packages=find: + +[options.packages.find] +where=src \ No newline at end of file diff --git a/src/pyhld/__init__.py b/src/pyhld/__init__.py new file mode 100644 index 0000000..75cc6d7 --- /dev/null +++ b/src/pyhld/__init__.py @@ -0,0 +1,7 @@ +""" +PyHLD - Python Fiber to the Home High Level Design Tool +""" + +__version__ = "0.1.0" +__author__ = "Chris Bomar" +__email__ = "" \ No newline at end of file diff --git a/src/pyhld/cli.py b/src/pyhld/cli.py new file mode 100644 index 0000000..0b049d5 --- /dev/null +++ b/src/pyhld/cli.py @@ -0,0 +1,43 @@ +"""Command line interface for PyHLD.""" +import click +from rich.console import Console +from rich.panel import Panel +from . import __version__ + +console = Console() + +@click.group() +@click.version_option(version=__version__) +def main(): + """PyHLD - Fiber to the Home High Level Design CLI Tool.""" + pass + +@main.command() +@click.option('--input-file', '-i', type=click.Path(exists=True), help='Input data file') +@click.option('--output', '-o', type=click.Path(), help='Output file path') +def design(input_file, output): + """Create a high-level FTTH design.""" + console.print(Panel.fit("🌐 Creating FTTH Design", title="PyHLD")) + console.print(f"Input file: {input_file}") + console.print(f"Output will be saved to: {output}") + +@main.command() +@click.option('--homes', '-h', type=int, help='Number of homes to be served') +@click.option('--area', '-a', type=float, help='Service area in square kilometers') +def calculate(homes, area): + """Calculate basic FTTH metrics.""" + console.print(Panel.fit("📊 Calculating FTTH Metrics", title="PyHLD")) + if homes and area: + density = homes / area + console.print(f"Homes: {homes}") + console.print(f"Area: {area} km²") + console.print(f"Density: {density:.2f} homes/km²") + +@main.command() +def validate(): + """Validate design parameters and constraints.""" + console.print(Panel.fit("✅ Validating Design", title="PyHLD")) + # Add validation logic here + +if __name__ == '__main__': + main() \ No newline at end of file