{"id":19640185,"url":"https://github.com/gearplug/alegra-python","last_synced_at":"2026-05-16T05:35:02.092Z","repository":{"id":65442821,"uuid":"588194863","full_name":"GearPlug/alegra-python","owner":"GearPlug","description":"alegra-python is an API wrapper for Alegra (accounting software), written in Python","archived":false,"fork":false,"pushed_at":"2023-03-27T19:58:17.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-09T18:56:02.387Z","etag":null,"topics":["accounting","accounts","alegra","api","contacts","inventory","invoices","python","requests","taxes","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GearPlug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-12T14:51:59.000Z","updated_at":"2023-10-06T17:21:40.000Z","dependencies_parsed_at":"2025-01-10T10:53:31.213Z","dependency_job_id":null,"html_url":"https://github.com/GearPlug/alegra-python","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"562455720c16b9a76420980fe6517d5fb73cfeb9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Falegra-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Falegra-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Falegra-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Falegra-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GearPlug","download_url":"https://codeload.github.com/GearPlug/alegra-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947652,"owners_count":19883030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accounting","accounts","alegra","api","contacts","inventory","invoices","python","requests","taxes","wrapper"],"created_at":"2024-11-11T14:04:57.016Z","updated_at":"2026-05-16T05:35:01.927Z","avatar_url":"https://github.com/GearPlug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# alegra-python\n![](https://img.shields.io/badge/version-0.1.2-success) ![](https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10%20|%203.11-4B8BBE?logo=python\u0026logoColor=white)  \n\n*alegra-python* is an API wrapper for Alegra (accounting software), written in Python\n\n## Installing\n```python\npip install alegra-python\n```\n## Usage\n```python\nfrom alegra.client import Client\nclient = Client(email, token)\n```\n### Get company information (Compañía)\n```python\ncompany = client.get_company_info()\n```\n### Get current user (Usuario)\n```python\nuser = client.get_current_user()\n```\n### Contacts\n#### - List contacts (Contactos)\n```python\ncontacts = client.list_contacts(order_field=None, order=\"ASC\", limit=None, start=None)\n# order options = \"ASC\" or \"DESC\"\n# Max limit = 30\n```\n#### - Get contact by id\n```python\ncontact = client.get_contact(contact_id, extra_fields=None)\n# extra_fields current options are: 'statementLink', 'url' or 'statementLink,url'\n```\n#### - Create Contact (Contacto)\n```python\ncontacto = {\n    \"address\": {\"city\": \"Villavicencio\", \"address\": \"Calle 10 #01-10\"},\n    \"internalContacts\": [\n        {\n            \"name\": \"Lina\",\n            \"lastName\": \"Montoya\",\n            \"email\": \"prueba4@alegra.com\",\n        }\n    ],\n    \"name\": \"Lina Montoya\",\n    \"identification\": \"1018425711\",\n    \"mobile\": \"38845555610\",\n    \"seller\": 1,\n    \"priceList\": 1,\n    \"term\": 1,\n    \"email\": \"lina@montoya.com\",\n    \"type\": \"client\"\n}\ncontact = client.create_contact(contacto)\n```\n#### - List sellers (Vendedores)\n```python\nvendedores = client.list_sellers()\n```\n### Inventory\n#### - List items (Items)\n```python\nitems = client.list_items(order_field=None, order=\"ASC\", limit=None, start=None)\n# order options = \"ASC\" or \"DESC\"\n# Max limit = 30\n```\n#### - Create item (Item)\n```python\nitem = {\n    \"name\": \"PS5\",\n    \"description\": \"Play Station 5\",\n    \"reference\": \"PS5 nuevo\",\n    \"price\": 3750000,\n    \"category\": {\"id\": 5064},\n    \"inventory\": {\n        \"unit\": \"unit\",\n        \"unitCost\": 40000,\n        \"negativeSale\": False,\n        \"warehouses\": [{\"initialQuantity\": 4, \"id\": 1, \"minQuantity\": 2, \"maxQuantity\": 10}],\n    },\n    \"tax\": 2,\n    \"type\": \"product\",\n    \"customFields\": [{\"id\": 1, \"value\": \"BHUJSK888833\"}, {\"id\": 2, \"value\": 44}, {\"id\": 3, \"value\": 44.45}],\n    \"itemCategory\": {\"id\": 1}\n}\nitem_created = client.create_item(item)\n```\n#### - List item Categories (Categorias de items)\n```python\nitem_categorias = client.list_item_categories()\n```\n#### - List Warehouses (Bodegas)\n```python\nbodegas = client.list_warehouses()\n```\n#### - List Item Custom Fields (Campos adicionales)\n```python\ncampos = client.list_item_custom_fields()\n```\n#### - List Variant Attributes (Variantes)\n```python\natributos_variantes = client.list_variant_attributes()\n```\n#### - List price lists (Lista de precios)\n```python\nlista_precios = client.list_price_lists()\n```\n### Invoices\n#### - List invoices (Facturas de venta)\n```python\nitems = client.list_invoices(order_field=None, order=\"ASC\", limit=None, start=None, date=None)\n# order options = \"ASC\" or \"DESC\"\n# Max limit = 30\n# Date format YYYY-MM-DD\n```\n### Terms\n#### - List Terms (Condiciones de pago)\n```python\ncondiciones = client.list_terms()\n```\n### Taxes\n#### - List Taxes (Impuestos)\n```python\nimpuestos = client.list_taxes()\n```\n### Accounts\n#### - List Accounts (Cuentas)\n```python\ncuentas = client.list_accounts(format_acc=\"tree\", type_acc=None)\n# format_acc options = \"tree\" or \"plain\"\n# type_acc options = \"income\", \"expense\", \"asset\", \"liability\" or \"equity\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Falegra-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgearplug%2Falegra-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Falegra-python/lists"}