Skip to content

mbto/maxmind-geoip2-csv2sql-converter

Repository files navigation

Features:

  • Downloads latest archive GeoLite2-(Country|City)-CSV_%Date%.zip using MaxMind API https://www.maxmind.com/ by free license key
  • Converts files GeoLite2-(Country|City)-Locations-%LocaleCode%.csv, GeoLite2-(Country|City)-Blocks-(IPv4|IPv6).csv to SQL DDL/DML
  • Builds archive maxmind-geoip2-csv2sql.zip with scripts splitted per N megabytes, using template engine (Example: If MySQL server max_allowed_packet parameter is too small - 64 MB by default)
  • Appends emoji country flags 🇦🇩 🇦🇪 🇦🇫 🇦🇬 🇦🇮 🇦🇱 🇦🇲 🇦🇴 🇦🇶 🇦🇷 🇦🇸 🇦🇹 🇦🇺 🇦🇼 🇦🇽 🇦🇿 🇧🇦 🇧🇧 🇧🇩 🇧🇪 🇧🇫 🇧🇬 🇧🇭 🇧🇮 🇧🇯 🇧🇱 🇧🇲 🇧🇳 🇧🇴 🇧🇶 🇧🇷 🇧🇸 🇧🇹 🇧🇻 🇧🇼 🇧🇾...
  • Supports MaxMind edition IDs: GeoLite2-Country-CSV, GeoLite2-City-CSV; IPv4, IPv6; Locations locale codes: en, ru, de, es, fr, ja, pt-BR, zh-CN
  • Provides template-ready configuration files for MySQL 8/PostgreSQL 13/Microsoft SQL Server 2019 and template engine with simple syntax for build DDL/DML. For custom DBMS, you can write a template yourself.
  • Win/Unix distribution

Requirements:

Examples:

Downloads:

Usage:

Compile & Build:

  • Requirements:
    • Gradle 5.4+
  • With tests:
    • gradlew.bat build
  • Without tests:
    • gradlew.bat build -x test