Skip to main content

Miltitool for convert data from https://memopzk.org to Google Maps

Project description

kgr

Multitool for converting data from memopzk.org to Google Maps

Description

This project provides a tool for converting data from the format used on memopzk.org to a format supported by Google Maps.

Installation

You can install kgr using pip:

pip install kgr

Contribution

We welcome contributions from the community! Please create pull requests and report bugs via the Issues system.

License

This project is licensed under the MIT license. For details, see the LICENSE file.

Requirements

  • Python 3
  • Dependencies specified in project.toml

Usage Examples

View the program version:

python -m kgr -v

View the help:

python -m kgr -h
python -m kgr prepare -h
python -m kgr geocode -h
python -m kgr convert -h
python -m kgr check -h

Complete Data Processing Workflow:

python -m kgr prepare -i list__76cce2b204_25-05-2024.csv -y -v -e errors.txt
...after filling in the city field...
python -m kgr geocode -i list__76cce2b204_25-05-2024.csv -y -r -v -e missing.txt
python -m kgr convert -i list__76cce2b204_25-05-2024.csv -s "Список политзаключённых — Мемориал."

Common Options for All Commands

All commands that process input files use the -i option for specifying the input file. To specify the output file, use the -o option or overwrite the input file with -y. When reading input data from a CSV file, the program will try to determine the delimiter character itself, but you can specify it explicitly using the -d option. Similarly, you can specify the encoding of the input file using the -c option, with the default being UTF-8 encoding. The prepare and geocode commands make requests for the necessary information and can take considerable time. To see progress during their execution, you can add the -v or -vv option. If a request cannot be processed, the program will display failed requests, which can be redirected to a file using the -e option. Additionally, each command has its own specific options.

Command Descriptions

Prepare CSV files from memopzk.org

usage: __main__.py prepare [-h] -i INPUT (-y | -o OUTPUT) [-d DELIMITER] [-c ENCODING] [-v] [-q | -e ERROR]

Parse source csv file from https://memopzk.org

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input csv file with data
  -y, --replace         replace input csv file
  -o OUTPUT, --output OUTPUT
                        output csv file
  -d DELIMITER, --delimiter DELIMITER
                        delimiter in the input csv file
  -c ENCODING, --encoding ENCODING
                        encoding of the input csv file
  -v, --verbosity       add progress messages
  -q, --quiet           ignore errors
  -e ERROR, --error ERROR
                        log file for errors

Get Geocodes from OpenStreetMap

usage: __main__.py geocode [-h] -i INPUT (-y | -o OUTPUT) [-r] [-d DELIMITER] [-c ENCODING] [-v] [-q | -e ERROR]

Get geocode from OpenStreetMap

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input csv file with data
  -y, --replace         replace input csv file
  -o OUTPUT, --output OUTPUT
                        output csv file
  -r, --random          randomize geocode for exclude collision
  -d DELIMITER, --delimiter DELIMITER
                        delimiter in the input csv file
  -c ENCODING, --encoding ENCODING
                        encoding of the input csv file
  -v, --verbosity       add progress messages
  -q, --quiet           ignore get geocode errors
  -e ERROR, --error ERROR
                        log file for missing persons

Convert CSV File to KML

usage: __main__.py convert [-h] -i INPUT [-o OUTPUT] [-d DELIMITER] [-c ENCODING] [-s SUFFIX] [-l LAYOUT]

Convertor data from CSV to KML

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input csv file with data
  -o OUTPUT, --output OUTPUT
                        output kml file
  -d DELIMITER, --delimiter DELIMITER
                        delimiter in the input csv file
  -c ENCODING, --encoding ENCODING
                        encoding of the input csv file
  -s SUFFIX, --suffix SUFFIX
                        the phrase added to the description of each person
  -l LAYOUT, --layout LAYOUT
                        the internal name of the xml document and the name of the layer on the map

Get Single Address Geocode

usage: __main__.py check [-h] -a ADDRESS

Check get geocode for single address

options:
  -h, --help            show this help message and exit
  -a ADDRESS, --address ADDRESS
                        input address for check

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kgr-0.3.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kgr-0.3.0-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file kgr-0.3.0.tar.gz.

File metadata

  • Download URL: kgr-0.3.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for kgr-0.3.0.tar.gz
Algorithm Hash digest
SHA256 322daf9210f3bff1b42497f42bf40980cc2f995b823097b406b6fc6b946d4347
MD5 6ea7132b54df81f5c9c2d0800e6dfdb6
BLAKE2b-256 813273e6c6adeedf809553e7705f6d2b79424112c941239b3c2260ac91ba7a77

See more details on using hashes here.

File details

Details for the file kgr-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: kgr-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for kgr-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ba1691d887c682ea88ef6fb39350a314aeeec57102b1ac16e8aee7aeb44c20f8
MD5 6e051aeb8e4bea2f1ccfe54e4f04bc31
BLAKE2b-256 8d4e659d69419c9f9af3d3672766215bd974ff42b25994cca23141fb85250e8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page