Module pipelines.rj_smtr.controle_financeiro.tasks
tasks for rj-smtr.controle_financeiro
Functions
def cct_arquivo_retorno_save_redis(redis_key: str, raw_filepath: str)
-
Set control info on Redis
Args
redis_key
:str
- Key on Redis
raw_filepath
:str
- Filepath to raw data
def create_cct_arquivo_retorno_params(redis_key: str, start_date: Optional[str], end_date: Optional[str]) ‑> tuple[dict, list[dict]]
-
Create parameters to get data from cct api's arquivoPublicacao
Args
redis_key
:str
- Redis key to get pending dates
start_date
:str
- Initial data_ordem to filter
end_date
:str
- Final data_ordem to filter
Returns
dict
- headers
list[dict]
- parameters
def get_cct_arquivo_retorno_redis_key(mode: str) ‑> str
-
Gets the key to search and store pending dates on Redis
Args
mode
:str
- dev or prod
Returns
str
- Redis key
def get_raw_cct_arquivo_retorno(headers: dict, params: list[dict], local_filepath: str) ‑> str
-
Get data from cct api arquivoPublicacao
Args
headers
:dict
- Request headers
params
:list[dict]
- List of request query params
local_filepath
:str
- Path to save the data
Returns
str
- filepath to raw data