Skip to main content

Cache construction of ipaddress objects

Project description

cached-ipaddress

CI Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License


Source Code: https://github.com/bluetooth-devices/cached-ipaddress


Cache construction of ipaddress objects

Design

This module keeps a cache of IPAddress objects and caches the properties on them.

It it useful when you frequently see the same ip addresses over and over and do not want to pay the overhead of constructing IPAddress objects over and over or checking their properties.

Installation

Install this via pip (or your favourite package manager):

pip install cached-ipaddress

Usage

from cached_ipaddress import cached_ip_addresses

ip = cached_ip_addresses("127.0.0.1")
assert ip.is_loopback is False

invalid = cached_ip_addresses("invalid")
assert invalid is None

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Copier and the browniebroke/pypackage-template project template.

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

cached_ipaddress-1.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cached_ipaddress-1.1.0-cp314-cp314-manylinux_2_41_x86_64.whl (46.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.41+ x86-64

File details

Details for the file cached_ipaddress-1.1.0.tar.gz.

File metadata

  • Download URL: cached_ipaddress-1.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cached_ipaddress-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4ce52de3dcdeffccdc2f75cd8c7d5e4a2e1052a102a35bdb5a7ff5d7d73b169f
MD5 6ef8f66b393a4f6c45d07f2dfbb91cb7
BLAKE2b-256 7abdfe338812de36a7c590354070954251515b07cc96e49b7fb186f27ff3c580

See more details on using hashes here.

Provenance

The following attestation bundles were made for cached_ipaddress-1.1.0.tar.gz:

Publisher: ci.yml on Bluetooth-Devices/cached-ipaddress

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cached_ipaddress-1.1.0-cp314-cp314-manylinux_2_41_x86_64.whl.

File metadata

File hashes

Hashes for cached_ipaddress-1.1.0-cp314-cp314-manylinux_2_41_x86_64.whl
Algorithm Hash digest
SHA256 9c049faa736983e2d18db53e50c7f60cf5a471b23dd8a7478d94e19b501c4db9
MD5 22b34b454816d7cd4eb98e013378cff4
BLAKE2b-256 a6ba78561abbfed2f8b779ed58e33e473dd675d5fb30386ab823fe00aedc2c40

See more details on using hashes here.

Provenance

The following attestation bundles were made for cached_ipaddress-1.1.0-cp314-cp314-manylinux_2_41_x86_64.whl:

Publisher: ci.yml on Bluetooth-Devices/cached-ipaddress

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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