Skip to main content

DEPRECATED

Даннная версия импортировщика устаревшая. Актуальный ip2geo здесь: https://github.com/m-messiah/ip2geo

Please, check out: https://github.com/m-messiah/ip2geo for actual version

IpGeoBase importer

https://img.shields.io/pypi/v/ipgeobase-importer.svg?style=flat-square https://img.shields.io/pypi/dm/ipgeobase-importer.svg?style=flat-square https://img.shields.io/travis/m-messiah/ipgeobase-importer.svg?style=flat-square

Импортер ipgeobase базы русских городов в файлы, понятные для nginx geoip module, с поддержкой кодов регионов РФ.

Принцип

  1. Скачивает geo_files.zip с сайта ipgeobase.ru

  2. Конвертирует базу в два файла:

    • city.txt, вида: <start_ip>-<end_ip> base64(<city_name>);

    • region.txt, вида: <start_ip>-<end_ip> <region_code>; (01-99)

  3. Скачивает списки TOR с torproject и blutmagie.de

  4. Создает tor.txt, вида: <start_ip>-<end_ip> 1;

Установка

pip install ipgeobase-importer

Запуск

ipgeobase-importer <output_dir>

Nginx

geo $region {
    ranges;
    include geo/region.txt;
}

geo $city {
    ranges;
    include geo/city.txt;
}

geo $is_tor {
    ranges;
    default 0;
    include geo/tor.txt;
}

MaxMind geo importer

Скрипт импорта базы MaxMind в map для nginx (спасибо @ilnurkhal)

Требует Python3, requests и iptools.

Формат запуска:

ip-maxmind <lang> ipv<ipver> <filename> [filters]

Где:

  • lang - язык, которым будут записаны названия городов (как они указаны в MaxMind)

  • ipver - версия IP для nginx (4 или 6)

  • filename - путь до файла вывода

  • filters - фильтры для базы вывода. Могут быть:

    • include <COUNTRY_CODE> [<COUNTRY_CODE>…] - выводить города только из указанных стран.

    • exclude <COUNTRY_CODE> [<COUNTRY_CODE>…] - выводить города, не из указанных стран.

    • или не быть вообще, тогда вывод для всех стран.

Metadata

Release files for ipgeobase-importer 1.6.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 ipgeobase-importer 1.6.3
File Size Uploaded Provenance Actions
ipgeobase-importer-1.6.3.tar.gz 6.6 kB Without provenance Details for ipgeobase-importer-1.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ipgeobase-importer 1.6.3
File Interpreter ABI Platform Actions
ipgeobase_importer-1.6.3-py3-none-any.whl Python 3 none any Details for ipgeobase_importer-1.6.3-py3-none-any.whl

Total release size: 16.0 kB

Release files / ipgeobase-importer-1.6.3.tar.gz

Download URL ipgeobase-importer-1.6.3.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b9239c0e2e557eeb9f8316f092da3dd7210b44242f444b1eb144ee08a6393bff
BLAKE2b-256 checksum
How to use checksums
2d0164e38d19e0543dce69e8e4ddc33777c21bffd4bc0c44d68935271159169b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ipgeobase_importer-1.6.3-py3-none-any.whl

Download URL ipgeobase_importer-1.6.3-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3581a55a8865547fc250bd55808f97045c801f30268fd456b4e3f777b67e311
BLAKE2b-256 checksum
How to use checksums
484e678b19b9a72971e8d961ea22e92bf0516b7779b084c484cd2a4ec3300c5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ipgeobase-importer 1.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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