Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pt_regions/bd_database.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

"""
This module uses the database of Banco de Portugal to retrieve the NIFs of
municipalities.
Expand All @@ -8,7 +10,7 @@
which was:
1. exported to TSV via "save as..." "UTF-16 Unicode Text" in excel.
2. converted to utf-8 via a text program.
3. saved in `contracts/DGAL_data/bp_list.tsv`
3. saved in `raw_data/bp_list.tsv`
"""
import csv
import datetime
Expand Down
14 changes: 8 additions & 6 deletions pt_regions/caop_database.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
"""
This module converts 3 TSV files of districts, municipalities and counties into
a dictionaries. Use `get_districts`, `get_municipalities`, `get_counties`.
This module converts 3 TSV files of districts, municipalities and counties
into dictionaries. Use `get_districts`, `get_municipalities`, `get_counties`.

This module uses the database from
http://www.dgterritorio.pt/cartografia_e_geodesia/cartografia/carta_administrativa_oficial_de_portugal__caop_/caop_em_vigor/
specifically from the excel file
http://www.dgterritorio.pt/ficheiros/cadastro/caop/caop_download/caop_2014_0/areasfregmundistcaop2014_3

which:
1. each sheet was exported to TSV via "save as..." "UTF-16 Unicode Text" in excel.
1. each sheet was exported to TSV via "save as..." "UTF-16 Unicode Text" in
excel.
2. each sheet was converted to utf-8 via a text program.
3. each sheet was saved in
* `Areas_distritos_CAOP2014_utf8.txt`
* `Areas_municipios_CAOP2014_utf8.txt`
* `Areas_freguesias_CAOP2014_utf8.txt`
* `raw_data/Areas_distritos_CAOP2014_utf8.txt`
* `raw_data/Areas_municipios_CAOP2014_utf8.txt`
* `raw_data/Areas_freguesias_CAOP2014_utf8.txt`

"""
import csv

Expand Down
4 changes: 3 additions & 1 deletion pt_regions/dgal_database.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

"""
This module contains 1 function, `get_counties`, that returns all counties
with respective NIFs.
Expand All @@ -8,7 +10,7 @@
which was:
1. exported to TSV via "save as..." "UTF-16 Unicode Text" in excel.
2. converted to utf-8 via a text program.
3. saved in `contracts/DGAL_data/DGAL_Freguesias_2014_V7_utf8.txt`
3. saved in `raw_data/DGAL_Freguesias_2014_V7_utf8.txt`
"""
import csv

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from setuptools import setup, find_packages
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(name='pt-regions',
version='1.0.0',
Expand Down