openIMIS Backend api_etl reference module
API ETL Configuration and Adapter Extension Guide
Default Configuration Example
The following is a sample configuration (DEFAULT_CONFIG) that enables connection to an example API. This configuration is used to control authentication, data source connection, and field mappings for an adapter:
DEFAULT_CONFIG = {
"auth_type": "basic", # Options: noauth, basic, bearer
"auth_basic_username": "<USERNAME>", # Basic auth username
"auth_basic_password": "<PASSWORD>", # Basic auth password
"auth_bearer_token": "", # Bearer token for 'bearer' auth_type
"source_http_method": "post", # HTTP method for requests.request
"source_url": "http://41.175.18.170:8070/api/mobile/v1/beneficiary/active/search",
"source_headers": {
"Content-Type": "application/x-www-form-urlencodedc",
"Accept": "application/json"
},
"source_batch_size": 50, # Number of records to fetch in one batch
"adapter_first_name_field": "firstName",
"adapter_last_name_field": "lastName",
"adapter_dob_field": "dateOfBirth",
"skip_integration_test": False # Must be False for production deployments
}
Creating a New Adapter
To implement a new adapter, you must:
-
Extend the base Adapter class provided by the project.
- Base Adapter class source:
base.py
- Base Adapter class source:
-
Create a new class that inherits from this base class.
- Reference implementation:
exampleIndividialAdapter.py
- Reference implementation:
-
Implement the required methods and logic in your subclass based on the data structure and behavior needed.
-
Register the adapter in the appropriate place if required for discovery or configuration.
Example
from api_etl.adapters.base import BaseAdapter
class MyCustomAdapter(BaseAdapter):
def transform(self, record):
# Implement transformation logic here
pass
This modular architecture allows easy customization and extension to support different data sources and APIs.
Metadata
Release files for openimis-be-api-etl 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openimis_be_api_etl-1.4.0.tar.gz | 17.7 kB | Without provenance | Details for openimis_be_api_etl-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openimis_be_api_etl-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for openimis_be_api_etl-1.4.0-py3-none-any.whl |
Total release size: 42.4 kB
Release files / openimis_be_api_etl-1.4.0.tar.gz
| Download URL | openimis_be_api_etl-1.4.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23c5a506b2ff808185c0c3e7c116d1ce25c10816b608e9f46405cc7ba5ec5516
|
|
BLAKE2b-256 checksum How to use checksums |
cf9036fcdd47d878f1b371505288d6da834944c7f8fe61a1a3c79ec6d12e237e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.1
|
Release files / openimis_be_api_etl-1.4.0-py3-none-any.whl
| Download URL | openimis_be_api_etl-1.4.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b27412523024d649067141d2599cc6ad2e1b0dfb4eb224d914ce0cd3ad8aba67
|
|
BLAKE2b-256 checksum How to use checksums |
39faa2df4077c91fed3a9a0593a4202aff1b5936b3027d10eb5b1a16c0aef480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.1
|
Security for openimis-be-api-etl 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.