Installation Guide
This guide will help you install and set up the Alanube Python API client.
Prerequisites
- Python 3.7 or higher
- pip (Python package installer)
- An Alanube API token
Installation Methods
Method 1: Install from PyPI (Recommended)
The easiest way to install the library is using pip:
pip install alanube
Method 2: Install from Source
If you want to install the latest development version or contribute to the project:
- Clone the repository:
git clone https://github.com/wilmerm/alanube-python.git cd alanube-python - Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate - Install dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt - Install in editable mode:
pip install -e .
Verification
To verify the installation, run Python and try importing the library:
from alanube.do import Alanube
print("Alanube library imported successfully!")
Getting Your API Token
- Visit the Alanube website
- Sign up for an account
- Navigate to your dashboard
- Generate an API token
- Keep your token secure and never share it publicly
Environment Setup
For development, you can use environment variables to store your API token:
- Create a
.envfile in your project root:ALANUBE_TOKEN=your_api_token_here ALANUBE_DEVELOPER_MODE=true - Load environment variables in your code: ```python import os from dotenv import load_dotenv from alanube.do import Alanube
load_dotenv()
token = os.getenv(‘ALANUBE_TOKEN’) developer_mode = os.getenv(‘ALANUBE_DEVELOPER_MODE’, ‘false’).lower() == ‘true’
Alanube.connect(token, developer_mode=developer_mode) ```
Next Steps
- Read the Usage Examples to learn how to use the library
- Explore Country Support to see what features are available
Troubleshooting
Common Issues
Import Error: No module named ‘alanube’
- Make sure you’ve installed the package correctly
- Verify you’re using the correct Python environment
- Try reinstalling:
pip install --force-reinstall alanube
Authentication Error
- Verify your API token is correct
- Check if your token has the necessary permissions
- Ensure you’re using the correct environment (production vs sandbox)
Network Issues
- Check your internet connection
- Verify firewall settings
- Try using a different network if available