Skip to main content

alegra-python

alegra-python is an API wrapper for Alegra (accounting software), written in Python

Installing

pip install alegra-python

Usage

from alegra.client import Client
client = Client(email, token)

Get company information (Compañía)

company = client.get_company_info()

Get current user (Usuario)

user = client.get_current_user()

Contacts

- List contacts (Contactos)

contacts = client.list_contacts(order_field=None, order="ASC", limit=None, start=None)
# order options = "ASC" or "DESC"
# Max limit = 30

- Get contact by id

contact = client.get_contact(contact_id, extra_fields=None)
# extra_fields current options are: 'statementLink', 'url' or 'statementLink,url'

- Create Contact (Contacto)

contacto = {
    "address": {"city": "Villavicencio", "address": "Calle 10 #01-10"},
    "internalContacts": [
        {
            "name": "Lina",
            "lastName": "Montoya",
            "email": "prueba4@alegra.com",
        }
    ],
    "name": "Lina Montoya",
    "identification": "1018425711",
    "mobile": "38845555610",
    "seller": 1,
    "priceList": 1,
    "term": 1,
    "email": "lina@montoya.com",
    "type": "client"
}
contact = client.create_contact(contacto)

- List sellers (Vendedores)

vendedores = client.list_sellers()

Inventory

- List items (Items)

items = client.list_items(order_field=None, order="ASC", limit=None, start=None)
# order options = "ASC" or "DESC"
# Max limit = 30

- Create item (Item)

item = {
    "name": "PS5",
    "description": "Play Station 5",
    "reference": "PS5 nuevo",
    "price": 3750000,
    "category": {"id": 5064},
    "inventory": {
        "unit": "unit",
        "unitCost": 40000,
        "negativeSale": False,
        "warehouses": [{"initialQuantity": 4, "id": 1, "minQuantity": 2, "maxQuantity": 10}],
    },
    "tax": 2,
    "type": "product",
    "customFields": [{"id": 1, "value": "BHUJSK888833"}, {"id": 2, "value": 44}, {"id": 3, "value": 44.45}],
    "itemCategory": {"id": 1}
}
item_created = client.create_item(item)

- List item Categories (Categorias de items)

item_categorias = client.list_item_categories()

- List Warehouses (Bodegas)

bodegas = client.list_warehouses()

- List Item Custom Fields (Campos adicionales)

campos = client.list_item_custom_fields()

- List Variant Attributes (Variantes)

atributos_variantes = client.list_variant_attributes()

- List price lists (Lista de precios)

lista_precios = client.list_price_lists()

Invoices

- List invoices (Facturas de venta)

items = client.list_invoices(order_field=None, order="ASC", limit=None, start=None, date=None)
# order options = "ASC" or "DESC"
# Max limit = 30
# Date format YYYY-MM-DD

Terms

- List Terms (Condiciones de pago)

condiciones = client.list_terms()

Taxes

- List Taxes (Impuestos)

impuestos = client.list_taxes()

Accounts

- List Accounts (Cuentas)

cuentas = client.list_accounts(format_acc="tree", type_acc=None)
# format_acc options = "tree" or "plain"
# type_acc options = "income", "expense", "asset", "liability" or "equity"

Metadata

Release files for alegra-python 0.1.3

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

Source distribution (sdist)

Source distribution for alegra-python 0.1.3
File Size Uploaded
alegra_python-0.1.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alegra-python 0.1.3
File Interpreter ABI Platform
alegra_python-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / alegra_python-0.1.3.tar.gz

Download URL alegra_python-0.1.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4f1dbbf595f8e34125e372b859641a1fd54ac34a4b766dc9864e32d85baadfc1
BLAKE2b-256 checksum
How to use checksums
328d5613b3826067b4fca6df0613e1eb36bc5434b88206ea89fb445135c57530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / alegra_python-0.1.3-py3-none-any.whl

Download URL alegra_python-0.1.3-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21319c13739c1cdd10544fc511b39fe46782d7d3ac7fc9fac67ae211c8888077
BLAKE2b-256 checksum
How to use checksums
a1ed4983d9a60ce30884a650fbc6509d877837d5310e4b6b2b844ec3e17dff71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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