https://github.com/datasets/un-locode
United Nations Codes for Trade and Transport Locations (UN/LOCODE) and Country Codes
https://github.com/datasets/un-locode
Last synced: about 1 year ago
JSON representation
United Nations Codes for Trade and Transport Locations (UN/LOCODE) and Country Codes
- Host: GitHub
- URL: https://github.com/datasets/un-locode
- Owner: datasets
- Created: 2014-08-11T15:28:13.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T11:28:18.000Z (over 1 year ago)
- Last Synced: 2025-03-28T18:14:58.058Z (about 1 year ago)
- Language: Python
- Homepage: https://datahub.io/core/un-locode
- Size: 26.8 MB
- Stars: 152
- Watchers: 21
- Forks: 58
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The United Nations Code for Trade and Transport Locations is a code list mantained by UNECE, United Nations agency, to facilitate trade.
## Data
Data comes from the [UNECE page](http://www.unece.org/cefact/locode/welcome.html), released at least once a year.
## Preparation
As the original release files have encoding problems, we need to process both the mdb and the csv release.
To build the dataset we use the csv version of the current edition.
Tools needed: [MDBTools](http://mdbtools.sourceforge.net/) and [CSVKit](https://github.com/onyxfish/csvkit).
Download the current edition from [UNECE](https://www.unece.org/cefact/codesfortrade/codes_index.html) and put it into the root directory.
Then execute `bash scripts/prepare_edition_mdb.sh loc{ed}mdb.zip`, where `{ed}` identify the release.
To integrate the data from the csv then run the python file
Prerequisites:
```
pip install pandas titlecase
```
Run:
```
python scripts/integrate.py loc232csv.zip
```
The provided `prepare.py` file would work alone when the original csv file will be fixed upstream.
## License
All data is licensed under the [ODC Public Domain Dedication and Licence (PDDL)](http://opendatacommons.org/licenses/pddl/1-0/).