Skip to main content

python-bogons

Python version of https://github.com/mellowdrifter/bogons

Python library to validate IP and ASN bogons. This library does not filter out unassigned space. It will filter IPv4, IPv6, and Autonomous system numbers that have been marked as bogons in the following RFCs:

For IPv6: 6to4, 6bone, and any prefix not in 2000::/3 is marked as invalid.

Install

pip install bogons

How to use

import bogons
>>> bogons.is_public_ip("1.1.1.1")
True
>>> bogons.is_public_ip("10.0.0.0")
False
>>> bogons.is_public_ip("2600::")
True
>>> bogons.is_public_ip("4600::")
False
>>> bogons.valid_public_asn(1)
True
>>> bogons.valid_public_asn(23456)
False

Development

I welcome pull requests for updated RFCs or errors.

Metadata

Release files for bogons 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bogons 1.0.3
File Size Uploaded
bogons-1.0.3.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bogons 1.0.3
File Interpreter ABI Platform
bogons-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / bogons-1.0.3.tar.gz

Download URL bogons-1.0.3.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c1e4ef149812181b704450056a7839cd787919968a63d0fca3e54b30bcdab179
BLAKE2b-256 checksum
How to use checksums
94fd5f5d2255f894abe0a4d173a705e595dd100ed5ae4c909269a3917c9fa556
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

Release files / bogons-1.0.3-py3-none-any.whl

Download URL bogons-1.0.3-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d8b818552817a03bc4501ebfd58034a57908234599082a0510c2d4c3b899a3
BLAKE2b-256 checksum
How to use checksums
28116279da16df646e37d3b972876175676c403312a1e2662613d5e0dcb3a29c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page