https://github.com/intake/akimbo-ip
akimbo IP extension
https://github.com/intake/akimbo-ip
Last synced: 9 months ago
JSON representation
akimbo IP extension
- Host: GitHub
- URL: https://github.com/intake/akimbo-ip
- Owner: intake
- License: bsd-3-clause
- Created: 2024-07-15T17:12:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T16:44:54.000Z (about 1 year ago)
- Last Synced: 2025-08-01T14:12:14.910Z (10 months ago)
- Language: Rust
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Akimbo-ip
=========
Extension enabling fast vector processing of IPv4 and IPv6 values
within nested/ragged columns of dataframes.
(experimental)
Installation
------------
Run one of the following
```bash
> pip install git+https://github.com/intake/akimbo-ip # dev version
> pip install akimbo-ip # released version
```
Model
-----
- IPv4 addresses are (fixed) length 4 bytestrings, but can be represented
by any 4-bye value, e.g., uint32 or fixed-4-length list of uint8
- IPv6 addresses are (fixed) length 16 bytestrings or fixed-16-length list
of uint8
- Networks are records with an IPv4 or IPv6 field (nominally "address") and
a uint8 field for the prefix length (nominally "prefix"). The field
names can be overidden.
We can convert between hostmasks, netmasks and prefix lengths. Some methods
require composite types like list-of-addresses, see the individual docstrings.
As with the normal functioning of akimbo, you can indicate which parts of
a nested structure should be with the `where=` kwargs to any method.
Usage
-----
```python
>>> import akimbo.pandas
>>> import akimbo_ip
```
This will anable the ``.ak`` accessor for ``pandas`` series and dataframes
(or pick a different dataframe library) and a subaccessor ``.ak.ip`` which
makes available several methods that act on IP addresses and network.