Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

# Addok plugin add CSV geocoding endpoints

## Install

pip install addok-csv

## API

Warning: this plugin will not work when running `addok serve`, you need either gunicorn or uWSGI (see [falcon-multipart issue](https://github.com/yohanboniface/falcon-multipart/issues/1)).

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’)

Release files for addok-csv 1.0.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for addok-csv 1.0.0rc4
File Size Uploaded
addok-csv-1.0.0rc4.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for addok-csv 1.0.0rc4
File Interpreter ABI Platform
addok_csv-1.0.0rc4-py3-none-any.whl Python 3 none any Details

Total release size:12.3 kB

Release files / addok-csv-1.0.0rc4.tar.gz

Download URL addok-csv-1.0.0rc4.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d2dd772ad0bf23df5dfb4f1c4a5efdcce8693e1139df74b0aeca7ef4f7cdd690
BLAKE2b-256 checksum
How to use checksums
c99d2e3c342d386ed2e78e733312774e2672e870aff4e933954734683e5ecb8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / addok_csv-1.0.0rc4-py3-none-any.whl

Download URL addok_csv-1.0.0rc4-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75edf32fa918814939fa429a3e3963f48f163c503d0d4f9060695afc913ed951
BLAKE2b-256 checksum
How to use checksums
af55103fb34e969a3bf508f4c4b8412229bd428b2b1235ce9e59bdebe524cabf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
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