drchrono-wrapper
Requirements
- checkout the requirements.txt file
- min. python version: 3.10 because of switch statement utilization that is only available starting with python 3.10
API token requirement
- please visit for more information on how to generate: https://app.drchrono.com/api-docs/#section/Authorization
- first load in the package and set the API token:
from drchrono.drc import drc- load in API token from .env:
drc_client = drc(api_key=os.getenv('DRCHRONO_API_TOKEN'))
- type in API token manually (not recommended):
drc_client = drc(api_key=123321asddsa321123)
Endpoints currently covered:
-
Fake data generation:
- Admin:
- Users
- Doctors
- Clinical:
- Patients
- Appointments
- Admin:
-
Real data pulls:
- Admin:
- Users
- Doctors
- Clinical:
- Patients
- Appointments
- Medications
- Documents
- Admin:
Basic examples:
Getting real data:
- Get all patients:
patient_all = drc_client.patients().patientlist- If you want additional metadata, like custom demographics, add on verbose_true=True
patient_all = drc_client.patients().patientlist(verbose_true=True)
- Get a single patient:
patient_single = drc_client.patients().patient_single(patient_id='200110461')
- Get a list of all doctors:
doctor_list = drc_client.doctors().doctorlist
- Get a list of all appointments (requires a specific start date):
appointments = drc_client.appointments().appointment_list(appointment_startdate='2019-01-01')
- Pushing a existing pdf into a patient record as a document:
- Load the file:
files = {'document': open('src/new_test_myfile.pdf', 'rb')} - Send the data over:
drc_client.documents().create_document(date='2017-01-01', description='testdocumentnov21_ANOTHER ONE' doctor=os.getenv('DRCHRONO_DOCTOR_ID'), patient=os.getenv('DRCHRONO_PATIENT_ID'), metatags='["fake-pdf", "document"]', document=files)
- Load the file:
Generating fake dataset:
- Fake dataset with linked patients and appointments; fake users and doctors;
f_users, f_doctors, f_patients, f_appointments = drc.faker().generate(20, 40, 150, 500)
Package admin:
- Note to self, to create new version:
- update setup.py version number
- re-run
python setup.py sdistto create new distribution - upload to pypi with
twine upload dist/*
Metadata
Release files for drchrono 0.0.11
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 | |
|---|---|---|---|---|
| drchrono-0.0.11.tar.gz | 16.2 kB | Without provenance | Details |
Release files / drchrono-0.0.11.tar.gz
| Download URL | drchrono-0.0.11.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b39d52e1cb458f9d4c13cd3c3a17e7093f54cd1f736c3bdaa947fe3524b5221e
|
|
BLAKE2b-256 checksum How to use checksums |
06727d555d86e4454f30db534c1b0c2412a6dfc9f463b550d4b6f9eed51400ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.9 tqdm/4.45.0 importlib-metadata/4.8.3 keyring/21.2.0 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.4
|
Security for drchrono 0.0.11
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.