Skip to main content

Add CSV support to your Addok instance.

Project description

# Addok plugin add CSV geocoding endpoints

## Install

pip install addok-csv

## API

This plugin adds the following endpoints:

### /search/csv/

Batch geocode a csv file.

#### Parameters

  • data: the CSV file to be processed

  • columns (multiple): the columns, ordered, to be used for geocoding; if no column is given, all columns will be used

  • encoding (optional): encoding of the file (you can also specify a charset in the file mimetype), such as ‘utf-8’ or ‘iso-8859-1’ (default to ‘utf-8-sig’)

  • delimiter (optional): CSV delimiter (, or ;); if not given, we try to guess

  • with_bom: if true, and if the encoding if utf-8, the returned CSV will contain a BOM (for Excel users…)

  • lat and lon parameters (optionals), like filters, can be used to define columns names that contain latitude and longitude values, for adding a preference center in the geocoding of each row

#### Examples

http -f POST http://localhost:7878/search/csv/ columns=’voie’ columns=’ville’ data@path/to/file.csv http -f POST http://localhost:7878/search/csv/ columns=’rue’ postcode=’code postal’ data@path/to/file.csv

### /reverse/csv/

Batch reverse geocode a csv file.

#### Parameters

  • data: the CSV file to be processed; must contain columns latitude (or lat) and longitude (or lon or lng)

  • encoding (optional): encoding of the file (you can also specify a charset in the file mimetype), such as ‘utf-8’ or ‘iso-8859-1’ (default to ‘utf-8-sig’)

  • delimiter (optional): CSV delimiter (, or ;); if not given, we try to guess

Any filter can be passed as key=value querystring, where key is the filter name and value is the column name containing the filter value for each row. For example, if there is a column “code_insee” and we want to use it for “citycode” filtering, we would pass citycode=code_insee as query string parameter.

## Config

  • CSV_ENCODING: default encoding to open CSV files (default: ‘utf-8-sig’)

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

addok-csv-1.0.0rc2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

addok_csv-1.0.0rc2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file addok-csv-1.0.0rc2.tar.gz.

File metadata

File hashes

Hashes for addok-csv-1.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 9599d3e454105ca8731f0dcb638670dcaa0bbe1a0ddef7d8006bb45f9c9c3f35
MD5 414889a7bc441ce83c400ce8aadfbddf
BLAKE2b-256 d021787cc762b119d2af0ad1fd3b8bf3f89e00c863767cd591c0691cd9b24431

See more details on using hashes here.

File details

Details for the file addok_csv-1.0.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for addok_csv-1.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d97266fd03420bc04f11d7b83ff4c5c9a082644ac3f6b7339e288c9e2b1175
MD5 a8eb3f8f77c8bbefc7df28a387f255d9
BLAKE2b-256 4f756d5484089f0c14b44ad58f4b20c8e45db08fc0293c876f5ad18c0e9f2d0b

See more details on using hashes here.

Supported by

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