Python library to connect with Alanube API
To install the Alanube library, you can use pip:
pip install alanube
# 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!
do
: Implementation for the Dominican Republic (DGII). This is the only fully developed directory and contains all the necessary structure and logic to work with the Alanube API for this country.pa
: Implementation for Panama (future). If you need to develop for Panama, create a directory namedpa
at the same level asdo
withinalanube
and replicate the internal structure ofdo
.cr
: Implementation for Costa Rica (future). Similarly, create acr
directory following the same structure asdo
.bo
: Implementation for Bolivia (future). Thebo
directory should also follow the structure ofdo
.
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.
If you're contributing to the development of this library, here are the steps to set up your environment and run the tests:
-
Clone the repository:
git clone https://github.com/wilmerm/alanube-python-api.git cd alanube-python-api
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Install the library in editable mode:
pip install -e .
-
Code Style. We follow PEP 8 for coding standards. Please ensure your code is formatted accordingly before submitting a pull request.
flake8 alanube
-
Navigate to the project root directory.
-
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).
To compile and upload the library to PyPI, follow these steps:
-
Ensure you have the necessary dependencies:
pip install build twine
-
Build the package:
python -m build
-
(Optional) Verify the package:
twine check dist/*
-
Upload the package to PyPI:
python -m twine upload dist/*
This project is licensed under the MIT License.
This project is under development
If you find value in this project and would like to show your support, please consider making a donation via PayPal:
Your generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!