insideapp-python-sdk 1.30.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ """
2
+ Excepții personalizate pentru InsideApp Python SDK.
3
+ """
4
+
5
+
6
+ class InsideAppError(Exception):
7
+ """Excepție de bază pentru toate erorile InsideApp SDK."""
8
+ pass
9
+
10
+
11
+ class InsideAppAPIError(InsideAppError):
12
+ """Excepție pentru erori returnate de API-ul InsideApp."""
13
+
14
+ def __init__(self, message: str, status_code: int = None, response_data: dict = None):
15
+ super().__init__(message)
16
+ self.status_code = status_code
17
+ self.response_data = response_data or {}
18
+
19
+
20
+ class InsideAppAuthError(InsideAppError):
21
+ """Excepție pentru erori de autentificare."""
22
+ pass
23
+
24
+
25
+ class InsideAppValidationError(InsideAppError):
26
+ """Excepție pentru erori de validare a datelor."""
27
+ pass
28
+
29
+
30
+ class InsideAppTimeoutError(InsideAppError):
31
+ """Excepție pentru timeout-uri de request."""
32
+ pass
33
+
34
+
35
+ class InsideAppConnectionError(InsideAppError):
36
+ """Excepție pentru erori de conexiune."""
37
+ pass
@@ -0,0 +1,399 @@
1
+ Metadata-Version: 2.4
2
+ Name: insideapp-python-sdk
3
+ Version: 1.30.2
4
+ Summary: Python SDK pentru InsideApp - gestiune facturi și integrare completă cu SPV. Emite facturi, integrează eFactura automat cu ANAF și gestionează tot procesul de facturare pentru mai multe firme direct din aplicația ta Python.
5
+ Project-URL: Homepage, https://iapp.ro
6
+ Project-URL: Documentation, https://doc.iapp.ro
7
+ Project-URL: Repository, https://github.com/AninuApps/InsideApp-Python
8
+ Project-URL: Bug Reports, https://github.com/AninuApps/InsideApp-Python/issues
9
+ Project-URL: API Reference, https://doc.iapp.ro/swagger
10
+ Project-URL: Support, https://developer.iapp.ro
11
+ Project-URL: Reseller API, https://doc.iapp.ro/reseller
12
+ Author-email: InsideApp <support@iapp.ro>
13
+ Maintainer-email: InsideApp <support@iapp.ro>
14
+ License: MIT License
15
+
16
+ Copyright (c) 2024 InsideApp
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ of this software and associated documentation files (the "Software"), to deal
20
+ in the Software without restriction, including without limitation the rights
21
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ copies of the Software, and to permit persons to whom the Software is
23
+ furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in all
26
+ copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ SOFTWARE.
35
+ License-File: LICENSE
36
+ Keywords: anaf,api,efactura,facturare,insideapp,romania,sdk,spv
37
+ Classifier: Development Status :: 5 - Production/Stable
38
+ Classifier: Intended Audience :: Developers
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Operating System :: OS Independent
41
+ Classifier: Programming Language :: Python
42
+ Classifier: Programming Language :: Python :: 3
43
+ Classifier: Programming Language :: Python :: 3.8
44
+ Classifier: Programming Language :: Python :: 3.9
45
+ Classifier: Programming Language :: Python :: 3.10
46
+ Classifier: Programming Language :: Python :: 3.11
47
+ Classifier: Programming Language :: Python :: 3.12
48
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
49
+ Classifier: Topic :: Office/Business :: Financial
50
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
51
+ Requires-Python: >=3.8
52
+ Requires-Dist: requests>=2.31.0
53
+ Requires-Dist: urllib3>=2.0.0
54
+ Provides-Extra: dev
55
+ Requires-Dist: black>=23.7.0; extra == 'dev'
56
+ Requires-Dist: flake8>=6.0.0; extra == 'dev'
57
+ Requires-Dist: mypy>=1.5.0; extra == 'dev'
58
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
59
+ Requires-Dist: pytest-mock>=3.11.1; extra == 'dev'
60
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
61
+ Requires-Dist: types-requests>=2.31.0; extra == 'dev'
62
+ Provides-Extra: test
63
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
64
+ Requires-Dist: pytest-mock>=3.11.1; extra == 'test'
65
+ Requires-Dist: pytest>=7.4.0; extra == 'test'
66
+ Description-Content-Type: text/markdown
67
+
68
+ # InsideApp Python SDK
69
+
70
+ **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.
71
+
72
+ [![PyPI version](https://badge.fury.io/py/insideapp-python-sdk.svg)](https://badge.fury.io/py/insideapp-python-sdk)
73
+ [![Python versions](https://img.shields.io/pypi/pyversions/insideapp-python-sdk)](https://pypi.org/project/insideapp-python-sdk/)
74
+ [![License](https://img.shields.io/pypi/l/insideapp-python-sdk)](https://opensource.org/licenses/MIT)
75
+ [![Downloads](https://pepy.tech/badge/insideapp-python-sdk)](https://pepy.tech/project/insideapp-python-sdk)
76
+
77
+ ## 🚀 Key Features
78
+
79
+ - **📋 Invoice Management**: Proforma, fiscal invoices, receipts, collections
80
+ - **🏛️ Complete SPV Integration**: Automatic eFactura with ANAF
81
+ - **📚 Digital Archive**: All issued and received invoices from SPV
82
+ - **👥 Complete Management**: Clients, products, services, bank accounts
83
+ - **🏢 Reseller API**: Manage invoicing for multiple companies from your Python app
84
+ - **🔧 Useful Tools**: CIF validation, exchange rates, configurations
85
+ - **🌍 Geographic Info**: Romanian counties and localities data
86
+
87
+ ## 📋 Changelog & Versioning
88
+
89
+ All changes and versions are documented in [CHANGELOG.md](CHANGELOG.md).
90
+
91
+ The project follows [Semantic Versioning](https://semver.org/) and [Keep a Changelog](https://keepachangelog.com/).
92
+
93
+ ## Support & Documentation
94
+
95
+ - **📧 Email Support**: support@iapp.ro
96
+ - **🎫 Technical Support**: [developer.iapp.ro](https://developer.iapp.ro)
97
+ - **📞 Contact**: [iapp.ro/contact](https://iapp.ro/contact)
98
+ - **📖 Documentation**: [doc.iapp.ro](https://doc.iapp.ro)
99
+ - **🔧 API References**: [doc.iapp.ro/swagger](https://doc.iapp.ro/swagger)
100
+ - **🤝 Reseller API**: [doc.iapp.ro/reseller](https://doc.iapp.ro/reseller)
101
+ - **🔗 Reseller Webhooks**: [doc.iapp.ro/reseller-webhook](https://doc.iapp.ro/reseller-webhook)
102
+
103
+ ## Installation
104
+
105
+ Install via pip:
106
+
107
+ ```bash
108
+ pip install insideapp-python-sdk
109
+ ```
110
+
111
+ Or with development dependencies:
112
+
113
+ ```bash
114
+ pip install insideapp-python-sdk[dev]
115
+ ```
116
+
117
+ ## Quick Start
118
+
119
+ ```python
120
+ from insideapp import InsideAppClient
121
+
122
+ # Initialize the client
123
+ client = InsideAppClient("your_username", "your_password")
124
+
125
+ # Get exchange rates
126
+ rates = client.curs_valutar()
127
+ print(f"EUR rate: {rates['cursuri']['EUR']['curs']} RON")
128
+
129
+ # Validate a CIF
130
+ cif_info = client.info_cif({"cif": "RO123456789"})
131
+ if cif_info.get("valid"):
132
+ print(f"Company: {cif_info['denumire']}")
133
+
134
+ # Get Romanian counties
135
+ counties = client.info_judete()
136
+ print(f"Total counties: {len(counties)}")
137
+
138
+ # Get localities for a county
139
+ localities = client.info_localitati({"judet": "TM"})
140
+ print(f"Localities in Timiș: {len(localities)}")
141
+ ```
142
+
143
+ ## Issue an Invoice
144
+
145
+ ```python
146
+ from datetime import datetime
147
+ from insideapp import InsideAppClient
148
+
149
+ client = InsideAppClient("username", "password")
150
+
151
+ invoice_data = {
152
+ 'email_responsabil': 'your@email.com',
153
+ 'client': {
154
+ 'tip_client': 'pj', # 'pf' = individual, 'pj' = company
155
+ 'nume': 'SC Example SRL',
156
+ 'cui': '12345678',
157
+ 'telefon': '0721123456',
158
+ 'judet': 'Bucuresti',
159
+ 'localitate': 'Sectorul 1',
160
+ 'adresa': 'Str. Example nr. 123',
161
+ 'email': 'client@example.com'
162
+ },
163
+ 'data_start': datetime.now().strftime('%Y-%m-%d'),
164
+ 'data_termen': '30', # days
165
+ 'seria': 'FF',
166
+ 'moneda': 'RON',
167
+ 'continut': [
168
+ {
169
+ 'title': 'IT Consulting',
170
+ 'um': 'hour',
171
+ 'cantitate': '40',
172
+ 'pret': '150',
173
+ 'tvavalue': '1140',
174
+ 'tvapercent': '19'
175
+ }
176
+ ]
177
+ }
178
+
179
+ response = client.emite_factura(invoice_data)
180
+ print(f"Invoice issued: {response['numar']}")
181
+ ```
182
+
183
+ ## 📁 Example Files
184
+
185
+ Find complete examples in the `examples/` folder. **See [examples/README.md](examples/README.md) for detailed documentation and running instructions.**
186
+
187
+ ```
188
+ examples/
189
+ ├── curs_valutar.py # Current exchange rate
190
+ ├── info_cif.py # CIF information verification
191
+ ├── info_judete.py # List of Romanian counties
192
+ ├── info_localitati.py # Localities for a county
193
+ ├── FacturiProforme/
194
+ │ ├── emite_factura_proforma.py
195
+ │ └── ...
196
+ ├── FacturiFiscale/
197
+ │ ├── emite_factura_fiscala.py
198
+ │ └── ...
199
+ ├── SPV/
200
+ │ ├── lista_facturi_emise.py
201
+ │ └── ...
202
+ └── ... (complete structure mirror of PHP SDK)
203
+ ```
204
+
205
+ ## API Methods Coverage
206
+
207
+ The Python SDK provides **1:1 parity** with the PHP SDK, including all **72 public methods**:
208
+
209
+ ### 🌍 General Information
210
+ - `curs_valutar()` - Get current exchange rates
211
+ - `info_cif(data)` - Validate and get CIF information
212
+ - `info_judete()` - Get list of Romanian counties (42 counties)
213
+ - `info_localitati(data)` - Get localities for a specific county
214
+
215
+ ### 📋 Invoice Management
216
+ - **Proforma Invoices**: `emite_proforma()`, `view_proforma()`, `view_proforme()`, etc.
217
+ - **Fiscal Invoices**: `emite_factura()`, `view_factura()`, `view_facturi()`, etc.
218
+ - **Receipts**: `emite_chitanta()`, `view_chitanta()`, `view_chitante()`, etc.
219
+
220
+ ### 🏛️ SPV/eFactura Integration
221
+ - `e_factura_emise()` - List issued invoices in SPV
222
+ - `e_factura_furnizori()` - List supplier invoices from SPV
223
+ - `e_factura_upload_xml()` - Upload invoice XML to SPV
224
+ - `e_factura_upload_status()` - Check upload status
225
+
226
+ ### 👥 Data Management
227
+ - **Clients**: `clienti_lista()`, `clienti_adauga()`, `clienti_modifica()`, etc.
228
+ - **Products/Services**: `produse_lista()`, `produse_adauga()`, etc.
229
+ - **Bank Accounts**: `conturi_bancare_lista()`, `conturi_bancare_adauga()`, etc.
230
+ - **Series Configuration**: `serie_lista()`, `serie_adauga()`, etc.
231
+
232
+ ### 🏢 Reseller API
233
+ - **Company Management**: `firma_lista()`, `firma_adauga()`, `firma_modifica()`, etc.
234
+ - **API Credentials**: `firma_api()`, `firma_api_reset()`
235
+ - **eFactura Settings**: `e_factura_vizualizare_setari()`, etc.
236
+
237
+ ## Testing
238
+
239
+ The SDK includes comprehensive test suite with both unit and integration tests.
240
+
241
+ ### Run Unit Tests
242
+ ```bash
243
+ pytest tests/unit/ -v
244
+ ```
245
+
246
+ ### Run Integration Tests (requires real API credentials)
247
+ ```bash
248
+ # Set environment variables
249
+ export INSIDEAPP_TEST_USERNAME="your_username"
250
+ export INSIDEAPP_TEST_PASSWORD="your_password"
251
+ export INSIDEAPP_TEST_EMAIL="your@email.com"
252
+ export INSIDEAPP_INTEGRATION_TESTS=true
253
+
254
+ # Run integration tests
255
+ pytest tests/integration/ -v -m integration
256
+ ```
257
+
258
+ ### Run All Tests with Coverage
259
+ ```bash
260
+ pytest --cov=insideapp --cov-report=html
261
+ ```
262
+
263
+ ## Error Handling
264
+
265
+ The SDK provides structured exception handling:
266
+
267
+ ```python
268
+ from insideapp import InsideAppClient
269
+ from insideapp.exceptions import (
270
+ InsideAppAPIError,
271
+ InsideAppAuthError,
272
+ InsideAppTimeoutError
273
+ )
274
+
275
+ try:
276
+ client = InsideAppClient("username", "password")
277
+ response = client.info_cif({"cif": "invalid"})
278
+ except InsideAppAuthError:
279
+ print("Invalid credentials")
280
+ except InsideAppAPIError as e:
281
+ print(f"API error: {e}")
282
+ except InsideAppTimeoutError:
283
+ print("Request timed out")
284
+ ```
285
+
286
+ ## Configuration
287
+
288
+ ### Timeout Settings
289
+ ```python
290
+ # Set timeout during initialization
291
+ client = InsideAppClient("username", "password", timeout=600)
292
+
293
+ # Or change it later
294
+ client.set_timeout(300)
295
+ ```
296
+
297
+ ### Environment Variables for Testing
298
+ ```bash
299
+ INSIDEAPP_TEST_USERNAME=your_api_username
300
+ INSIDEAPP_TEST_PASSWORD=your_api_password
301
+ INSIDEAPP_TEST_EMAIL=your@email.com
302
+ INSIDEAPP_INTEGRATION_TESTS=true
303
+ ```
304
+
305
+ ## Development
306
+
307
+ ### Setup Development Environment
308
+ ```bash
309
+ # Clone repository
310
+ git clone https://github.com/AninuApps/InsideApp-Python.git
311
+ cd InsideApp-Python
312
+
313
+ # Install in development mode
314
+ pip install -e .[dev]
315
+
316
+ # Run tests
317
+ pytest
318
+
319
+ # Run linting
320
+ flake8 insideapp/
321
+ black insideapp/
322
+
323
+ # Type checking
324
+ mypy insideapp/
325
+ ```
326
+
327
+ ### Pre-commit Hooks
328
+ ```bash
329
+ pip install pre-commit
330
+ pre-commit install
331
+ ```
332
+
333
+ ## Requirements
334
+
335
+ - **Python**: ≥ 3.8
336
+ - **Dependencies**: `requests` ≥ 2.31.0
337
+ - **Development**: `pytest`, `black`, `flake8`, `mypy`
338
+
339
+ ## Performance
340
+
341
+ - **Response Times**: < 300ms for most API calls
342
+ - **Concurrent Requests**: Thread-safe client
343
+ - **Retry Logic**: Automatic retry for transient failures
344
+ - **Connection Pooling**: Efficient HTTP session management
345
+
346
+ ## Migration from PHP SDK
347
+
348
+ The Python SDK maintains 1:1 functional parity with the PHP SDK:
349
+
350
+ ### Method Name Mapping
351
+ - PHP: `camelCase` → Python: `snake_case`
352
+ - PHP: `emiteFactura()` → Python: `emite_factura()`
353
+ - PHP: `clientiLista()` → Python: `clienti_lista()`
354
+
355
+ ### Error Handling
356
+ - PHP: Exceptions → Python: Custom exception hierarchy
357
+ - Structured error responses with status codes and details
358
+
359
+ ### Data Structures
360
+ - PHP: Associative arrays → Python: Dictionaries
361
+ - Same JSON structure for requests and responses
362
+
363
+ ## Contributing
364
+
365
+ 1. Fork the repository
366
+ 2. Create a feature branch (`git checkout -b feature/new-feature`)
367
+ 3. Commit changes (`git commit -am 'Add new feature'`)
368
+ 4. Push to branch (`git push origin feature/new-feature`)
369
+ 5. Create Pull Request
370
+
371
+ ## License
372
+
373
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
374
+
375
+ ## Related Projects
376
+
377
+ - **[PHP SDK](https://github.com/AninuApps/InsideApp-PHP)** - Original PHP implementation
378
+ - **[InsideApp Platform](https://iapp.ro)** - Web platform for invoice management
379
+
380
+ ---
381
+
382
+ **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.
383
+
384
+ ## 🎯 Testing Suggestions
385
+
386
+ 1. **Start with utilities**: `curs_valutar.py`, `info_cif.py`, `info_judete.py`
387
+ 2. **Test data management**: add clients, products
388
+ 3. **Issue proforma invoices**: then convert to fiscal
389
+ 4. **Explore SPV**: see invoices in Private Virtual Space
390
+ 5. **Test Reseller API**: if you have reseller account
391
+
392
+ ## 🛠️ Debugging
393
+
394
+ For debugging, all examples display the complete API response. In case of error:
395
+
396
+ 1. **Check credentials** in your script
397
+ 2. **Consult error messages** displayed
398
+ 3. **Check documentation** at [doc.iapp.ro](https://doc.iapp.ro)
399
+ 4. **Contact support** at support@iapp.ro
@@ -0,0 +1,7 @@
1
+ insideapp/__init__.py,sha256=kGeK1nSTxyVbZJyceoP1fzbchVu2CPUd2l8ypipjqTU,1245
2
+ insideapp/client.py,sha256=7w-mUorfHMURtqxHnHC-6R8Xx2ObKeBtoWkTfy8X4dg,34909
3
+ insideapp/exceptions.py,sha256=DQxp74O1YJrTRBPMlP0KeSFM6XfUeJYvlNuot_drfI8,962
4
+ insideapp_python_sdk-1.30.2.dist-info/METADATA,sha256=SXg06k9jem85G-G87S_NJpFfqVQAF5G-DbNauErw0t4,13721
5
+ insideapp_python_sdk-1.30.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
+ insideapp_python_sdk-1.30.2.dist-info/licenses/LICENSE,sha256=vST9dL21bmJfy2rUOG5jX_LU40KBzvnjGARKIS6GEIY,1085
7
+ insideapp_python_sdk-1.30.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 InsideApp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.