Python SDK for InsideApp - complete invoice management and SPV integration. Everything you need for billing in Romania: issue invoices, automatically integrate with ANAF eFactura, and manage the entire process for multiple companies directly from your Python application.
- 📋 Invoice Management: Proforma, fiscal invoices, receipts, collections
- 🏛️ Complete SPV Integration: Automatic eFactura with ANAF
- 📚 Digital Archive: All issued and received invoices from SPV
- 👥 Complete Management: Clients, products, services, bank accounts
- 🏢 Reseller API: Manage invoicing for multiple companies from your Python app
- 🔧 Useful Tools: CIF validation, exchange rates, configurations
- 🌍 Geographic Info: Romanian counties and localities data
All changes and versions are documented in CHANGELOG.md.
The project follows Semantic Versioning and Keep a Changelog.
- 📧 Email Support: support@iapp.ro
- 🎫 Technical Support: developer.iapp.ro
- 📞 Contact: iapp.ro/contact
- 📖 Documentation: doc.iapp.ro
- 🔧 API References: doc.iapp.ro/swagger
- 🤝 Reseller API: doc.iapp.ro/reseller
- 🔗 Reseller Webhooks: doc.iapp.ro/reseller-webhook
Install via pip:
pip install insideapp-python-sdkOr with development dependencies:
pip install insideapp-python-sdk[dev]from insideapp import InsideAppClient
# Initialize the client
client = InsideAppClient("your_username", "your_password")
# Get exchange rates
rates = client.curs_valutar()
print(f"EUR rate: {rates['cursuri']['EUR']['curs']} RON")
# Validate a CIF
cif_info = client.info_cif({"cif": "RO123456789"})
if cif_info.get("valid"):
print(f"Company: {cif_info['denumire']}")
# Get Romanian counties
counties = client.info_judete()
print(f"Total counties: {len(counties)}")
# Get localities for a county
localities = client.info_localitati({"judet": "TM"})
print(f"Localities in Timiș: {len(localities)}")from datetime import datetime
from insideapp import InsideAppClient
client = InsideAppClient("username", "password")
invoice_data = {
'email_responsabil': 'your@email.com',
'client': {
'tip_client': 'pj', # 'pf' = individual, 'pj' = company
'nume': 'SC Example SRL',
'cui': '12345678',
'telefon': '0721123456',
'judet': 'Bucuresti',
'localitate': 'Sectorul 1',
'adresa': 'Str. Example nr. 123',
'email': 'client@example.com'
},
'data_start': datetime.now().strftime('%Y-%m-%d'),
'data_termen': '30', # days
'seria': 'FF',
'moneda': 'RON',
'continut': [
{
'title': 'IT Consulting',
'um': 'hour',
'cantitate': '40',
'pret': '150',
'tvavalue': '1140',
'tvapercent': '19'
}
]
}
response = client.emite_factura(invoice_data)
print(f"Invoice issued: {response['numar']}")Find complete examples in the examples/ folder. See examples/README.md for detailed documentation and running instructions.
examples/
├── curs_valutar.py # Current exchange rate
├── info_cif.py # CIF information verification
├── info_judete.py # List of Romanian counties
├── info_localitati.py # Localities for a county
├── FacturiProforme/
│ ├── emite_factura_proforma.py
│ └── ...
├── FacturiFiscale/
│ ├── emite_factura_fiscala.py
│ └── ...
├── SPV/
│ ├── lista_facturi_emise.py
│ └── ...
└── ... (complete structure mirror of PHP SDK)
The Python SDK provides 1:1 parity with the PHP SDK, including all 72 public methods:
curs_valutar()- Get current exchange ratesinfo_cif(data)- Validate and get CIF informationinfo_judete()- Get list of Romanian counties (42 counties)info_localitati(data)- Get localities for a specific county
- Proforma Invoices:
emite_proforma(),view_proforma(),view_proforme(), etc. - Fiscal Invoices:
emite_factura(),view_factura(),view_facturi(), etc. - Receipts:
emite_chitanta(),view_chitanta(),view_chitante(), etc.
e_factura_emise()- List issued invoices in SPVe_factura_furnizori()- List supplier invoices from SPVe_factura_upload_xml()- Upload invoice XML to SPVe_factura_upload_status()- Check upload status
- Clients:
clienti_lista(),clienti_adauga(),clienti_modifica(), etc. - Products/Services:
produse_lista(),produse_adauga(), etc. - Bank Accounts:
conturi_bancare_lista(),conturi_bancare_adauga(), etc. - Series Configuration:
serie_lista(),serie_adauga(), etc.
- Company Management:
firma_lista(),firma_adauga(),firma_modifica(), etc. - API Credentials:
firma_api(),firma_api_reset() - eFactura Settings:
e_factura_vizualizare_setari(), etc.
The SDK includes comprehensive test suite with both unit and integration tests.
pytest tests/unit/ -v# Set environment variables
export INSIDEAPP_TEST_USERNAME="your_username"
export INSIDEAPP_TEST_PASSWORD="your_password"
export INSIDEAPP_TEST_EMAIL="your@email.com"
export INSIDEAPP_INTEGRATION_TESTS=true
# Run integration tests
pytest tests/integration/ -v -m integrationpytest --cov=insideapp --cov-report=htmlThe SDK provides structured exception handling:
from insideapp import InsideAppClient
from insideapp.exceptions import (
InsideAppAPIError,
InsideAppAuthError,
InsideAppTimeoutError
)
try:
client = InsideAppClient("username", "password")
response = client.info_cif({"cif": "invalid"})
except InsideAppAuthError:
print("Invalid credentials")
except InsideAppAPIError as e:
print(f"API error: {e}")
except InsideAppTimeoutError:
print("Request timed out")# Set timeout during initialization
client = InsideAppClient("username", "password", timeout=600)
# Or change it later
client.set_timeout(300)INSIDEAPP_TEST_USERNAME=your_api_username
INSIDEAPP_TEST_PASSWORD=your_api_password
INSIDEAPP_TEST_EMAIL=your@email.com
INSIDEAPP_INTEGRATION_TESTS=true# Clone repository
git clone https://github.com/AninuApps/InsideApp-Python.git
cd InsideApp-Python
# Install in development mode
pip install -e .[dev]
# Run tests
pytest
# Run linting
flake8 insideapp/
black insideapp/
# Type checking
mypy insideapp/pip install pre-commit
pre-commit install- Python: ≥ 3.8
- Dependencies:
requests≥ 2.31.0 - Development:
pytest,black,flake8,mypy
- Response Times: < 300ms for most API calls
- Concurrent Requests: Thread-safe client
- Retry Logic: Automatic retry for transient failures
- Connection Pooling: Efficient HTTP session management
The Python SDK maintains 1:1 functional parity with the PHP SDK:
- PHP:
camelCase→ Python:snake_case - PHP:
emiteFactura()→ Python:emite_factura() - PHP:
clientiLista()→ Python:clienti_lista()
- PHP: Exceptions → Python: Custom exception hierarchy
- Structured error responses with status codes and details
- PHP: Associative arrays → Python: Dictionaries
- Same JSON structure for requests and responses
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -am 'Add new feature') - Push to branch (
git push origin feature/new-feature) - Create Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PHP SDK - Original PHP implementation
- InsideApp Platform - Web platform for invoice management
Note: This Python SDK provides complete 1:1 parity with the PHP SDK. All examples are tested and functional. We recommend testing in a development environment before production use.
- Start with utilities:
curs_valutar.py,info_cif.py,info_judete.py - Test data management: add clients, products
- Issue proforma invoices: then convert to fiscal
- Explore SPV: see invoices in Private Virtual Space
- Test Reseller API: if you have reseller account
For debugging, all examples display the complete API response. In case of error:
- Check credentials in your script
- Consult error messages displayed
- Check documentation at doc.iapp.ro
- Contact support at support@iapp.ro