A invocação da CLI utiliza o padrão do pacote manage.py, que é:
4) Create a virtual environment
```bash
```bash
$ python manage.py [commando] [argumentos posicionais] [argumentos opcionais com valor]
$ virtualenv env
```
```
Os comandos já implementados são:
5) Start the virtual environment
* create: Cria a tabela conforme definido no protocolo de mapeamento.
5a) On Linux/macOS
```bash
```bash
$ python manage.py create <nome da tabela>
$ source env/bin/activate
```
```
O único argumento usado é o nome da tabela. O script procurará por um protocolo de
5b) On Windows (with administrator privilleges)
mapeamento com o mesmo nome para a busca do esquema das colunas.
```cmd
$ .\env\Scripts/activate
```
* insert: insere um arquivo de dados em formato CSV ou similar em uma tabela existente.
6) Install dependencies
```bash
```bash
$ python manage.py insert <caminho para o arquivo> <nome da tabela> <ano> [--sep separador] [--null valor_nulo]
$ pip install-r requirements.txt
```
```
O caminho para o arquivo deve ser absoluto. A tabela utilizada deve existir e estar
## Interface de linha de comando ##
sincronizada com o protocolo de mapeamento correspondente. O separador padrão utilizado
é ponto e vírgula (';'); caso outros separadores sejam utilizados pelo arquivo fonte,
devem ser especificados com --sep (por exemplo --sep \\| para pipe). O valor nulo padrão
é string vazia. Caso outro valor seja usado, deve ser especificado com --null.
* drop: derruba uma tabela do banco de dados.
The CLI (Command Line Interface) uses the standart of the manage.py package, which means that to invoke a command you should use the following pattern:
<table_name>: The name of the table where the file will be inserted
<year>: The column of the mapping protocol that the HOTMapper should use to insert data
[--sep separator]: The custom separtor of the CSV. To change it you should just replace 'separator' with the token your file uses
[--null null_value]: Define what will replace the null value. Replace the 'null_value' with what you wish to do.
```
* drop: Delete a table from the database
```bash
$ python manage.py drop <table_name>
```
**NOTICE:** The command does not take care of foreign keys that points to the table that are being deleted. Therefore, the database can produce errors.
* remap: syncronize a table with the mapping protocol.
```bash
$ python manage.py remap <table_name>
```
You should use this command everytime a mapping protocol is updated.
The remap allows the creation of new columns, the drop of existent columns, the renaming of columns and the change of type of columns. Be aware that the bigger the table the bigger the usegae of RAM memory.
* generate_pairing_report: generate reports to compare data from diferent years.