lancalc


Namelancalc JSON
Version 0.1.9 PyPI version JSON
download
home_pageNone
SummaryA desktop application for calculating network configurations
upload_time2025-08-19 01:46:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Aleksandr Pimenov (wachawo@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords network calculator subnet ip address
VCS
bugtrack_url
requirements netifaces
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LanCalc

[![CI](https://github.com/lancalc/lancalc/actions/workflows/ci.yml/badge.svg)](https://github.com/lancalc/lancalc/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/lancalc.svg)](https://pypi.org/project/lancalc/)
[![Python](https://img.shields.io/pypi/pyversions/lancalc.svg)](https://pypi.org/project/lancalc/)

LanCalc is a desktop application built with PyQt5, designed to calculate network configurations for Windows, macOS, and Linux systems.

![image](https://github.com/user-attachments/assets/a7d1779f-d138-4819-84c6-4df876efc292)

[Download](https://github.com/lancalc/lancalc/releases)

It provides a user-friendly interface to compute essential network parameters such as network address, broadcast address, the minimum and maximum host addresses, and the number of hosts within a given subnet. 

Support IPv4 address formats, subnet masks and prefixes. This tool is particularly useful for network administrators and IT professionals who require quick calculations of network parameters.

## Quick Start

### Installation

Python 3.9+ is required.

- Default (with GUI):

```bash
pip3 install lancalc
```

- CLI-only / headless (avoid installing PyQt5):

```bash
# Install package without dependencies, then only required CLI deps
pip3 install --no-deps lancalc
pip3 install -r requirements.txt
```

- Install without GUI dependencies:

```bash
# Install with nogui extras (excludes PyQt5)
pip3 install 'lancalc[nogui]'
```

- Install from GitHub:

```bash
# With GUI (default)
pip3 install 'git+https://github.com/lancalc/lancalc.git'

# CLI-only / headless
pip3 install --no-deps 'git+https://github.com/lancalc/lancalc.git'
pip3 install -r requirements.txt

# Without GUI dependencies
pip3 install 'git+https://github.com/lancalc/lancalc.git#egg=lancalc[nogui]'
```

If pip is missing:

```bash
curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python3 /tmp/get-pip.py
```

If the `lancalc` command is not found after installation, add the local packages path to PATH:

```bash
export PATH="$HOME/.local/bin:$PATH"
```

To permanently add to PATH, add this line to your `~/.bashrc` or `~/.zshrc`:

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

Notes:
- On Linux, PyQt5 may require system Qt libraries (xcb plugin). If GUI fails to start, ensure a desktop environment is available and try installing system packages (e.g. Debian/Ubuntu: `sudo apt install python3-pyqt5`), or use the CLI-only steps above.
- In CI/headless environments, prefer the CLI-only steps above to skip GUI dependencies.

## Running the Application

### GUI Mode

After installation (default with GUI), launch the application with the command:

```bash
lancalc
```

LanCalc auto-detects the environment. If GUI dependencies are unavailable or you are in a headless session, the launcher falls back to CLI help. In such cases, use the CLI examples below.

### CLI Mode

LanCalc also supports command-line interface for automation and scripting:

```bash
# Basic usage
lancalc 192.168.1.1/24

# JSON output for parsing
lancalc 192.168.1.1/24 --json

# Examples
lancalc 10.0.0.1/8
lancalc 172.16.0.1/16
lancalc 192.168.1.100/31  # Point-to-point network
lancalc 192.168.1.1/32    # Single host
```

You can also run via module:

```bash
python3 -m lancalc 192.168.1.1/24 --json
```

### Output Format

**Text mode** (default):
```
Network: 192.168.1.0
Prefix: /24
Netmask: 255.255.255.0
Broadcast: 192.168.1.255
Hostmin: 192.168.1.1
Hostmax: 192.168.1.254
Hosts: 254
```

**JSON mode** (`--json`):
```json
{
  "network": "192.168.1.0",
  "prefix": "/24",
  "netmask": "255.255.255.0",
  "broadcast": "192.168.1.255",
  "hostmin": "192.168.1.1",
  "hostmax": "192.168.1.254",
  "hosts": "254",
  "comment": ""
}
```

### Uninstall

```bash
pip3 uninstall -y lancalc
```

That's it! The application will start and automatically detect your current network settings.

## For Developers

### Prerequisites

Python 3.9+ is required. GUI development requires PyQt5 (installed by default).

- Production (CLI only):
```bash
pip3 install -r requirements.txt
```

- Editable install with GUI (default):
```bash
pip3 install -e .
```

- Editable install without GUI:
```bash
pip3 install --no-deps -e .
pip3 install -r requirements.txt
```

- Full dev setup (with GUI):
```bash
pip3 install -e '.[dev]'
```

- Dev without GUI:
```bash
pip3 install --no-deps -e .
pip3 install -r requirements.txt
pip3 install pytest pytest-qt pre-commit flake8
```

- Reinstall 
```bash
pip3 install -e . --force-reinstall
```

### Installation for Development

Clone the repository and install in development mode:

```bash
git clone https://github.com/lancalc/lancalc.git
```

### Running from Source

```bash
# GUI (requires PyQt5)
python3 lancalc/main.py

# CLI
python3 -m lancalc 192.168.1.1/24
```

### Development Tools

```bash
pip3 install pre-commit flake8 pytest pytest-qt
pre-commit install
pre-commit run --all-files
pre-commit autoupdate
```

### Running Tests
```bash
pytest -v
```

### Test Build
```bash
pip3 install -e .
~/.local/bin/lancalc
```

### Test Build Linux
```bash
pip3 install git+file://$(pwd) 
export PATH="$HOME/.local/bin:$PATH" 
lancalc
```

### Test Build Windows
```powershell
pip3 install "git+file://$(Get-Location)"
lancalc
```

## License

Distributed under the MIT License. See LICENSE for more information.

## Contact

[GitHub](https://github.com/lancalc/lancalc) [Telegram](https://t.me/wachawo)

## Notes

A /31 mask allows the use of 2 addresses. The first will be the network address, the last the broadcast address, and for connecting hosts we use these same addresses.
Limitations when using a /31 prefix:
Protocols that use L3 broadcast stop working.
In fact, at present there are almost no protocols left that rely on L3 broadcast in their operation. The main currently relevant protocols, such as OSPF, IS-IS, EIGRP, and BGP, use multicast or unicast addresses instead.
This limitation can even be seen as an advantage, because it increases resistance to DoS attacks based on broadcast traffic distribution.
But not all devices support /31 prefixes.
On Juniper and Cisco devices, you can safely use a /31 mask, although Cisco will issue a warning (% Warning: use /31 mask on non point-to-point interface cautiously).
ZyXEL, however, does not allow you to select a /31 mask at all.
As a result, there are additional limitations in network operation — from using equipment of different manufacturers to even using equipment from the same vendor but with different firmware versions.
If you are not concerned by the above limitations, you can confidently save addresses by using the /31 prefix.

The use of the /31 prefix is described in detail in RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links.


## Special IPv4 Ranges and Cases

### Special Network Types

- **/31 networks**: Show `2*` in Hosts field - both addresses are usable (RFC 3021)
- **/32 networks**: Show `1*` in Hosts field - single host network
- The asterisk (*) indicates special network types where all addresses are usable

### Special IPv4 Address Ranges

LanCalc automatically detects and handles special IPv4 address ranges according to RFC specifications. For these ranges, host-related fields show "*" and a message field indicates the range type with RFC reference.

#### Supported Special Ranges

| Range | Type | RFC | Description |
|-------|------|-----|-------------|
| **127.0.0.0/8** | Loopback | [RFC 3330](docs/RFC.md#rfc-3330---loopback-addresses) | Loopback addresses - not routable on the Internet |
| **169.254.0.0/16** | Link-local | [RFC 3927](docs/RFC.md#rfc-3927---link-local-addresses) | Link-local addresses - not routable |
| **224.0.0.0/4** | Multicast | [RFC 5771](docs/RFC.md#rfc-5771---multicast-addresses) | Multicast addresses - not for host addressing |
| **0.0.0.0/8** | Unspecified | [RFC 1122](docs/RFC.md#rfc-1122---unspecified-addresses) | Unspecified addresses - not for host addressing |
| **255.255.255.255/32** | Broadcast | [RFC 919](docs/RFC.md#rfc-919---broadcast-address) | Limited broadcast address - not for host addressing |

#### Special Range Behavior

When you enter an address from a special range:

**CLI Text Mode:**
```bash
lancalc 127.0.0.1/8
```
```
Network: 127.0.0.0
Prefix: /8
Netmask: 255.0.0.0
Broadcast: *
Hostmin: 127.0.0.1
Hostmax: 127.255.255.254
Hosts: 16777214
Comment: RFC 3330 Loopback (https://github.com/lancalc/lancalc/blob/main/docs/RFC.md#rfc-3330---loopback-addresses)
```

**CLI JSON Mode:**
```bash
lancalc 224.0.0.1/4 --json
```
```json
{
  "network": "224.0.0.0",
  "prefix": "/4",
  "netmask": "240.0.0.0",
  "broadcast": "*",
  "hostmin": "*",
  "hostmax": "*",
  "hosts": "*",
  "comment": "RFC 5771 Multicast (https://github.com/lancalc/lancalc/blob/main/docs/RFC.md#rfc-5771---multicast-addresses)"
}
```

**GUI Mode:**
- Host fields (Hostmin, Hostmax, Broadcast, Hosts) show "*"
- Status bar displays the special range message instead of version
- No special styling or warnings needed

#### JSON Fields

The JSON output includes the following fields:

- **`comment`**: Description and RFC reference for special ranges (empty for normal unicast addresses)
- **`hosts`**: Number of available host addresses in the specified subnet

These fields are always present, making the JSON output format consistent regardless of address type.

## Usage

### Command Line Interface

```bash
# Basic subnet calculation
lancalc 192.168.1.1/24

# JSON output
lancalc 192.168.1.1/24 --json

# Show internal/private IP address
lancalc --internal
lancalc -i

# Show external/public IP address
lancalc --external
lancalc -e

# Use multiple info flags simultaneously
lancalc -i -e
lancalc -i -e --json

# Show version
lancalc --version
```

### Examples

**Basic calculation:**
```bash
$ lancalc 192.168.1.1/24
Network: 192.168.1.0
Prefix: /24
Netmask: 255.255.255.0
Broadcast: 192.168.1.255
Hostmin: 192.168.1.1
Hostmax: 192.168.1.254
Hosts: 254
```

**JSON output:**
```bash
$ lancalc 192.168.1.1/24 --json
{
  "network": "192.168.1.0",
  "prefix": "/24",
  "netmask": "255.255.255.0",
  "broadcast": "192.168.1.255",
  "hostmin": "192.168.1.1",
  "hostmax": "192.168.1.254",
  "hosts": "254"
}
```

**Interface information:**
```bash
$ lancalc -i
Address: 10.16.69.146
Prefix: /24

$ lancalc -i --json
{"address": "10.16.69.146", "prefix": "/24"}
```

**External IP detection:**
```bash
$ lancalc -e
External IP: 216.66.18.3

$ lancalc -e --json
{"external_ip": "216.66.18.3"}
```

**Multiple info flags:**
```bash
$ lancalc -i -e
Address: 10.16.69.146
Prefix: /24

External IP: 216.66.18.3

$ lancalc -i -e --json
{"address": "10.16.69.146", "prefix": "/24"}

{"external_ip": "216.66.18.3"}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lancalc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Aleksandr Pimenov <wachawo@gmail.com>",
    "keywords": "network, calculator, subnet, ip, address",
    "author": null,
    "author_email": "Aleksandr Pimenov <wachawo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2d/cc/b38d80385419e1f38a5e366c4d26499e22bfd50109df607d138a30112233/lancalc-0.1.9.tar.gz",
    "platform": null,
    "description": "# LanCalc\n\n[![CI](https://github.com/lancalc/lancalc/actions/workflows/ci.yml/badge.svg)](https://github.com/lancalc/lancalc/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/lancalc.svg)](https://pypi.org/project/lancalc/)\n[![Python](https://img.shields.io/pypi/pyversions/lancalc.svg)](https://pypi.org/project/lancalc/)\n\nLanCalc is a desktop application built with PyQt5, designed to calculate network configurations for Windows, macOS, and Linux systems.\n\n![image](https://github.com/user-attachments/assets/a7d1779f-d138-4819-84c6-4df876efc292)\n\n[Download](https://github.com/lancalc/lancalc/releases)\n\nIt provides a user-friendly interface to compute essential network parameters such as network address, broadcast address, the minimum and maximum host addresses, and the number of hosts within a given subnet. \n\nSupport IPv4 address formats, subnet masks and prefixes. This tool is particularly useful for network administrators and IT professionals who require quick calculations of network parameters.\n\n## Quick Start\n\n### Installation\n\nPython 3.9+ is required.\n\n- Default (with GUI):\n\n```bash\npip3 install lancalc\n```\n\n- CLI-only / headless (avoid installing PyQt5):\n\n```bash\n# Install package without dependencies, then only required CLI deps\npip3 install --no-deps lancalc\npip3 install -r requirements.txt\n```\n\n- Install without GUI dependencies:\n\n```bash\n# Install with nogui extras (excludes PyQt5)\npip3 install 'lancalc[nogui]'\n```\n\n- Install from GitHub:\n\n```bash\n# With GUI (default)\npip3 install 'git+https://github.com/lancalc/lancalc.git'\n\n# CLI-only / headless\npip3 install --no-deps 'git+https://github.com/lancalc/lancalc.git'\npip3 install -r requirements.txt\n\n# Without GUI dependencies\npip3 install 'git+https://github.com/lancalc/lancalc.git#egg=lancalc[nogui]'\n```\n\nIf pip is missing:\n\n```bash\ncurl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py\npython3 /tmp/get-pip.py\n```\n\nIf the `lancalc` command is not found after installation, add the local packages path to PATH:\n\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\nTo permanently add to PATH, add this line to your `~/.bashrc` or `~/.zshrc`:\n\n```bash\necho 'export PATH=\"$HOME/.local/bin:$PATH\"' >> ~/.bashrc\nsource ~/.bashrc\n```\n\nNotes:\n- On Linux, PyQt5 may require system Qt libraries (xcb plugin). If GUI fails to start, ensure a desktop environment is available and try installing system packages (e.g. Debian/Ubuntu: `sudo apt install python3-pyqt5`), or use the CLI-only steps above.\n- In CI/headless environments, prefer the CLI-only steps above to skip GUI dependencies.\n\n## Running the Application\n\n### GUI Mode\n\nAfter installation (default with GUI), launch the application with the command:\n\n```bash\nlancalc\n```\n\nLanCalc auto-detects the environment. If GUI dependencies are unavailable or you are in a headless session, the launcher falls back to CLI help. In such cases, use the CLI examples below.\n\n### CLI Mode\n\nLanCalc also supports command-line interface for automation and scripting:\n\n```bash\n# Basic usage\nlancalc 192.168.1.1/24\n\n# JSON output for parsing\nlancalc 192.168.1.1/24 --json\n\n# Examples\nlancalc 10.0.0.1/8\nlancalc 172.16.0.1/16\nlancalc 192.168.1.100/31  # Point-to-point network\nlancalc 192.168.1.1/32    # Single host\n```\n\nYou can also run via module:\n\n```bash\npython3 -m lancalc 192.168.1.1/24 --json\n```\n\n### Output Format\n\n**Text mode** (default):\n```\nNetwork: 192.168.1.0\nPrefix: /24\nNetmask: 255.255.255.0\nBroadcast: 192.168.1.255\nHostmin: 192.168.1.1\nHostmax: 192.168.1.254\nHosts: 254\n```\n\n**JSON mode** (`--json`):\n```json\n{\n  \"network\": \"192.168.1.0\",\n  \"prefix\": \"/24\",\n  \"netmask\": \"255.255.255.0\",\n  \"broadcast\": \"192.168.1.255\",\n  \"hostmin\": \"192.168.1.1\",\n  \"hostmax\": \"192.168.1.254\",\n  \"hosts\": \"254\",\n  \"comment\": \"\"\n}\n```\n\n### Uninstall\n\n```bash\npip3 uninstall -y lancalc\n```\n\nThat's it! The application will start and automatically detect your current network settings.\n\n## For Developers\n\n### Prerequisites\n\nPython 3.9+ is required. GUI development requires PyQt5 (installed by default).\n\n- Production (CLI only):\n```bash\npip3 install -r requirements.txt\n```\n\n- Editable install with GUI (default):\n```bash\npip3 install -e .\n```\n\n- Editable install without GUI:\n```bash\npip3 install --no-deps -e .\npip3 install -r requirements.txt\n```\n\n- Full dev setup (with GUI):\n```bash\npip3 install -e '.[dev]'\n```\n\n- Dev without GUI:\n```bash\npip3 install --no-deps -e .\npip3 install -r requirements.txt\npip3 install pytest pytest-qt pre-commit flake8\n```\n\n- Reinstall \n```bash\npip3 install -e . --force-reinstall\n```\n\n### Installation for Development\n\nClone the repository and install in development mode:\n\n```bash\ngit clone https://github.com/lancalc/lancalc.git\n```\n\n### Running from Source\n\n```bash\n# GUI (requires PyQt5)\npython3 lancalc/main.py\n\n# CLI\npython3 -m lancalc 192.168.1.1/24\n```\n\n### Development Tools\n\n```bash\npip3 install pre-commit flake8 pytest pytest-qt\npre-commit install\npre-commit run --all-files\npre-commit autoupdate\n```\n\n### Running Tests\n```bash\npytest -v\n```\n\n### Test Build\n```bash\npip3 install -e .\n~/.local/bin/lancalc\n```\n\n### Test Build Linux\n```bash\npip3 install git+file://$(pwd) \nexport PATH=\"$HOME/.local/bin:$PATH\" \nlancalc\n```\n\n### Test Build Windows\n```powershell\npip3 install \"git+file://$(Get-Location)\"\nlancalc\n```\n\n## License\n\nDistributed under the MIT License. See LICENSE for more information.\n\n## Contact\n\n[GitHub](https://github.com/lancalc/lancalc) [Telegram](https://t.me/wachawo)\n\n## Notes\n\nA /31 mask allows the use of 2 addresses. The first will be the network address, the last the broadcast address, and for connecting hosts we use these same addresses.\nLimitations when using a /31 prefix:\nProtocols that use L3 broadcast stop working.\nIn fact, at present there are almost no protocols left that rely on L3 broadcast in their operation. The main currently relevant protocols, such as OSPF, IS-IS, EIGRP, and BGP, use multicast or unicast addresses instead.\nThis limitation can even be seen as an advantage, because it increases resistance to DoS attacks based on broadcast traffic distribution.\nBut not all devices support /31 prefixes.\nOn Juniper and Cisco devices, you can safely use a /31 mask, although Cisco will issue a warning (% Warning: use /31 mask on non point-to-point interface cautiously).\nZyXEL, however, does not allow you to select a /31 mask at all.\nAs a result, there are additional limitations in network operation \u2014 from using equipment of different manufacturers to even using equipment from the same vendor but with different firmware versions.\nIf you are not concerned by the above limitations, you can confidently save addresses by using the /31 prefix.\n\nThe use of the /31 prefix is described in detail in RFC 3021 \u2014 Using 31-Bit Prefixes on IPv4 Point-to-Point Links.\n\n\n## Special IPv4 Ranges and Cases\n\n### Special Network Types\n\n- **/31 networks**: Show `2*` in Hosts field - both addresses are usable (RFC 3021)\n- **/32 networks**: Show `1*` in Hosts field - single host network\n- The asterisk (*) indicates special network types where all addresses are usable\n\n### Special IPv4 Address Ranges\n\nLanCalc automatically detects and handles special IPv4 address ranges according to RFC specifications. For these ranges, host-related fields show \"*\" and a message field indicates the range type with RFC reference.\n\n#### Supported Special Ranges\n\n| Range | Type | RFC | Description |\n|-------|------|-----|-------------|\n| **127.0.0.0/8** | Loopback | [RFC 3330](docs/RFC.md#rfc-3330---loopback-addresses) | Loopback addresses - not routable on the Internet |\n| **169.254.0.0/16** | Link-local | [RFC 3927](docs/RFC.md#rfc-3927---link-local-addresses) | Link-local addresses - not routable |\n| **224.0.0.0/4** | Multicast | [RFC 5771](docs/RFC.md#rfc-5771---multicast-addresses) | Multicast addresses - not for host addressing |\n| **0.0.0.0/8** | Unspecified | [RFC 1122](docs/RFC.md#rfc-1122---unspecified-addresses) | Unspecified addresses - not for host addressing |\n| **255.255.255.255/32** | Broadcast | [RFC 919](docs/RFC.md#rfc-919---broadcast-address) | Limited broadcast address - not for host addressing |\n\n#### Special Range Behavior\n\nWhen you enter an address from a special range:\n\n**CLI Text Mode:**\n```bash\nlancalc 127.0.0.1/8\n```\n```\nNetwork: 127.0.0.0\nPrefix: /8\nNetmask: 255.0.0.0\nBroadcast: *\nHostmin: 127.0.0.1\nHostmax: 127.255.255.254\nHosts: 16777214\nComment: RFC 3330 Loopback (https://github.com/lancalc/lancalc/blob/main/docs/RFC.md#rfc-3330---loopback-addresses)\n```\n\n**CLI JSON Mode:**\n```bash\nlancalc 224.0.0.1/4 --json\n```\n```json\n{\n  \"network\": \"224.0.0.0\",\n  \"prefix\": \"/4\",\n  \"netmask\": \"240.0.0.0\",\n  \"broadcast\": \"*\",\n  \"hostmin\": \"*\",\n  \"hostmax\": \"*\",\n  \"hosts\": \"*\",\n  \"comment\": \"RFC 5771 Multicast (https://github.com/lancalc/lancalc/blob/main/docs/RFC.md#rfc-5771---multicast-addresses)\"\n}\n```\n\n**GUI Mode:**\n- Host fields (Hostmin, Hostmax, Broadcast, Hosts) show \"*\"\n- Status bar displays the special range message instead of version\n- No special styling or warnings needed\n\n#### JSON Fields\n\nThe JSON output includes the following fields:\n\n- **`comment`**: Description and RFC reference for special ranges (empty for normal unicast addresses)\n- **`hosts`**: Number of available host addresses in the specified subnet\n\nThese fields are always present, making the JSON output format consistent regardless of address type.\n\n## Usage\n\n### Command Line Interface\n\n```bash\n# Basic subnet calculation\nlancalc 192.168.1.1/24\n\n# JSON output\nlancalc 192.168.1.1/24 --json\n\n# Show internal/private IP address\nlancalc --internal\nlancalc -i\n\n# Show external/public IP address\nlancalc --external\nlancalc -e\n\n# Use multiple info flags simultaneously\nlancalc -i -e\nlancalc -i -e --json\n\n# Show version\nlancalc --version\n```\n\n### Examples\n\n**Basic calculation:**\n```bash\n$ lancalc 192.168.1.1/24\nNetwork: 192.168.1.0\nPrefix: /24\nNetmask: 255.255.255.0\nBroadcast: 192.168.1.255\nHostmin: 192.168.1.1\nHostmax: 192.168.1.254\nHosts: 254\n```\n\n**JSON output:**\n```bash\n$ lancalc 192.168.1.1/24 --json\n{\n  \"network\": \"192.168.1.0\",\n  \"prefix\": \"/24\",\n  \"netmask\": \"255.255.255.0\",\n  \"broadcast\": \"192.168.1.255\",\n  \"hostmin\": \"192.168.1.1\",\n  \"hostmax\": \"192.168.1.254\",\n  \"hosts\": \"254\"\n}\n```\n\n**Interface information:**\n```bash\n$ lancalc -i\nAddress: 10.16.69.146\nPrefix: /24\n\n$ lancalc -i --json\n{\"address\": \"10.16.69.146\", \"prefix\": \"/24\"}\n```\n\n**External IP detection:**\n```bash\n$ lancalc -e\nExternal IP: 216.66.18.3\n\n$ lancalc -e --json\n{\"external_ip\": \"216.66.18.3\"}\n```\n\n**Multiple info flags:**\n```bash\n$ lancalc -i -e\nAddress: 10.16.69.146\nPrefix: /24\n\nExternal IP: 216.66.18.3\n\n$ lancalc -i -e --json\n{\"address\": \"10.16.69.146\", \"prefix\": \"/24\"}\n\n{\"external_ip\": \"216.66.18.3\"}\n```\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Aleksandr Pimenov (wachawo@gmail.com)\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A desktop application for calculating network configurations",
    "version": "0.1.9",
    "project_urls": {
        "Bug Reports": "https://github.com/lancalc/lancalc/issues",
        "Documentation": "https://github.com/lancalc/lancalc#readme",
        "Homepage": "https://github.com/lancalc/lancalc",
        "Repository": "https://github.com/lancalc/lancalc"
    },
    "split_keywords": [
        "network",
        " calculator",
        " subnet",
        " ip",
        " address"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0b7233dd10a7c7d52265ce9270fa8fce3300b28205c0542791f0388d19007ebf",
                "md5": "73d3c5395ff890c46245d93b8b13ffa1",
                "sha256": "1df9a1d82c9353bdf179fec9776732df26c115ff7158869cd41497035c1fab6c"
            },
            "downloads": -1,
            "filename": "lancalc-0.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73d3c5395ff890c46245d93b8b13ffa1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 21347,
            "upload_time": "2025-08-19T01:46:08",
            "upload_time_iso_8601": "2025-08-19T01:46:08.724178Z",
            "url": "https://files.pythonhosted.org/packages/0b/72/33dd10a7c7d52265ce9270fa8fce3300b28205c0542791f0388d19007ebf/lancalc-0.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2dccb38d80385419e1f38a5e366c4d26499e22bfd50109df607d138a30112233",
                "md5": "bf34b0673f6f56c86f8c8f719de579d7",
                "sha256": "afb98312672b3ab2ea22137610b81ddb53f573e0fe459cbf0e4506e71cc6661a"
            },
            "downloads": -1,
            "filename": "lancalc-0.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "bf34b0673f6f56c86f8c8f719de579d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 29529,
            "upload_time": "2025-08-19T01:46:10",
            "upload_time_iso_8601": "2025-08-19T01:46:10.113905Z",
            "url": "https://files.pythonhosted.org/packages/2d/cc/b38d80385419e1f38a5e366c4d26499e22bfd50109df607d138a30112233/lancalc-0.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-19 01:46:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lancalc",
    "github_project": "lancalc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "netifaces",
            "specs": [
                [
                    ">=",
                    "0.11.0"
                ]
            ]
        }
    ],
    "lcname": "lancalc"
}
        
Elapsed time: 1.50376s