pyvpc


Namepyvpc JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/ArieLevs/PyVPC
SummaryPython AWS VPC CIDR available range finder with sub networks
upload_time2020-08-01 12:43:21
maintainer
docs_urlNone
authorArie Lev
requires_python
licenseApache License 2.0
keywords networking ipv4 ip cidr vpc aws subnet range network suggestion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyVPC - CIDR free range resolver
=================================

[![](https://github.com/arielevs/pyvpc/workflows/Python%20package/badge.svg)](https://pypi.org/project/pyvpc/)
[![](https://img.shields.io/pypi/v/pyvpc.svg)](https://pypi.org/project/pyvpc/)
[![](https://img.shields.io/pypi/l/pyvpc.svg?colorB=blue)](https://pypi.org/project/pyvpc/)
[![](https://img.shields.io/pypi/pyversions/pyvpc.svg)](https://pypi.org/project/pyvpc/)

Get available CIDR/sub networks ranges from your cloud network,
This app will return all available networks that are not is use by a vpc, 
or sub network that are not is use inside a specific VPC. 

It can also suggest networks, according to flags passed to this app, 
view examples below.

* Current version supports only AWS VPCs.  


## Install
```bash
pip install pyvpc
```

## Usage
#### aws:
```
pyvpc aws [-h] [--cidr-range CIDR_RANGE]
          [--suggest-range {0-32}]
          [--num-of-addr NUM_OF_ADDR] [--output {json}]
          [--region REGION] [--all-regions] [--vpc VPC]
```

## Examples
*   Assuming there are two AWS VPCs with CIDRs: `10.20.0.0/16` and `10.30.0.0/16`,
    executing command: 
    ```bash
    pyvpc aws --cidr-range 10.0.0.0/8
    ```
    will return:
    ```
    | Lowest IP   | Upper IP       |   Num of Addr |   Prefix | Available   | ID                    | Name         |
    |-------------|----------------|---------------|----------|-------------|-----------------------|--------------|
    | 10.0.0.0    | 10.19.255.255  |       1310720 |          | True        |                       |              |
    | 10.20.0.0   | 10.20.255.255  |         65536 |       16 | False       | vpc-Ec9hQfmjk4sPCH65c | lev-test-vpc |
    | 10.21.0.0   | 10.29.255.255  |        589824 |          | True        |                       |              |
    | 10.30.0.0   | 10.30.255.255  |         65536 |       16 | False       | vpc-4WNpVY5wCLmdqfJLy | dev-k8s      |
    | 10.31.0.0   | 10.255.255.255 |      14745600 |          | True        |                       |              |
    ```

*   For example, a VPC with `10.50.0.0/16` cidr, executing command:
    ```bash
    pyvpc aws --vpc vpc-3w5cymcdnwjm389gq
    ```

    will return:
    ```
    | Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID                       | Name               |
    |-------------|---------------|---------------|----------|-------------|--------------------------|--------------------|
    | 10.50.0.0   | 10.50.63.255  |         16384 |          | True        |                          |                    |
    | 10.50.64.0  | 10.50.95.255  |          8192 |       19 | False       | subnet-0905d925dd4d240fb | private-arie-test  |
    | 10.50.96.0  | 10.50.127.255 |          8192 |       19 | False       | subnet-031a7b06bb1fbf991 | private-arie-test  |
    | 10.50.128.0 | 10.50.200.255 |         18688 |          | True        |                          |                    |
    | 10.50.201.0 | 10.50.201.255 |           256 |       24 | False       | subnet-09adedd87bec861e8 | public-arie-test   |
    | 10.50.202.0 | 10.50.202.255 |           256 |       24 | False       | subnet-0fcceff21a973dda2 | public-arie-test   |
    | 10.50.203.0 | 10.50.210.255 |          2048 |          | True        |                          |                    |
    | 10.50.211.0 | 10.50.211.255 |           256 |       24 | False       | subnet-0da43f86bc6f4c42f | database-arie-test |
    | 10.50.212.0 | 10.50.212.255 |           256 |       24 | False       | subnet-0a4c14480eb8189c5 | database-arie-test |
    | 10.50.213.0 | 10.50.255.255 |         11008 |          | True        |                          |                    |
    ```

### Suggest available networks:

For example we pass the `--cidr-range 10.0.0.0/12 --suggest-range 14` value,
on the first example (`10.20.0.0/16` and `10.30.0.0/16` are reserved).

the result will be:
```
| Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID   | Name   |
|-------------|---------------|---------------|----------|-------------|------|--------|
| 10.0.0.0    | 10.3.255.255  |        262144 |       14 | True        |      |        |
| 10.4.0.0    | 10.7.255.255  |        262144 |       14 | True        |      |        |
| 10.8.0.0    | 10.11.255.255 |        262144 |       14 | True        |      |        |
| 10.12.0.0   | 10.15.255.255 |        262144 |       14 | True        |      |        |
```

Or if adding ` --cidr-range 10.0.0.0/10 --num-of-addr 100000`
(we need all available network that have at least hundred thousand addresses),
the result will be :
```
| Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID   | Name   |
|-------------|---------------|---------------|----------|-------------|------|--------|
| 10.0.0.0    | 10.15.255.255 |       1048576 |       12 | True        |      |        |
| 10.16.0.0   | 10.19.255.255 |        262144 |       14 | True        |      |        |
| 10.22.0.0   | 10.23.255.255 |        131072 |       15 | True        |      |        |
| 10.24.0.0   | 10.27.255.255 |        262144 |       14 | True        |      |        |
| 10.28.0.0   | 10.29.255.255 |        131072 |       15 | True        |      |        |
| 10.32.0.0   | 10.63.255.255 |       2097152 |       11 | True        |      |        |
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ArieLevs/PyVPC",
    "name": "pyvpc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Networking,IPv4,IP,CIDR,VPC,AWS,Subnet,Range,Network Suggestion",
    "author": "Arie Lev",
    "author_email": "levinsonarie@gmail.com",
    "download_url": "",
    "platform": "",
    "description": "PyVPC - CIDR free range resolver\n=================================\n\n[![](https://github.com/arielevs/pyvpc/workflows/Python%20package/badge.svg)](https://pypi.org/project/pyvpc/)\n[![](https://img.shields.io/pypi/v/pyvpc.svg)](https://pypi.org/project/pyvpc/)\n[![](https://img.shields.io/pypi/l/pyvpc.svg?colorB=blue)](https://pypi.org/project/pyvpc/)\n[![](https://img.shields.io/pypi/pyversions/pyvpc.svg)](https://pypi.org/project/pyvpc/)\n\nGet available CIDR/sub networks ranges from your cloud network,\nThis app will return all available networks that are not is use by a vpc, \nor sub network that are not is use inside a specific VPC. \n\nIt can also suggest networks, according to flags passed to this app, \nview examples below.\n\n* Current version supports only AWS VPCs.  \n\n\n## Install\n```bash\npip install pyvpc\n```\n\n## Usage\n#### aws:\n```\npyvpc aws [-h] [--cidr-range CIDR_RANGE]\n          [--suggest-range {0-32}]\n          [--num-of-addr NUM_OF_ADDR] [--output {json}]\n          [--region REGION] [--all-regions] [--vpc VPC]\n```\n\n## Examples\n*   Assuming there are two AWS VPCs with CIDRs: `10.20.0.0/16` and `10.30.0.0/16`,\n    executing command: \n    ```bash\n    pyvpc aws --cidr-range 10.0.0.0/8\n    ```\n    will return:\n    ```\n    | Lowest IP   | Upper IP       |   Num of Addr |   Prefix | Available   | ID                    | Name         |\n    |-------------|----------------|---------------|----------|-------------|-----------------------|--------------|\n    | 10.0.0.0    | 10.19.255.255  |       1310720 |          | True        |                       |              |\n    | 10.20.0.0   | 10.20.255.255  |         65536 |       16 | False       | vpc-Ec9hQfmjk4sPCH65c | lev-test-vpc |\n    | 10.21.0.0   | 10.29.255.255  |        589824 |          | True        |                       |              |\n    | 10.30.0.0   | 10.30.255.255  |         65536 |       16 | False       | vpc-4WNpVY5wCLmdqfJLy | dev-k8s      |\n    | 10.31.0.0   | 10.255.255.255 |      14745600 |          | True        |                       |              |\n    ```\n\n*   For example, a VPC with `10.50.0.0/16` cidr, executing command:\n    ```bash\n    pyvpc aws --vpc vpc-3w5cymcdnwjm389gq\n    ```\n\n    will return:\n    ```\n    | Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID                       | Name               |\n    |-------------|---------------|---------------|----------|-------------|--------------------------|--------------------|\n    | 10.50.0.0   | 10.50.63.255  |         16384 |          | True        |                          |                    |\n    | 10.50.64.0  | 10.50.95.255  |          8192 |       19 | False       | subnet-0905d925dd4d240fb | private-arie-test  |\n    | 10.50.96.0  | 10.50.127.255 |          8192 |       19 | False       | subnet-031a7b06bb1fbf991 | private-arie-test  |\n    | 10.50.128.0 | 10.50.200.255 |         18688 |          | True        |                          |                    |\n    | 10.50.201.0 | 10.50.201.255 |           256 |       24 | False       | subnet-09adedd87bec861e8 | public-arie-test   |\n    | 10.50.202.0 | 10.50.202.255 |           256 |       24 | False       | subnet-0fcceff21a973dda2 | public-arie-test   |\n    | 10.50.203.0 | 10.50.210.255 |          2048 |          | True        |                          |                    |\n    | 10.50.211.0 | 10.50.211.255 |           256 |       24 | False       | subnet-0da43f86bc6f4c42f | database-arie-test |\n    | 10.50.212.0 | 10.50.212.255 |           256 |       24 | False       | subnet-0a4c14480eb8189c5 | database-arie-test |\n    | 10.50.213.0 | 10.50.255.255 |         11008 |          | True        |                          |                    |\n    ```\n\n### Suggest available networks:\n\nFor example we pass the `--cidr-range 10.0.0.0/12 --suggest-range 14` value,\non the first example (`10.20.0.0/16` and `10.30.0.0/16` are reserved).\n\nthe result will be:\n```\n| Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID   | Name   |\n|-------------|---------------|---------------|----------|-------------|------|--------|\n| 10.0.0.0    | 10.3.255.255  |        262144 |       14 | True        |      |        |\n| 10.4.0.0    | 10.7.255.255  |        262144 |       14 | True        |      |        |\n| 10.8.0.0    | 10.11.255.255 |        262144 |       14 | True        |      |        |\n| 10.12.0.0   | 10.15.255.255 |        262144 |       14 | True        |      |        |\n```\n\nOr if adding ` --cidr-range 10.0.0.0/10 --num-of-addr 100000`\n(we need all available network that have at least hundred thousand addresses),\nthe result will be :\n```\n| Lowest IP   | Upper IP      |   Num of Addr |   Prefix | Available   | ID   | Name   |\n|-------------|---------------|---------------|----------|-------------|------|--------|\n| 10.0.0.0    | 10.15.255.255 |       1048576 |       12 | True        |      |        |\n| 10.16.0.0   | 10.19.255.255 |        262144 |       14 | True        |      |        |\n| 10.22.0.0   | 10.23.255.255 |        131072 |       15 | True        |      |        |\n| 10.24.0.0   | 10.27.255.255 |        262144 |       14 | True        |      |        |\n| 10.28.0.0   | 10.29.255.255 |        131072 |       15 | True        |      |        |\n| 10.32.0.0   | 10.63.255.255 |       2097152 |       11 | True        |      |        |\n```\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Python AWS VPC CIDR available range finder with sub networks",
    "version": "0.1.6",
    "split_keywords": [
        "networking",
        "ipv4",
        "ip",
        "cidr",
        "vpc",
        "aws",
        "subnet",
        "range",
        "network suggestion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0389c43f33e01e87fb1f6a841a62e674",
                "sha256": "b7e5c0a39cd5710636f61129b4be43892eeb87dbdc318379d5ff6030ead8a339"
            },
            "downloads": -1,
            "filename": "pyvpc-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0389c43f33e01e87fb1f6a841a62e674",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15960,
            "upload_time": "2020-08-01T12:43:21",
            "upload_time_iso_8601": "2020-08-01T12:43:21.882985Z",
            "url": "https://files.pythonhosted.org/packages/3f/e9/c1666c5f6fc9c5c01b064d27aacdc5b4e8c6b2f4da3403ae94db2cd819ba/pyvpc-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-08-01 12:43:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "ArieLevs",
    "error": "Could not fetch GitHub repository",
    "lcname": "pyvpc"
}
        
Elapsed time: 0.16515s