Skip to main content

Convert IP addresses to integers

Project description

ipy2d

A small library to convert IP addresses to integers

Usage

from ipy2d import convert

print(convert.from_4("127.0.0.1")) # -> 2130706433
print(convert.to_4(134744072)) # -> 8.8.8.8

print(convert.from_6("::1")) # -> 1
print(convert.to_6(1051570404137199630024704)) # -> 0000:0000:0000:dead:beef:0000:0000:0000

Development

  • Install dependencies from setup.py python3 setup.py install
  • run main.py python3 -m ipy2d

Lint and Format

pylint ipy2d/

black ipy2d/

Test

If pytest is installed, you can run pytest -rxXs test/*

Deploy

  • create dist python3 setup.py sdist bdist_wheel
  • check dist twine check dist/*
  • publish dist twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipy2d-0.0.5.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

ipy2d-0.0.5-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page