Skip to main content

Une interface python avec la base médicamenteuse thesorimed

Project description

https://travis-ci.org/jgirardet/pythonthesorimed.svg?branch=master Documentation Status https://coveralls.io/repos/github/jgirardet/pythonthesorimed/badge.svg Pypi package

Interface python pour thesorimed

Simple Interface Python pour utiliser l’api thesorimed compatible postgresql

Features

  • Génère l’API python depuis le fichier thesormed api.sql

  • Fournit la class ThesoItem pour les appels à la base

Installation

pipenv install pythonthesorimed
ou
pip install pythonthesorimed

Usage

from pythonthesorimed.thesoitem import ThesoItem
session = ThesoItem(host, base, user, password)
result = session.proc('api_name', param1, param2, param3)

Le retour est un Record ou un liste de Record. Record est un object possédant comme attribut les colonnes associées à la requète

par exemple :

>>> session.proc('get_the_gen_equiv', 3, 1)
    [Record(gsp_nom='RIFADINE 300MG GELULE', sp_code_equiv=4793, lib_virt='Rifampicine 300 mg gelule', sp_param='RIMACTAN 300MG GELULE', sp_code_sq_pk=3),
    Record(gsp_nom='RIMACTAN 300MG GELULE', sp_code_equiv=3, lib_virt='Rifampicine 300 mg gelule', sp_param='RIMACTAN 300MG GELULE', sp_code_sq_pk=3)]

    >>> result[0].gsp_nom
    'RIFADINE 300MG GELULE'

Parseur

Cloner le dépot puis :

make dev
pr python build.py path/to/api.sql

api.py est maintenant dans pythonthesorimed

Testing

make test : toutes les fonctionnalitées ne nécessitant pas le base de donnée thesorimed make test-local : tests avec des appels à thesorimed make all : tout

Travis utilise la version “make test”

Coverage

make test-coverage make test-coverage-all

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

pythonthesorimed-0.2.5.tar.gz (20.9 kB view hashes)

Uploaded Source

Supported by

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