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/bdraco/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-0.6.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

cached_ipaddress-0.6.0-cp310-cp310-manylinux_2_31_x86_64.whl (235.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

File details

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

File metadata

  • Download URL: cached_ipaddress-0.6.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for cached_ipaddress-0.6.0.tar.gz
Algorithm Hash digest
SHA256 9c88884ac73729fc720aca7a7a1c6ba3a4f06b357a6b50c18abfbee94b84c1f3
MD5 f6892b9e466c455de635f00f3a7a345c
BLAKE2b-256 d936cc123d3c314e9f8995c597556dd554e218f5b92f4b7397738bf59a6429a8

See more details on using hashes here.

File details

Details for the file cached_ipaddress-0.6.0-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for cached_ipaddress-0.6.0-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2ec4a82b15b9089d4484519a90e4ddb8a4532c7ce41f9ac1fbd565830c94f70c
MD5 cc4150d419ac24ba79a0086aabe86bdc
BLAKE2b-256 6ada19dc3e430a2557f8faca577c1d9c96914f19e64a782cf44b5ca910d20208

See more details on using hashes here.

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