Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/py-mmdb-encoder
Create mmdb files to encode prefix lists.
https://github.com/cloudflare/py-mmdb-encoder
automation geoip geoip-database network
Last synced: 7 days ago
JSON representation
Create mmdb files to encode prefix lists.
- Host: GitHub
- URL: https://github.com/cloudflare/py-mmdb-encoder
- Owner: cloudflare
- License: bsd-3-clause
- Created: 2018-02-22T15:26:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T22:35:14.000Z (3 months ago)
- Last Synced: 2024-12-18T03:07:03.877Z (14 days ago)
- Topics: automation, geoip, geoip-database, network
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 30
- Watchers: 5
- Forks: 11
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
Python MMDB encoder
=========================At Cloudflare, as part of the network automation, we build our IP prefix tables.
An example of how to use it:
::
import mmdbencoder
enc = mmdbencoder.Encoder(
6, # IP version
32, # Size of the pointers
'My-Custom-Table', # Name of the table
['en'], # Languages
{'en': 'Lorem Ipsum'}, # Description
compat=True) # Map IPv4 in IPv6 (::abcd instead of ::ffff:abcd) to be read by official libraries
data = enc.insert_data({'info': 'Hello World'})
enc.insert_network(u'10.0.0.0/24', data)
enc.write_file('hello.mmdb')Installation
============From source:
::
$ ./setup.py install
$From pypi:
::
$ pip install py-mmdb-encoder
$