Metadata-Version: 2.4
Name: originet
Version: 1.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Topic :: Internet
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Summary: Fast IP-to-ASN lookups (longest-prefix match) on CAIDA's RouteViews prefix-to-AS snapshots, fetched on the fly or from a local file
Keywords: asn,bgp,caida,routeviews,ip,longest-prefix-match
Author: Esteban Carisimo
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/estcarisimo/originet/blob/main/CHANGELOG.md
Project-URL: Documentation, https://estcarisimo.github.io/originet/python/
Project-URL: Homepage, https://estcarisimo.github.io/originet/
Project-URL: Repository, https://github.com/estcarisimo/originet

# originet (Python)

Fast IP-to-ASN lookups on CAIDA's RouteViews prefix-to-AS snapshots. The table is a
Rust longest-prefix-match trie; bulk lookups release the GIL.

```python
from originet import Table

table = Table.from_caida("2024-01-01")  # newest snapshot on or before that day, cached
table.lookup("8.8.8.8")  # Match(ip='8.8.8.8', prefix='8.8.8.0/24', asn=15169, origins='15169')
table.lookup_asns(["1.1.1.1", "2001:4860::8888"])  # [13335, 15169]
```

Full documentation: https://estcarisimo.github.io/originet/python/

