Skip to content

A Flask web app to calculate subnet details, network addresses, broadcast addresses, and usable IP ranges for IPv4 and IPv6. User-friendly interface with export to CSV functionality.

License

Notifications You must be signed in to change notification settings

JosephJonathanFernandes/ip-subnet-calculator-python

Repository files navigation

🌐 IP Subnet Calculator (Flask)

A world-class, modular, and secure open-source web application for IP and subnet calculations. Built for production use, recruiter evaluation, and security auditor review.


πŸš€ Problem Statement

Modern networks require accurate, secure, and user-friendly tools for subnet calculation and IP analysis. This project delivers a scalable, extensible, and production-ready solution for both IPv4 and IPv6, with a strong emphasis on:

  • Code quality
  • Security best practices
  • Maintainability
  • Professional documentation

πŸ—οΈ Architecture & Tech Stack

  • Python 3.8+
  • Flask (Web Framework)

Python Flask License

Build Coverage Code Style Linting Security

Project Organization

.
β”œβ”€β”€ src/            # Core application logic (SOLID, DRY)
β”œβ”€β”€ config/         # Environment & configuration
β”œβ”€β”€ tests/          # Unit & integration tests (pytest)
β”œβ”€β”€ docs/           # Architecture, changelog, security, contributing
β”œβ”€β”€ scripts/        # Automation & developer utilities
β”œβ”€β”€ .github/        # CI/CD workflows (GitHub Actions)

✨ Features

  • βœ… IPv4 and IPv6 subnet calculations
  • βœ… Subnet mask, CIDR, wildcard, and host range computation
  • βœ… Download calculation results as CSV
  • βœ… Secure-by-default configuration
  • βœ… Modular, testable, and extensible architecture
  • βœ… Production-ready documentation and ownership model

⚑ Quick Start

1️⃣ Clone the repository

git clone https://github.com/JosephJonathanFernandes/ip-subnet-calculator-python
cd ip-subnet-calculator

2️⃣ Install dependencies

pip install -r requirements.txt

3️⃣ Set environment variables

cp config/.env.example config/.env

Set a secure secret key inside config/.env:

FLASK_SECRET_KEY=your-secure-secret-key

4️⃣ Run the application

flask run

πŸ§ͺ Testing

All core logic is fully tested using pytest.

pytest --cov=src
  • 🎯 Coverage Goal: 90%+ for core logic

🧹 Linting & Formatting

  • Linting
flake8 src/ tests/
  • Formatting
black src/ tests/
  • Pre-commit Hooks See .pre-commit-config.yaml

πŸ”„ CI/CD

Automated using GitHub Actions (.github/workflows/ci.yml):

  • Runs lint checks
  • Executes unit & integration tests
  • Measures test coverage
  • Triggered on every push and pull request

πŸ”’ Security

  • πŸ” No hardcoded secrets (.env.example provided)
  • πŸ›‘οΈ All user input validated and sanitized
  • 🌐 Secure HTTP headers enabled by default
  • πŸ“„ See SECURITY.md for full security policy

Contribution

Contributions are welcome and encouraged!


πŸ’‘ Project Value

  • ⭐ Recruiter- and reviewer-friendly
  • 🧩 Clean, maintainable, and extensible codebase
  • πŸ” Secure by default
  • πŸš€ Ready for production and open-source adoption

πŸ“ Documentation

  • ARCHITECTURE.md – High-level system design
  • CHANGELOG.md – Release history
  • CONTRIBUTING.md – Contribution guidelines
  • SECURITY.md – Security policy

πŸ› οΈ Developer Experience

  • Recommended: pre-commit hooks
  • Enforced linting & formatting
  • Automated CI/CD ensures code quality on every PR

πŸ“„ License

This project is licensed under the MIT License.

About

A Flask web app to calculate subnet details, network addresses, broadcast addresses, and usable IP ranges for IPv4 and IPv6. User-friendly interface with export to CSV functionality.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published