Library designed for interacting with the CIMA API (AEMPS)
Project description
AEMPSconn
Library designed for interacting with the CIMA REST API (AEMPS). More information related to the official REST API can be found here.
Note: AEMPSconn is developed to make use of it with CIMA REST API v1.23.
Testing
Unit-tests for this new version are under development.
Installation
Use the package manager pip to install aempsconn.
pip install aempsconn
Usage
Each module has embedded in it the only type of filter it supports. The filters are created dynamically so depending on the type of data you want to obtain, it will ask for the type of value required for it.
If you want to filter by more than one value, simply concatenate all the desired filters, the query-builder will create the necessary query.
from aempsconn.aemps import AempsConn
from aempsconn.filter import (
MedicamentoFilter,
MedicamentosFilter,
PresentacionesFilter,
VmppFilter,
)
aemps = AempsConn()
for med in aemps.medicamento.get(
filter=MedicamentoFilter().nregistro.equals(value="62121")
):
print(med.nombre)
for med in aemps.medicamentos.get(
filter=MedicamentosFilter().nombre.startswith(value="meto")
):
print(med.nombre)
for med in aemps.presentaciones.get(
filter=PresentacionesFilter().vmp.equals("270671000140106")
):
print(med.nombre)
for desc_cli in aemps.vmpp.get(filter=VmppFilter().nombre.contains("metotrexato")):
print(desc_cli.vmpDesc)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Disclaimer
The use of Spanish words or descriptions is intended to facilitate consistency between the official CIMA API and this library, so that the programmer does not hesitate with the name of each of the filters or data received.
This library is not official.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aempsconn-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29bd02624b5ad0b5f04ec3f3d553ea94550370499f5acf0b111bae3d28e3fd3b |
|
MD5 | 96ecb755e40425825825240d27dd9f91 |
|
BLAKE2b-256 | 9fd813195bf6270b2bad703a9d598d155bc69da9996cab3bf2f9d91ff4d95185 |