Skip to main content

Python library to connect with Alanube API

Project description

Alanube Python API

A lightweight Python client for connecting to the Alanube e-invoicing API across multiple countries.

PyPI version License: MIT Tests

📚 Table of Contents

Instalation

To install the Alanube library, you can use pip:

pip install alanube

Usage

# Import the Alanube class specific to the country,
# in this case from `alanube.do` for the Dominican Republic
from alanube.do import Alanube

# Connect to the API
Alanube.connect("[TOKEN]")

payload = {...}

data = Alanube.send_document(encf_type=31, payload)

Now you can easily and efficiently use the Alanube API with this Python library!

Contents

  • do: Fully implemented for the Dominican Republic (DGII).
  • pa, cr, pe, bo: Planned support. Follow the structure of the do module.

For the missing countries, you can use the do directory as a reference to build the required implementations, adapting the logic to meet the specific local requirements of each country.

Links

Roadmap

  • 🇩🇴 Dominican Republic
  • 🇵🇦 Panama
  • 🇨🇷 Costa Rica
  • 🇵🇪 Peru
  • 🇧🇴 Bolivia

Developers

If you're contributing to the development of this library, here are the steps to set up your environment and run the tests:

Setting Up the Environment

  1. Clone the repository:

    git clone https://github.com/wilmerm/alanube-python.git
    cd alanube-python
    
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    pip install -r requirements-dev.txt
    
  4. Install the library in editable mode:

    pip install -e .
    
  5. Code Style. We follow PEP 8 for coding standards. Please ensure your code is formatted accordingly before submitting a pull request.

    flake8 alanube
    

Running the Tests

  1. Navigate to the project root directory.

  2. Execute the tests with unittest:

    python -m unittest discover -s alanube/tests -p "*.py"
    
    • -s: Specifies the directory to look for tests (tests folder).
    • -p: Defines the pattern for test file names (e.g., *.py).

Building and Publishing the Library

To compile and upload the library to PyPI, follow these steps:

  1. Ensure you have the necessary dependencies:

    pip install build twine
    
  2. Build the package:

    python -m build
    
  3. (Optional) Verify the package:

    twine check dist/*
    
  4. Upload the package to PyPI:

    python -m twine upload dist/*
    

Credits

Wilmer Martinez
Wilmer Martinez

Author & Maintainer
Oriku Precious
Oriku Precious

Documentation Contributor

If you contributed to this project and would like to be listed here, feel free to open a pull request adding yourself to the credits section.

Licence

This project is licensed under the MIT License.

Proyect Status

✅ This project is in production and actively maintained.

Contributing

We welcome pull requests and suggestions. Please open an issue or submit a PR.

Support 💗

If you find this useful, consider supporting.

Your generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!

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

alanube-1.0.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

alanube-1.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file alanube-1.0.1.tar.gz.

File metadata

  • Download URL: alanube-1.0.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for alanube-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f0bd6f58f344277f3736c5fc857c82a70fb92893d7b553de3abb053a9067980b
MD5 72b72b2e3135235256706febf4ace29f
BLAKE2b-256 824c67b78721936a54a1ddaa8f8c58b8c805a3d9ce47cff124f5f016e0fd1f0a

See more details on using hashes here.

File details

Details for the file alanube-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: alanube-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for alanube-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66bb7514c674124c06f25655833be8e4e9c7564e80063de620d4f2c933caecfb
MD5 a0a2d7db7938e2c50e561a1d59b3049f
BLAKE2b-256 61755fc123e6160bf982b5c658c48c62c52eb70dfeb0bace3860df67b20ea88a

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