Metadata-Version: 2.1
Name: comexdown
Version: 1.0
Summary: A little utility to download Brazil's foreign trade data
Home-page: https://github.com/dkkomesu/comexdown
Author: Daniel K. Komesu
Author-email: danielkomesu@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Utilities
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# comexdown: Brazil's foreign trade data downloader

This package contains functions to download brazilian foreign trade data
published by [MinistÃ©rio da Economia(ME)/Secretaria de ComÃ©rcio Exterior (SCE)][1].

## Installation

```sh
git clone https://github.com/dkkomesu/comexdown.git
cd comexdown
pip setup.py install
```

## Usage

```python
import 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")
```

## Command line tool

Download data on Brazilian foreign trade transactions (Exports / Imports).

You can specify a range of years to download at once.

```
comexdown download trade 2008:2019 -o "./DATA"
```

Download code tables.

```shell
comexdown download code all  # Download all related code files
comexdown download code uf   # Download only the UF.csv file
comexdown download ncm_cgce  # Download only the NCM_CGCE.csv file
comexdown download nbm_ncm   # Download only the NBM_NCM.csv file
```

[1]: http://www.mdic.gov.br/index.php/comercio-exterior/estatisticas-de-comercio-exterior/base-de-dados-do-comercio-exterior-brasileiro-arquivos-para-download


