Skip to main content

FastAPI server akello.io

Project description

Setup DynamoDB on your local environment

Warning For local development you will need a free AWS account with cognito pools created. Please reference AWS docs.

Setup NoSQL Workbench

  1. Download and install NoSQL Workbench over here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.settingup.html
  2. Once you installed NoSQL Workbench, run DynamoDB locally

Set your environment variables

export AWS_REGION=## 
export AWS_SECRET_NAME=##  
export AWS_ACCESS_KEY_ID=##
export AWS_SECRET_ACCESS_KEY=##
export DYNAMODB_TABLE=##
export AWS_COGNITO_USERPOOL_ID=##
export AWS_COGNITO_APP_CLIENT_ID=##

Run the Fast API server

python3 -m venv venv 
source venv/bin/activate
pip install -r requirements.txt
uvicorn akello.main:app --reload

Call akello services

Create a new registry

from akello import registry
moderate_depression = registry.create_registry('Moderate Depression')

Refer a patient

from akello import registry
from akello.dynamodb.models.registry import PatientRegistry

# build a patient object using the PatientRegistry model
patient_registry = PatientRegistry(
    id='registry id',
    # .. other attributes
)

registry.refer_patient(patient_registry)

Add a patient encounter

from akello import registry
from akello.dynamodb.models.registry import TreatmentLog

treatment_log = TreatmentLog(
    patient_mrn='<patients mrn>',
    phq9_score=16,
    gad7_score=12,
    minutes=4,
    # .. other required attributes
)
registry.add_treatment_log('<registry_id>', '<patient_id>', treatment_log)

Publish a package

python3 -m build twine upload dist/*

Run tests

python3 -m unittest

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

akello-0.0.19.tar.gz (89.9 kB view details)

Uploaded Source

Built Distribution

akello-0.0.19-py3-none-any.whl (104.4 kB view details)

Uploaded Python 3

File details

Details for the file akello-0.0.19.tar.gz.

File metadata

  • Download URL: akello-0.0.19.tar.gz
  • Upload date:
  • Size: 89.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for akello-0.0.19.tar.gz
Algorithm Hash digest
SHA256 79ad87c24c392e5c29903939dde071fd93265124829a00e93f246af608f3e98f
MD5 14b0aa10e69ac9c9e8e98f3e6f1d8b9b
BLAKE2b-256 b2704f8f42ee36596908ded87cfa68345e2bb04b6e0661f01fafba67f9d8fbef

See more details on using hashes here.

File details

Details for the file akello-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: akello-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 104.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for akello-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 78d7528f66bc67c8056e5c47da39f27c532c178011684e40bb23d7f0daa2e13c
MD5 29fa79548b4b0dccd8cdc1e4d76d5ec1
BLAKE2b-256 33772adc0f4b60e274f8d5e2aab162881c85519c459c784a8e5cf1d67ef87f01

See more details on using hashes here.

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