Add CSV support to your Addok instance.
Project description
# 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’)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file addok-csv-1.0.0.tar.gz
.
File metadata
- Download URL: addok-csv-1.0.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb3885b09fe2cc7bb20aff3f5c3b0e68d7b32919b6b90424bdaec3566a7c9aee |
|
MD5 | 5d2e81438a54cce54a6cf3113d21043d |
|
BLAKE2b-256 | 43ca9ce641c802382d53075137050c26df0e74171bb7960ded29f0034fb8c55c |
File details
Details for the file addok_csv-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: addok_csv-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d05669c002eef41e13653bb07213cd49157656faa235ce9a6ba812df3ed891c |
|
MD5 | b87d642b4ffbac4ceceae73ddee84785 |
|
BLAKE2b-256 | f429b5c59b675d98d21b8785dee90fb6006beb5feda099d73d89a1f272012639 |