Skip to main content

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 (
    MaterialFilter,
    MedicamentoFilter,
    MedicamentosFilter,
    NotaFilter,
    PresentacionesFilter,
    RegistroCambiosFilter,
    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.medicamentos.get(
    filter=MedicamentosFilter().nombre.startswith(value="")
):
    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)

for change in aemps.registro_cambios.get(
    filter=RegistroCambiosFilter().fecha.equals(value="20/12/2023")
):
    print(change)

for note in aemps.notas.get(filter=NotaFilter().nregistro.equals("69223")):
    print(note)

for material in aemps.materiales.get(
    filter=MaterialFilter().nregistro.equals("78632")
):
    print(material)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aempsconn-1.1.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aempsconn-1.1.1-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file aempsconn-1.1.1.tar.gz.

File metadata

  • Download URL: aempsconn-1.1.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.1 Linux/6.5.0-1025-azure

File hashes

Hashes for aempsconn-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d8c3ed0dedd2148f9cfd9f19a4f27034cbcf737ac7c0150bdc6ceaa187c31953
MD5 655ca562e086650eb5c29ca90d10766d
BLAKE2b-256 f1bfdb0daea34dd884cd321188f08f8a897adbc7d546a56a45b67bdf081ce258

See more details on using hashes here.

File details

Details for the file aempsconn-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: aempsconn-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.1 Linux/6.5.0-1025-azure

File hashes

Hashes for aempsconn-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb5b9961f6bbd5aac14436decf401e376e54b1cd515954378474e3638178a8d
MD5 1e3cf212ca4f09b264bdf3f7d8a32027
BLAKE2b-256 e9114a328d3ff3ee603054ba40e5ae123aa74044120235d01253c5ab14d8216f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page