Skip to main content

Cálculo de deuda tributaria en Bolivia (MV, interés, sanción) con UFV.

Project description

Librería para Cálculo de Deuda Tributaria en Bolivia

Esta librería permite calcular la deuda tributaria de un contribuyente considerando:

  • Tributo Omitido (TO)
  • Mantenimiento de Valor (MV) (ajuste por UFV)
  • Interes (I)
  • Sancion (S)

Además, se conecta a la API del Banco Central de Bolivia (BCB) para obtener los valores de la UFV y calcular la actualización de la deuda.


Estructura del Proyecto

impuestos_package/
├─ pyproject.toml
├─ README.md
├─ LICENSE
├─ CONTRIBUTING.md
├─ src/
│  └─ impuestos_package/
│     ├─ __init__.py
│     ├─ calculadora.py
│     ├─ mv.py
│     ├─ interes.py
│     ├─ sancion.py
│     └─ ufv.py
├─ tests/
│  ├─ test_calculadora.py
│  ├─ test_integracion.py
│  ├─ test_interes.py
│  ├─ test_mv.py
│  ├─ test_sancion.py
│  └─ test_ufv.py
└─ examples/
   └─ ejemplo_basico.py

Instalación

  1. Clonar el repositorio

    git clone https://github.com/MarthaGonzalesChumacero/impuestos_package.git
    cd impuestos_package
    
  2. Crear entorno virtual

    python -m venv .venv
    
  3. Activar entorno virtual

    • En Windows (Git Bash / PowerShell):
      source .venv/Scripts/activate
      
    • En Linux/Mac:
      source .venv/bin/activate
      
  4. Instalar en modo editable

    pip install -e . -r requirements_dev.txt
    

Ejemplo de Uso

from impuestos_package.calculadora import CalculadoraDeuda

# Crear instancia
calc = CalculadoraDeuda(
    TO=383  # Total Original
    fecha_inicio = "2018-07-20"
    fecha_fin = "2025-09-15"
    tasa = 18       # 12% anual
    dias = 1461       # días de retraso
    porcentaje = 12 # sanción en %
)

# Calcular deuda
resultado = calc.calcular()

print(" Resultado de la deuda tributaria:")
for k, v in resultado.items():
    print(f"{k}: {v}")

Salida esperada (ejemplo)

 Resultado de la deuda tributaria:
TO: 1000.48
MV: 353.18
I: 45.96
S: 45.96
DT: 882.62

Testing

Este proyecto incluye pruebas unitarias y de integración con pytest.

Ejecutar todos los tests:

pytest -q

Con reporte de cobertura:

pytest --cov=impuestos_package --cov-report=term-missing

Ejemplo de salida:

collected 19 items
19 passed in 0.55s
TOTAL coverage: 95%

Contribuir

  1. Haz un fork del repositorio.
  2. Crea una nueva rama para tu mejora:
    git checkout -b mi-mejora
    
  3. Realiza tus cambios y corre los tests.
  4. Envía un pull request.

Licencia

Este proyecto está bajo la licencia MIT.
Consulta el archivo LICENSE para más detalles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

impuestos_package-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

impuestos_package-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file impuestos_package-0.1.0.tar.gz.

File metadata

  • Download URL: impuestos_package-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for impuestos_package-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ce0ce71d5155e829e324c961ec573a1f530005db3f61a48a6acb09ec4eb92a8
MD5 eb9f75216b4927f4ee19ffcbe78777e0
BLAKE2b-256 839309caa35123ba3999a6460ce667eff0e1bf35d674fc79ae85835227ed558a

See more details on using hashes here.

File details

Details for the file impuestos_package-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for impuestos_package-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7298082290c2d0a2fff558da56c8ce2b0971d6760873e809844b655bbd7c4b9c
MD5 f65c4319cb33c89329ec3b1f04431d89
BLAKE2b-256 a61ff76e0e261da4dbc8521e69cb9c75928e66f9cdc0b95c361a0278732e8384

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page