This package contains functions to download brazilian foreign trade data published by Ministerio da Economia(ME)/Secretaria de Comercio Exterior (SCE).
comexdown package is available on PyPI, so just use pip!
pip install comexdownimport comexdown
# Download main NCM table in the directory ./DATA
comexdown.ncm(table="ncm", path="./DATA")
# Download 2019 exports data file in the directory ./DATA
comexdown.exp(year=2019, path="./DATA")Download data on Brazilian foreign trade transactions (Exports / Imports).
You can specify a range of years to download at once.
comexdown trade 2008:2019 -o "./DATA"
Download code tables.
comexdown tables # Download all related code files- Trade data:
- exp
- imp
- exp-mun
- imp-mun
- exp-nbm
- imp-nbm
- Unique trade data files:
- exp-completa
- imp-completa
- exp-mun-completa
- imp-mun-completa
- Trade validation data:
- exp-validacao
- imp-validacao
- exp-mun-validacao
- imp-mun-validacao
- Trade REPETRO:
- exp-repetro
- imp-repetro
- Auxiliary tables:
- ncm
- sh
- cuci
- cgce
- isic
- siit
- fat-agreg
- unidade
- ppi
- ppe
- grupo
- pais
- pais-bloco
- uf
- uf-mun
- via
- urf
- isic-cuci
- nbm
- ncm-nbm
Data source: Ministério da Economia/Secretaria de Comércio Exterior
To setup a development environment clone this repository and install the required packages:
git clone https://github.com/dankkom/comexdown.git
cd comexdown
pip install -e .[dev]To run the tests suite, use the following command:
pip install -e .[dev]
pytest tests/