prometeo.dian

API Client

class prometeo.dian.client.DianAPIClient(api_key, environment)[source]

API Client for DIAN API

login(document_type, document, password, nit=None)[source]

Log in to DIAN

Parameters
  • document_type (DocumentType) – The type of document for the document argument.

  • document (str) – The document of the person

  • password (str) – The password used to log in

  • nit (str) – The NIT of the company (used only when logging in as a company)

Return type

Session

session_class

alias of Session

class prometeo.dian.client.Session(client, status, session_key)[source]
get_balances()[source]

Get balances.

Return type

list of Balance

get_company_info()[source]

Get information about the company or person (form 001).

Return type

CompanyInfo

get_numeration(type, date_start, date_end)[source]

Get bill numeration (form 1876)

Parameters
  • type (NumerationType) – The type of numeration request to get

  • date_start (datetime) – Start date to filter

  • date_end (datetime) – End date to filter

Return type

List of Numeration

get_rent_declaration(year)[source]

Get rent declaration information (form 110 for companies and 210 for persons)

Parameters

year (int) – Year of the declaration

Return type

RentDeclaration

get_retentions(year, period)[source]

Get retentions information (form 350)

Parameters
  • year (int) – Year of the retention

  • period (int) – Period of the retention

Return type

List of Retentions

get_vat_declaration(year, periodicity, period)[source]

Get VAT declaration information (form 300)

Parameters
  • year (int) – Year of the declaration

  • periodicity (Periodicity) – Periodicity, either quarterly or bimonthly

  • period (int) – Period of the declaration

Return type

VATDeclaration

Enums

class prometeo.dian.client.NumerationType[source]

An enumeration.

Authorization = 'authorization'
Habilitation = 'habilitation'
Inhabilitation = 'inhabilitation'
class prometeo.dian.client.Periodicity[source]

An enumeration.

BIMONTHLY = 'b'
QUARTERLY = 'q'
class prometeo.dian.client.QuarterlyPeriod[source]

An enumeration.

JANUARY_APRIL = 1
MAY_AUGUST = 2
SEPTEMBER_DECEMBER = 3
class prometeo.dian.client.BimonthlyPeriod[source]

An enumeration.

JANUARY_FEBRUARY = 1
JULY_AUGUST = 4
MARCH_APRIL = 2
MAY_JUNE = 3
NOVEMBER_DECEMBER = 6
SEPTEMBER_OCTOBER = 5
class prometeo.dian.client.MonthlyPeriod[source]

An enumeration.

APRIL = 4
AUGUST = 8
DECEMBER = 12
FEBRUARY = 2
JANUARY = 1
JULY = 7
JUNE = 6
MARCH = 3
MAY = 5
NOVEMBER = 11
OCTOBER = 10
SEPTEMBER = 9
class prometeo.dian.client.DocumentType[source]

Document types used for DianAPIClient.login()

CARNE_DIPLOMATICO = '46'
CEDULA_CIUDADANIA = '13'
CEDULA_EXTRANJERIA = '22'
CERTIFICADO_REGISTRADURIA = '14'
DOCUMENTO_IDENTIFICACION_EXTRANJERO = '42'
DOCUMENTO_IDENTIFICACION_EXTRANJERO_PERSONA_JURIDICA = '44'
PASAPORTE = '41'
SIN_IDENTIFICACION_EXTRANJERO = '43'
TARJETA_EXTRANJERIA = '21'
TARJETA_IDENTIDAD = '12'

Models

class prometeo.dian.models.Accountant(document, start_date, name, professional_card)
property document

Alias for field number 0

property name

Alias for field number 2

property professional_card

Alias for field number 3

property start_date

Alias for field number 1

class prometeo.dian.models.Balance(type, amount, value)
property amount

Alias for field number 1

property type

Alias for field number 0

property value

Alias for field number 2

class prometeo.dian.models.CapitalComposition(national, national_private, national_public, foreign, foreign_private, foreign_public)
property foreign

Alias for field number 3

property foreign_private

Alias for field number 4

property foreign_public

Alias for field number 5

property national

Alias for field number 0

property national_private

Alias for field number 1

property national_public

Alias for field number 2

class prometeo.dian.models.CompanyInfo(accountant, capital_composition, reason, pdf_url, pdf, location, name, constitution_date, representation, members)
property accountant

Alias for field number 0

property capital_composition

Alias for field number 1

property constitution_date

Alias for field number 7

property location

Alias for field number 5

property members

Alias for field number 9

property name

Alias for field number 6

property pdf

Alias for field number 4

property pdf_url

Alias for field number 3

property reason

Alias for field number 2

property representation

Alias for field number 8

class prometeo.dian.models.Field(name, number, value)
property name

Alias for field number 0

property number

Alias for field number 1

property value

Alias for field number 2

class prometeo.dian.models.Location(country, city, phone1, phone2, department, address, email)
property address

Alias for field number 5

property city

Alias for field number 1

property country

Alias for field number 0

property department

Alias for field number 4

property email

Alias for field number 6

property phone1

Alias for field number 2

property phone2

Alias for field number 3

class prometeo.dian.models.Member(document_type, document, nationality, name, start_date)
property document

Alias for field number 1

property document_type

Alias for field number 0

property name

Alias for field number 3

property nationality

Alias for field number 2

property start_date

Alias for field number 4

class prometeo.dian.models.Name(first_surname, second_surname, first_name, other_names)
property first_name

Alias for field number 2

property first_surname

Alias for field number 0

property other_names

Alias for field number 3

property second_surname

Alias for field number 1

class prometeo.dian.models.Numeration(nit, dv, name, reason, address, country, department, municipality, ranges, pdf_url, pdf_available)
property address

Alias for field number 4

property country

Alias for field number 5

property department

Alias for field number 6

property dv

Alias for field number 1

property municipality

Alias for field number 7

property name

Alias for field number 2

property nit

Alias for field number 0

property pdf_available

Alias for field number 10

property pdf_url

Alias for field number 9

property ranges

Alias for field number 8

property reason

Alias for field number 3

prometeo.dian.models.NumerationRange

alias of prometeo.dian.models.Range

class prometeo.dian.models.RentDeclaration(pdf_url, pdf, fields, year, form_number, nit, dv, name, reason, direction_code, economic_activity, correction_code, previous_form)
property correction_code

Alias for field number 11

property direction_code

Alias for field number 9

property dv

Alias for field number 6

property economic_activity

Alias for field number 10

property fields

Alias for field number 2

property form_number

Alias for field number 4

property name

Alias for field number 7

property nit

Alias for field number 5

property pdf

Alias for field number 1

property pdf_url

Alias for field number 0

property previous_form

Alias for field number 12

property reason

Alias for field number 8

property year

Alias for field number 3

class prometeo.dian.models.Representative(document, document_type, name, representation_type, start_date)
property document

Alias for field number 0

property document_type

Alias for field number 1

property name

Alias for field number 2

property representation_type

Alias for field number 3

property start_date

Alias for field number 4

class prometeo.dian.models.Retentions(pdf_url, pdf, fields, year, period, form_number, nit, reason, direction_code)
property direction_code

Alias for field number 8

property fields

Alias for field number 2

property form_number

Alias for field number 5

property nit

Alias for field number 6

property pdf

Alias for field number 1

property pdf_url

Alias for field number 0

property period

Alias for field number 4

property reason

Alias for field number 7

property year

Alias for field number 3

class prometeo.dian.models.VATDeclaration(pdf_url, pdf, fields, year, period, form_number, nit, dv, name, reason, direction_code, correction_code, previous_form)
property correction_code

Alias for field number 11

property direction_code

Alias for field number 10

property dv

Alias for field number 7

property fields

Alias for field number 2

property form_number

Alias for field number 5

property name

Alias for field number 8

property nit

Alias for field number 6

property pdf

Alias for field number 1

property pdf_url

Alias for field number 0

property period

Alias for field number 4

property previous_form

Alias for field number 12

property reason

Alias for field number 9

property year

Alias for field number 3