Installation
pip install geoipsets
Usage
Utility output can be controlled using a configuration file and/or command line options. For the MaxMind provider type, this configuration file is required in order to provide the license-key. See the example for details.
The example file enables all options which is likely not what you want as it will generate IPv4 and IPv6 sets for both firewall types for all countries.
Typically, you would want to select only one firewall type along with a short list of countries and perhaps only for the IPv4 address family.
The utility will attempt to read the configuration file at /etc/geoipsets.conf but the location can be overidden using the --config PATH_TO_FILE command line option.
usage: geoipsets [-h] [-v] [-p {maxmind,dbip} [{maxmind,dbip} ...]] [-f {nftables,iptables} [{nftables,iptables} ...]] [-a {ipv4,ipv6} [{ipv4,ipv6} ...]]
[-l COUNTRIES] [-o OUTPUT_DIR] [-c CONFIG_FILE] [--checksum] [--no-checksum]
Utility to build country specific IP sets for ipset/iptables and nftables. Command line arguments take precedence over those in the configuration file.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-p {maxmind,dbip} [{maxmind,dbip} ...], --provider {maxmind,dbip} [{maxmind,dbip} ...]
dataset provider(s) (default: dbip)
-f {nftables,iptables} [{nftables,iptables} ...], --firewall {nftables,iptables} [{nftables,iptables} ...]
firewall(s) to build sets for (default: nftables)
-a {ipv4,ipv6} [{ipv4,ipv6} ...], --address-family {ipv4,ipv6} [{ipv4,ipv6} ...]
IP protocol(s) to build sets for (default: ipv4)
-l COUNTRIES, --countries COUNTRIES
Path to a file containing 2-character country codes, one per line, or a comma-separated list of country codes. Argument is treated
as a path first. If it does not resolve, or the resolved file is invalid, then it is parsed as a comma-separated list.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
directory where geoipsets should be saved (default: /tmp)
-c CONFIG_FILE, --config-file CONFIG_FILE
path to configuration file (default: /etc/geoipsets.conf)
--checksum enable checksum validation of downloaded files (default)
--no-checksum disable checksum validation of downloaded files
Metadata
Release files for geoipsets 2.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geoipsets-2.4.1.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geoipsets-2.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / geoipsets-2.4.1.tar.gz
| Download URL | geoipsets-2.4.1.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ee1225353de32ae09354d8ac1b3360790c22e12dec63512704af8307d8fb5c5
|
|
BLAKE2b-256 checksum How to use checksums |
5062ff6aef0aea494ea7deb37508f84a1fde5d88c5302626810724a8e157000d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / geoipsets-2.4.1-py3-none-any.whl
| Download URL | geoipsets-2.4.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25ac45a9ed557e7f03e67dc5fd312d503987a593ea122bcc25225ec13b892ee3
|
|
BLAKE2b-256 checksum How to use checksums |
75245e701821b3a381726accf47b8a76ca20db39d241511be8a8a6582c0d4253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|