Cache construction of ipaddress objects
Project description
cached-ipaddress
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cached_ipaddress-0.8.0.tar.gz
.
File metadata
- Download URL: cached_ipaddress-0.8.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65037b86959f20fd6505b8ecdbd9cb79c79fb0abc8d3a65c59125aa8d68e9c9b |
|
MD5 | 0874f47cf5df21af3173242cf1334686 |
|
BLAKE2b-256 | 8242a020daf196226cbdb21428ee92fe570401cb085351a474c701625d99b08c |
File details
Details for the file cached_ipaddress-0.8.0-cp310-cp310-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: cached_ipaddress-0.8.0-cp310-cp310-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 234.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 186bb29ad7be66ac05d327f00feec7885ca22b9a963e6c2dcc36882c315462d6 |
|
MD5 | 32863c81dee6538bf24328b6c5452326 |
|
BLAKE2b-256 | 77328b41b5116e85cfacfd88d16c375685d0abfb0a702dab35bfa3409004c957 |