bb_api 0.5.2__tar.gz → 0.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bb_api-0.5.2 → bb_api-0.5.3}/PKG-INFO +1 -1
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api/__init__.py +1 -1
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api/accountability.py +4 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api/common.py +15 -1
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api.egg-info/PKG-INFO +1 -1
- {bb_api-0.5.2 → bb_api-0.5.3}/pyproject.toml +1 -1
- {bb_api-0.5.2 → bb_api-0.5.3}/LICENSE +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/README.md +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api/gestao_agil.py +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api/sia.py +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api.egg-info/SOURCES.txt +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api.egg-info/dependency_links.txt +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api.egg-info/requires.txt +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/bb_api.egg-info/top_level.txt +0 -0
- {bb_api-0.5.2 → bb_api-0.5.3}/setup.cfg +0 -0
|
@@ -761,6 +761,7 @@ class AccountabilityV3RepasseAPI(_AccountabilityV3BaseAPI):
|
|
|
761
761
|
df = common.handle_results(
|
|
762
762
|
extrato,
|
|
763
763
|
main_list="listaLancamentosExtrato",
|
|
764
|
+
keep_header_when_empty=True,
|
|
764
765
|
insertables=[
|
|
765
766
|
"numeroAgenciaRecebedora",
|
|
766
767
|
"digitoVerificadoraContaRecebedora",
|
|
@@ -913,6 +914,7 @@ class AccountabilityV3RepasseAPI(_AccountabilityV3BaseAPI):
|
|
|
913
914
|
return common.handle_results(
|
|
914
915
|
res,
|
|
915
916
|
main_list="listaLancamentos",
|
|
917
|
+
keep_header_when_empty=True,
|
|
916
918
|
insertables=[
|
|
917
919
|
"codigoProgramaGoverno",
|
|
918
920
|
"nomeProgramaGoverno",
|
|
@@ -1773,6 +1775,7 @@ class AccountabilityV3ControleAPI(_AccountabilityV3BaseAPI):
|
|
|
1773
1775
|
df = common.handle_results(
|
|
1774
1776
|
extrato,
|
|
1775
1777
|
main_list="listaLancamentosExtrato",
|
|
1778
|
+
keep_header_when_empty=True,
|
|
1776
1779
|
insertables=[
|
|
1777
1780
|
"numeroAgenciaRecebedora",
|
|
1778
1781
|
"digitoVerificadoraContaRecebedora",
|
|
@@ -1922,6 +1925,7 @@ class AccountabilityV3ControleAPI(_AccountabilityV3BaseAPI):
|
|
|
1922
1925
|
return common.handle_results(
|
|
1923
1926
|
res,
|
|
1924
1927
|
main_list="listaLancamentos",
|
|
1928
|
+
keep_header_when_empty=True,
|
|
1925
1929
|
insertables=[
|
|
1926
1930
|
"codigoProgramaGoverno",
|
|
1927
1931
|
"nomeProgramaGoverno",
|
|
@@ -81,11 +81,25 @@ def handle_results(
|
|
|
81
81
|
insertables: Sequence[str] | None = None,
|
|
82
82
|
explodeables: Sequence[str] | None = None,
|
|
83
83
|
rename_dict: Mapping[str, str] | None = None,
|
|
84
|
+
*,
|
|
85
|
+
keep_header_when_empty: bool = False,
|
|
84
86
|
) -> pd.DataFrame:
|
|
87
|
+
"""Monta o DataFrame da resposta: uma linha por item de ``main_list``.
|
|
88
|
+
|
|
89
|
+
Os campos de ``insertables`` ficam no nível de cima da resposta, fora da
|
|
90
|
+
lista, e são repetidos em todas as linhas.
|
|
91
|
+
|
|
92
|
+
Com ``keep_header_when_empty``, uma lista vazia devolve uma linha só com
|
|
93
|
+
esses campos, em vez de um DataFrame sem linha nenhuma. É o que preserva o
|
|
94
|
+
cabeçalho das respostas em que ele carrega o dado principal, como o
|
|
95
|
+
rendimento do mês nos extratos de aplicação.
|
|
96
|
+
"""
|
|
85
97
|
record = cast("Mapping[str, object]", data)
|
|
86
98
|
|
|
87
99
|
if main_list is not None:
|
|
88
|
-
|
|
100
|
+
itens = cast("list[dict[Hashable, object]]", record.get(main_list) or [])
|
|
101
|
+
so_cabecalho = not itens and keep_header_when_empty
|
|
102
|
+
df = pd.DataFrame(index=[0]) if so_cabecalho else pd.DataFrame(itens)
|
|
89
103
|
else:
|
|
90
104
|
df = pd.DataFrame([dict(record)])
|
|
91
105
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|