Skip to main content

mDOT pJITAI (Just-In-Time Adaptive Intervention) interface library

Example

import pJITAI

# Create a new session to an existing API service
session = pJITAI.Client(server='http://localhost/api', service_id='028fa04c-943d-4ae3-9885-55b4bdf4337e',
service_token='e6e74d36-a3e4-4631-b077-4fdd703636f2')

# Upload some data
data = {
    'decision': 1,
    'decision_timestamp': '2022-06-01T08:30:00-05:00',
    'proximal_outcome': 45,
    'proximal_outcome_timestamp': '2022-06-01T09:00:00-05:00',
    'timestamp': '2022-06-01T09:05:00-05:00',
    'user_id': 'user_0',
    'values': [{
        'name': 'step_count',
        'value': 229
    }]
}
try:
    data_to_upload = pJITAI.DataVector.from_dict(data)
    session.upload(data_to_upload)
    print(data_to_upload)
except Exception as e:
    print(f'Upload Exception: {e}')

# Ask the server to generated a decision
data = {
    'timestamp': '2022-06-01T08:30:00-05:00',
    'user_id': 'user_0',
    'values': [{
        'name': 'step_count',
        'value': 24
    }]
}
try:
    decision = pJITAI.DecisionVector.from_dict(data)
    session.decision(decision)
    print(decision)
except Exception as e:
    print(f'Upload Exception: {e}')

# Have the server update the model parameters based on already uploaded data
try:
    session.update()
except Exception as e:
    print(f'Upload Exception: {e}')

Build and release

bumpver update -p

python3 -m build

twine check dist/*
twine upload dist/*

Metadata

Release files for pJITAI 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pJITAI 1.1.2
File Size Uploaded
pJITAI-1.1.2.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pJITAI 1.1.2
File Interpreter ABI Platform
pJITAI-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / pJITAI-1.1.2.tar.gz

Download URL pJITAI-1.1.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fb2b64fcbf26f8f1750d9177054bca63ae2bac9651c03091dd236445658b8e03
BLAKE2b-256 checksum
How to use checksums
278be17092e2000a33258fe3f93d39752749d44909f4db08493458b04edbf22b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release files / pJITAI-1.1.2-py3-none-any.whl

Download URL pJITAI-1.1.2-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78332731bcd9bf185c97a195467e83b62bbd68117adae64986c48f0eb2f6d452
BLAKE2b-256 checksum
How to use checksums
fa5c3ac1788d248e25a45ffc913bc9352c5256a97a458e3b9c84d04a9cbecae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page