Redis as a storage for IP range
Project description
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# IPRange
Store IP Ranges in Redis as sorted sets for fast retrieval
## Installation
pip install iprange-python
## Usage
>>> from iprange import IPRange >>> iprange = IPRange() >>> iprange.add('192.168.0.1/24', {'some': 'data', 'more': 'metadata'}) >>> iprange.find('192.168.0.20') {'range': '192.168.0.1/24', 'some': 'data', 'more': 'metadata'}
## IPRange in other languages
## Notice
This library relies on [a Redis fork that implements interval sets](https://github.com/hoxworth/redis/tree/2.6-intervals), as described in this [blog post](http://blog.togo.io/how-to/adding-interval-sets-to-redis/).
You can also use [a more recent version of Redis with Interval Sets](https://github.com/lucasrodcosta/redis).
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
iprange-python-0.0.3.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for iprange_python-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a726e6b04834d74aa6b4eb4b19a094b8b8621b0d972d55d10be13b1cd07b346 |
|
MD5 | 97cc939ea52b3902d5de16aaf1ad35d7 |
|
BLAKE2b-256 | 9dc2c5550ac6bd466e2c8075ebde2bc950e4c3d34332e9c4f4a47104d414ac39 |