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).
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
charsetin 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…)
latandlonparameters (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(orlat) andlongitude(orlonorlng) - encoding (optional): encoding of the file (you can also specify a
charsetin 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')
- CSV_EXTRA_FIELDS: list of field names to be added to the results rows
(default: names of the registered
FIELDS)
Release files for addok-csv 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| addok-csv-1.1.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| addok_csv-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / addok-csv-1.1.0.tar.gz
| Download URL | addok-csv-1.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15c63f77a9f26696134a81e9c1f98aed6956c608931cec26a334f277f2c85df6
|
|
BLAKE2b-256 checksum How to use checksums |
fa1cc1e91956adb9cd2d06c0b212a6c2caba0829143456eda1d7304123943bd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / addok_csv-1.1.0-py3-none-any.whl
| Download URL | addok_csv-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c45a4fd6ee6e70d293d3b4056a300907e23b1309bcd0558db75805fa3eae4d83
|
|
BLAKE2b-256 checksum How to use checksums |
5734529bf4cf87d9e223834652efb479d82275a82f26ed5225376f01c89e914f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|