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 True

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.1.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.1-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.1.tar.gz.

File metadata

  • Download URL: cached_ipaddress-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2af1d9d14ae919ad55ab0a855d20eaf4f625580070d0e382a99a91a76168e426
MD5 cbf50c10fee93b80c24af006847355ac
BLAKE2b-256 ac22bc14c2701f54a1be3518a44bf1d3f2082bb921742dedf865e7177cab0ab7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cached_ipaddress-1.1.1.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.1-cp314-cp314-manylinux_2_41_x86_64.whl.

File metadata

File hashes

Hashes for cached_ipaddress-1.1.1-cp314-cp314-manylinux_2_41_x86_64.whl
Algorithm Hash digest
SHA256 2b2a3d57878b36682b78e8908a02b0d1c7e04c47093ed7d5b155516883993cd3
MD5 a2faa0c58cf8f7cae5dd5fcc0358a7bc
BLAKE2b-256 dbb105e1f895e532b5b1f99e4e4ed45480c4126ee0c0d766d65418e2061619b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cached_ipaddress-1.1.1-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