Handle accounting and finances in Brazil using Python
Project description
babilonia
Handle accounting and finances in Brazil using Python.
[!NOTE] Check out the documentation website
Quick Gallery
Parsing Bank Statements
Convert CSV files sourced from banks to pandas.DataFrame.
Input (sourced statement from Banco do Brasil)
./extrato_poupanca.csv
"Data","Histórico","Valor",
"01/08/2025","Juros","3,83 C",
"01/08/2025","Reajuste Monetário - BACEN","16,67 C",
"01/08/2025","Juros","47,92 C",
"11/08/2025","Transferência de Crédito","1.000,00 C",
Code block:
from babilonia.accounting import CashFlowBBPP
file_bb = "./extrato_poupanca.csv"
cashflow = CashFlowBBPP()
cashflow.load_data(file_bb)
df = cashflow.parse_data()
print(type(df))
print(df)
Output:
<class 'pandas.core.frame.DataFrame'>
Data Valor Categoria Descricao
2025-08-01 3.83 Juros
2025-08-01 16.67 Reajuste Monetário - BACEN
2025-08-01 47.92 Juros
2025-08-11 1000.00 Transferência de Crédito
Parsing Fiscal Notes (NFSe)
Code block:
import pprint
from babilonia.accounting import NFSe
file_nfse = "./nfse.xml"
nf = NFSe()
nf.load_data(file_nfse)
print(type(nf.data))
pprint.pp(nf.data)
Output:
<class 'dict'>
{'nfse_id': 'NFS43149022227643216000121000000000008025091789495666',
'local_emissao': 'Fortaleza',
'local_prestacao': 'Fortaleza',
'numero_nfse': '80',
'codigo_local_incidencia': '6314902',
'descricao_servico': 'Serviços de pesquisas de qualquer natureza',
'valor_liquido': 3100.0,
'data_processo': '2025-09-01T15:36:35-03:00',
'Date': '2025-09-01',
'Prestador': {'cnpj': '27543216700666',
'nome': 'PRESTADOR LTDA',
'endereco': {'logradouro': 'R DAS ACACIAS',
'numero': '1244',
'bairro': 'CIDADE ALTA',
'cidade': '4314902',
'uf': 'CE',
'cep': '90880480'},
'telefone': '5132692269',
'email': 'PRESTADOR@GMAIL.COM'},
'Tomador': {'cnpj': '07704429000666',
'nif': None,
'nome': 'TOMADOR LTDA',
'endereco': {'logradouro': 'AV BRASIL',
'numero': '666',
'complemento': 'SALA 666 E 666',
'bairro': 'CENTRO HISTORICO',
'cidade': '6314902',
'cep': '34020023'}},
'servico': {'codigo_servico': '020101',
'descricao_servico': 'Serviço de suporte técnico.',
'valor_servico': 6666.0,
'p_tributo_SN': 6.0},
'ValorServico': 6666.0}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
babilonia-1.0.2.tar.gz
(119.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
babilonia-1.0.2-py3-none-any.whl
(57.1 kB
view details)
File details
Details for the file babilonia-1.0.2.tar.gz.
File metadata
- Download URL: babilonia-1.0.2.tar.gz
- Upload date:
- Size: 119.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2732b68f44ca5862422c35d62b386955b341bbf1346555631cf1331d66ecbb6
|
|
| MD5 |
b3578ff622a7f4cfc8012f9e09f9d846
|
|
| BLAKE2b-256 |
85f9bb193c8acea218b7bebad09cf319b48236de120024921a58e191e0020b04
|
File details
Details for the file babilonia-1.0.2-py3-none-any.whl.
File metadata
- Download URL: babilonia-1.0.2-py3-none-any.whl
- Upload date:
- Size: 57.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fba53a733d5d61a1ac3cd9cb3b8b1ab8816d14abb5f16d9b5319c01e3d040b8
|
|
| MD5 |
695d1f0169dc02371c708c8526b06917
|
|
| BLAKE2b-256 |
afb57764db3e1053a7bbca02d8f204c633538a1bae7f40b65cdac4b7638d34e1
|