{"id":19825243,"url":"https://github.com/tes3awy/subnetting","last_synced_at":"2025-05-01T13:32:17.456Z","repository":{"id":48460888,"uuid":"375486367","full_name":"Tes3awy/subnetting","owner":"Tes3awy","description":"Advanced IPv4 Subnet Calculator in Python3","archived":false,"fork":false,"pushed_at":"2022-05-20T16:08:37.000Z","size":279,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T14:12:50.301Z","etag":null,"topics":["automation","csv","excel","jinja2","jinja2-templates","precommit-hooks","python","python3","subnet","subnet-calculator","subnetting-ipv4-addresses"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tes3awy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-09T20:52:21.000Z","updated_at":"2023-02-24T13:05:07.000Z","dependencies_parsed_at":"2022-07-29T02:09:05.991Z","dependency_job_id":null,"html_url":"https://github.com/Tes3awy/subnetting","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fsubnetting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fsubnetting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fsubnetting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tes3awy%2Fsubnetting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tes3awy","download_url":"https://codeload.github.com/Tes3awy/subnetting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251881762,"owners_count":21659165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","csv","excel","jinja2","jinja2-templates","precommit-hooks","python","python3","subnet","subnet-calculator","subnetting-ipv4-addresses"],"created_at":"2024-11-12T11:07:06.190Z","updated_at":"2025-05-01T13:32:17.208Z","avatar_url":"https://github.com/Tes3awy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tested on Python 3.7+](https://img.shields.io/badge/Python%203.7+-blue.svg?logo=python\u0026logoColor=white\u0026style=flat-square)](https://www.python.org/downloads)\n[![Code Size](https://img.shields.io/github/languages/code-size/Tes3awy/subnetting?color=green\u0026style=flat-square)](https://github.com/Tes3awy/subnetting)\n[![Contributors](https://img.shields.io/github/contributors/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/graphs/contributors)\n[![Release Date](https://img.shields.io/github/release-date/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/releases)\n[![Commit Activity](https://img.shields.io/github/commit-activity/m/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/commits/main)\n![Languages Count](https://img.shields.io/github/languages/count/Tes3awy/subnetting?style=flat-square)\n![Top Language](https://img.shields.io/github/languages/top/Tes3awy/subnetting?style=flat-square)\n[![Stars](https://img.shields.io/github/stars/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/stargazers)\n[![Forks](https://img.shields.io/github/forks/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/network/members)\n[![Open Issues](https://img.shields.io/github/issues/Tes3awy/subnetting?style=flat-square)](https://github.com/Tes3awy/subnetting/issues)\n[![Closed PR](https://img.shields.io/github/issues-pr-closed/Tes3awy/subnetting?style=flat-square\u0026color=green)](https://github.com/Tes3awy/subnetting/pulls?q=is%3Apr+is%3Aclosed)\n[![License](https://img.shields.io/github/license/Tes3awy/subnetting?style=flat-square\u0026color=purple)](https://github.com/Tes3awy/subnetting/blob/main/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Pre-Commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\u0026style=flat-square)](https://github.com/pre-commit/pre-commit)\n\n# Advanced IPv4 Subnet Calculator in Python3\n\n## Table of Contents\n\n1. [Getting Started](#getting-started)\n2. [Installation](#installation)\n3. [How it works?](#how-it-works)\n4. [SVI Configuration Template](#svi-configuration-template)\n5. [Previews](#previews)\n\n### Getting Started\n\n```bash\n│   main.py\n│   read_subnets.py\n│   subnetting.py\n│   export_subnets.py\n│   parse_excel.py\n│   svi_generator.py\n│   svi.j2\n│   subnets.csv\n│   requirements.txt\n│   README.md\n│   .pre-commit-config.yaml\n│   .gitignore\n│   LICENSE\n│\n└───assets\n        preview.png\n        subnets-csv.png\n        subnetting-cli.png\n        svi-template.png\n        svi.png\n```\n\n---\n\n### Installation\n\n```bash\n$ git clone https://github.com/Tes3awy/subnetting.git\n$ cd subnetting\n$ pip install -r requirements.txt --user\n```\n\n**OR**\n\n1. Download the latest release from [Releases](https://github.com/Tes3awy/subnetting/releases/).\n2. Extract `subnetting.zip` file.\n3. `cd` into `subnetting` directory.\n4. Run `path_to\\subnetting\u003e pip install -r requirements.txt --user` in terminal.\n\n---\n\n### How it works?\n\n**Windows**\n\n```powershell\npath_to\\subnetting\u003e python main.py\n```\n\n**macOS or Unix**\n\n```bash\n$ python3 main.py\n```\n\nYou will be prompted to enter the name of the CSV file containing input subnets, the gateway, a name for the Excel file to be created. _(All inputs have default values)_.\n\n\u003e A `subnets.csv` file can be found in the repo. This file is an entry point to get started using this program. It's prepopulated with three different subnets. _(Class A, B, and C)_.\n\n```bash\n- CSV file [subnets.csv]:\n- The gateway, first or last IP Address [0/1] [0]:\n- Excel file to create [New-Schema.xlsx]:\n```\n\nVoila :sparkles: You have an Excel file that includes all required data about each subnet.\n\n```bash\nPlease check New-Schema_\u003cTODAYS_DATE\u003e.xlsx in current working directory.\n```\n\n\u003e **Default behaviors:**\n\n\u003e 1. CIDR notation with no prefix length will be handled as /32. \u003cbr /\u003e - For example, if you enter `10.0.0.1` without a prefix length in the CSV file, the script will handle it like `10.0.0.1/32`.\n\n\u003e 2. The header line **`Subnets in CIDR Notation`** within the `subnets.csv` file is automatically skipped. So, there is no need to manually remove it.\n\n\u003e 3. The gateway input accepts 0 or 1 **ONLY** [Defaults to 0]. 0 picks the first IP address of the subnet, while 1 picks the last IP address.\n\n---\n\n### SVI Configuration Template\n\nFinally, if you have a L3 switch and you want to create [SVI interfaces](https://en.wikipedia.org/wiki/Switch_virtual_interface) of the created subnets on that switch, you can run:\n\n```bash\n$ python parse_excel.py --file \u003cEXCEL_FILE_NAME\u003e.xlsx\n```\n\nThis Python script will generate a configuration file that includes all VLANs and their SVI interfaces.\n\n\u003e **NOTE:** Make sure you add the VLAN ID and VLAN Name in all the cells in the generated Excel file before running `parse_excel.py` script. _Otherwise, VLAN ID and VLAN Name will be NaN_ in the generated configuration file.\n\n---\n\n### Previews\n\n**Terminal**\n![Python CLI](assets/subnetting-cli.png)\n_Elapsed time is about 9 seconds in here because a CIDR notation like 10.0.0.0/8 is a little bit extensive to process._\n\n**CSV File (Input File)**\n![CSV File](assets/subnets-csv.png)\n\n**Excel File (Output File)**\n![Excel Preview](assets/preview.png)\n\n**python parse_excel.py -f \u003cEXCEL_FILE_NAME\u003e.xlsx**\n![SVI CLI](assets/svi.png)\n\n**SVI Template**\n![SVI Template](assets/svi-template.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftes3awy%2Fsubnetting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftes3awy%2Fsubnetting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftes3awy%2Fsubnetting/lists"}