Python SDK for Egyptian Tax Authority (ETA) eInvoicing integration.
# egypt-compliance
Python SDK for Egyptian Tax Authority (ETA) eInvoicing integration.
Phase 1 supports **login as a taxpayer system**. Phase 2 supports **get document types**. Phase 3 supports **get document type**. Phase 4 supports **get document type version**. Phase 5 supports **get notifications**. Phase 6 supports **create EGS code usage**. Phase 7 supports **search my EGS code usage requests**. Phase 8 supports **request code reuse**. Phase 9 supports **get code details by item code**. Phase 10 supports **update code**. V1 also supports **submit documents**, **invoice JSON modules**, **CAdES-BES signatures**, **cancel document**, **reject document**, **get recent documents**, **search documents**, **request document package**, **get package requests**, **get document package**, **get document**, **get submission**, and **get document printout**.
## Install
The project folder name contains a space (`egypt compliance`). Run commands **from this folder**, and quote the path if you install from a parent directory.
```powershell
python -m pip install .
```
Editable install for development (PowerShell: use single quotes so `[dev]` is not treated as a glob):
```powershell
python -m pip install -e '.[dev]'
```
From a parent folder, quote the full path:
```powershell
python -m pip install -e "Packag Path"
```
## Login
```python
from egypt_compliance import ETAClientFactory
client = ETAClientFactory.create("preprod")
token = client.login(client_id="client_id", client_secret="client_secret")
print(token.access_token)
print(token.expires_in)
types = client.get_document_types(token)
for document_type in types:
print(document_type.name, document_type.description)
for version in document_type.document_type_versions:
print(version.name, version.status)
```
Production:
```python
client = ETAClientFactory.create("prod")
```
Intermediary login (optional `onbehalfof` header):
```python
token = client.login(
client_id="your-client-id",
client_secret="your-client …