Skip to content

Commit f20a1c9

Browse files
authored
feat: include a python API to dados.gov.br API (#241)
* feat: include a python API to dados.gov.br API * refactor: refactor pysus structure BREAKING CHANGE: version 2.0.0 * remove circular imports * move individual database files to databases.py * normalize FileDescription to prepare for ducklake implementation * start building the dadosgov models to extract & describe the files within the datasets * BREAKING CHANGE: refactor local data files; implement groups for pysus dep; async everything * refactor(ducklake): implement abstract classes on the ducklake api classes * refactor(ducklake): implement abstract classes on the ducklake api classes * refactor(ftp): implement base models to ftp api * finish implementing it on all ftp databases * include some tests * update tqdm * implement interfaces on dadosgov modules * create a PySUS orchestrator that will be a bridge between remote clients and local files * clean package/prepare to v2 release; start refining tui * restric dependency import error only to DBC * start testing the programatically upload of the files on s3 * fix all the mypy linting errors * include more tests now that catalog.db is filled * fix tests
1 parent 469548d commit f20a1c9

131 files changed

Lines changed: 7791 additions & 54829 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-package.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,22 @@ jobs:
3131
auto-update-conda: true
3232
conda-solver: libmamba
3333

34-
- name: Run jupyterlab with PySUS
35-
run: |
36-
make run-jupyter-pysus
34+
# - name: Run jupyterlab with PySUS
35+
# run: |
36+
# make run-jupyter-pysus
3737
# make test-jupyter-pysus ## takes too long
3838

3939
- name: Linting & Tests
4040
run: |
41-
export CI=1
42-
poetry install
41+
pip install poetry poetry-plugin-export
42+
43+
poetry config virtualenvs.create false
44+
45+
poetry export --with dev --extras dbc --format requirements.txt --output reqs.txt --without-hashes
46+
47+
pip install -r reqs.txt
48+
pip install -e ".[dbc]"
49+
4350
pre-commit run --all-files
51+
4452
make test-pysus

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ dmypy.json
179179

180180
# pytype static type analyzer
181181
.pytype/
182+
.pylintrc
182183

183184
# Cython debug symbols
184185
cython_debug/
@@ -189,3 +190,4 @@ cython_debug/
189190
# and can be added to the global gitignore or merged into this file. For a more nuclear
190191
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
191192
.idea/
193+
pyrightconfig.json

.pre-commit-config.yaml

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,57 @@ default_stages: [commit, push]
22

33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.1.0
5+
rev: v4.5.0
66
hooks:
7+
- id: trailing-whitespace
78
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-ast
812

9-
- repo: local
13+
- repo: https://github.com/psf/black
14+
rev: 24.2.0
1015
hooks:
11-
- entry: black
12-
id: black
13-
name: black
14-
exclude: |
15-
(?x)(
16-
docs
17-
)
18-
files: ""
19-
language: system
20-
pass_filenames: true
21-
types:
22-
- python
23-
- file
24-
- python
16+
- id: black
17+
args: [--line-length=80]
18+
exclude: ^docs/
2519

26-
- entry: flake8
27-
exclude: ^$
28-
files: ""
29-
id: flake8
30-
language: python
31-
name: flake8
32-
pass_filenames: true
33-
types:
34-
- python
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.13.2
22+
hooks:
23+
- id: isort
24+
args: [--profile=black, --line-length=80]
25+
exclude: ^.*/js/.*$
26+
27+
- repo: https://github.com/pycqa/flake8
28+
rev: 7.0.0
29+
hooks:
30+
- id: flake8
31+
args: [--max-line-length=80, --extend-ignore=E203]
32+
additional_dependencies: [
33+
'flake8-blind-except',
34+
'flake8-bugbear',
35+
'flake8-comprehensions',
36+
'flake8-implicit-str-concat',
37+
'pydocstyle>=6.3.0',
38+
]
3539

36-
- entry: isort
37-
exclude: "^.*/js/.*$"
38-
files: ""
39-
id: isort
40-
language: python
41-
name: isort
42-
pass_filenames: true
43-
types:
44-
- python
40+
- repo: https://github.com/pre-commit/mirrors-mypy
41+
rev: v1.8.0
42+
hooks:
43+
- id: mypy
44+
additional_dependencies: [
45+
'types-python-dateutil',
46+
'types-requests',
47+
'types-setuptools',
48+
'pandas-stubs',
49+
'pydantic>=2.0.0',
50+
]
51+
args: [--ignore-missing-imports, --explicit-package-bases]
52+
exclude: ^docs/
53+
54+
- repo: https://github.com/asottile/pyupgrade
55+
rev: v3.15.0
56+
hooks:
57+
- id: pyupgrade
58+
args: [--py310-plus]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ First, clone the Pysus repository:
5454

5555
```bash
5656
git clone https://github.com/AlertaDengue/PySUS.git
57-
```
57+
```
5858

5959
then from within the PySUS directory build the container
6060

conda/dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ dependencies:
77
- python>=3.10,<3.14
88
- jupyter
99
- make
10-
- poetry
1110
- pip

condarecipe/pysus/meta.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32
#
43
# PySUS documentation build configuration file, created by
54
# sphinx-quickstart on Thu Aug 25 10:37:19 2016.

0 commit comments

Comments
 (0)