Skip to main content

radiankore

Librería Python de Deikore SAS para consultar servicios de DIAN y eventos RADIAN con certificado digital PFX/P12. Python >=3.13, API síncrona y licencia MIT.

Estado
Documentación Read the Docs
Calidad y pruebas CI
Paquete PyPI Python MIT

Instalación

pip install radiankore
# Con uv:
uv add radiankore

Si necesitas compilar las dependencias de firma, consulta la guía de instalación.

Métodos disponibles

Método Operación DIAN Resultado
get_numbering_range(account_code=..., account_code_t=..., software_code=...) GetNumberingRange Rangos de numeración autorizados y clave técnica
get_exchange_emails() GetExchangeEmails Registros del CSV del directorio de correos
get_status(track_id) GetStatus Estado de validación y payloads decodificados
get_invoice_events(cufe) GetStatusEvent Eventos asociados a una factura
get_acquirer(identification_type=..., identification_number=...) GetAcquirer Nombre y correo del adquiriente
get_document_info(uuid) GetDocumentInfo Información, estados, eventos y notas del documento
get_reference_notes(track_id) GetReferenceNotes Notas referenciadas y motivos por línea
get_xml_by_document_key(document_key) GetXmlByDocumentKey XML original del documento como bytes
prepare_radian_event(event=..., software=...) Local XML firmado, CUDE y ZIP de los eventos 030–051
send_radian_event(prepared) SendEventUpdateStatus Emisión del evento RADIAN preparado

Emite los eventos 030–051; no genera facturas. Los resultados utilizan dataclasses inmutables y campos opcionales cuando corresponda.

Consultar eventos

from radiankore import DianClient, Environment

client = DianClient(
    certificate_path="/ruta/segura/certificado.pfx",
    password="password-de-ejemplo",
    environment=Environment.PRODUCTION,
)

result = client.get_invoice_events("CUFE-DE-LA-FACTURA")
for event in result.events:
    print(event.id, event.code, event.description, event.date, event.time)

Emitir eventos de factura

Construye un InvoiceResponseEvent y reutiliza RadianSoftware. La guía de emisión incluye ejemplos de acuse 030, reclamo 031, recibo 032 y aceptaciones 033/034.

prepared = client.prepare_radian_event(event=event, software=software)
print(prepared.code, prepared.cude)
result = client.send_radian_event(prepared)

La preparación es local. El consumidor aporta las declaraciones y el envío es explícito, con el mismo ambiente del artefacto preparado.

Emitir eventos RADIAN

prepare_radian_event(event=..., software=...) y send_radian_event(prepared) cubren aval 035, inscripción 036, endosos 037–040/047, limitaciones 041/042, terminación de mandato 044, pagos 045/046, protesto 048 y derechos económicos 049–051. La guía con ejemplos por familia detalla modelos, variantes y validaciones. La misma pareja de métodos prepara y envía los eventos de factura 030–034 y el mandato 043.

Preparar y enviar un mandato

Construye un MandateEvent y un RadianSoftware siguiendo el ejemplo completo. La preparación firma el XML y crea el ZIP en memoria sin contactar DIAN:

prepared = client.prepare_radian_event(event=event, software=software)
print(prepared.cude)
# Envío explícito del mismo ZIP preparado:
result = client.send_radian_event(prepared)
if result is not None:
    print(result.is_valid, result.status_code, result.messages)

Producción es el ambiente predeterminado; usa Environment.HABILITATION para habilitación. Cada consulta o emisión cierra sus conexiones automáticamente y puedes reutilizar el cliente sin volver a cargar el certificado.

Otras consultas

from pathlib import Path

from radiankore.catalogs import IdentificationType

emails = client.get_exchange_emails()
if emails is not None and emails.csv is not None:
    for row in emails.csv:
        print(row)

status = client.get_status("CUFE-O-TRACK-ID")
if status is not None:
    print(status.is_valid, status.status_code, status.messages)

acquirer = client.get_acquirer(
    identification_type=IdentificationType.NIT,
    identification_number="000123456",
)
if acquirer is not None:
    print(acquirer.name, acquirer.email)

document = client.get_document_info("UUID-DEL-DOCUMENTO")
if document is not None:
    for item in document.documents:
        if item is not None:
            print(item.uuid, item.totals)

notes = client.get_reference_notes("CUFE-O-TRACK-ID")
if notes is not None:
    for note in notes.notes:
        print(note.code, note.description)

xml = client.get_xml_by_document_key("CLAVE-DEL-DOCUMENTO")
if xml is not None and xml.document_xml is not None:
    Path("documento.xml").write_bytes(xml.document_xml)

La documentación completa incluye contratos, modelos, errores y ejemplos por operación. Para contribuir, consulta CONTRIBUTING.

Comprenda actores, condiciones y eventos en la documentación funcional. Para desarrollar la integración y consultar ejemplos de Python, use la documentación técnica.

Clientes reutilizables y material en memoria

Desde 0.6.1 puede usar DianClient.from_pfx() o DianClient.from_certificate(), con reuse_connections=True y cierre mediante with. Consulte Rendimiento y ciclo de vida.

Metadata

Release files for radiankore 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for radiankore 0.6.1
File Size Uploaded Provenance Actions
radiankore-0.6.1.tar.gz 143.2 kB With provenance Details for radiankore-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for radiankore 0.6.1
File Interpreter ABI Platform Actions
radiankore-0.6.1-py3-none-any.whl Python 3 none any Details for radiankore-0.6.1-py3-none-any.whl

Total release size: 249.6 kB

Release files / radiankore-0.6.1.tar.gz

Download URL radiankore-0.6.1.tar.gz
Size 143.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3428a1a77c0c6997b22b7451e76c292f0939fb26c927f5b93ebf3d32cf328587
BLAKE2b-256 checksum
How to use checksums
7bc5d17927eefa991c38f74a62b6dc93ae7b37167fc1d5c550baa8a644f69259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / radiankore-0.6.1-py3-none-any.whl

Download URL radiankore-0.6.1-py3-none-any.whl
Size 106.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e0b25333a59a5e06daaa2e08521edfd0d259d76ed6e35317c703375c978eac
BLAKE2b-256 checksum
How to use checksums
aeca0bedf4ca92df2692ce60ae3f5e112fa65a3beba5e5229284ad5279e63da2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for radiankore 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for radiankore-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page