Skip to content

Client to download information of the E4 Connect platform.

Notifications You must be signed in to change notification settings

khvilaboa/e4-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e4-client

pypi_version_badge build_badge

Client to download information of the E4 Connect platform.

Installation

The installation can be performed either with pip (recommended) or manually (using the local setup.py). It installs both the e4client command line utlity and the e4client package (that contains the logic of the client in the E4Connect class).

PIP installation:

$ pip install e4client

Local installation:

$ python setup.py install

Usage

$ e4client [-h] [-u USER] [-p PWD] [-a] [-i SESSION_ID] [-l] [-o OUT]

    -h, --help    Help message

    -u USER, --user USER    Username.

    -p PWD, --pwd PWD    Password.

    -a, --all_sessions    Downloads all sessions of a user.

    -i SESSION_ID, --session_id SESSION_ID    Downloads a specific session.

    -r SESSION_ID, --remove SESSION_ID    Removes a specific session.

    -l, --sessions_list    Downloads the list of sessions in CSV format. It includes the following columns: id, device_id duration, status, start_time, label device, exit_code.

    -p, --purchased_devs    Downloads the list of purchses devices in CSV format. It includes the following columns: device_id, label, model, hardware_code, purchase_code, purchase_id.

    -f USERS_FILE, --users_file USERS_FILE    Read users from file. Accepted files are composed of ":" pairs (one per line).

    -o OUT, --out OUT    Output file or path.

Authentication through environment variables

The username and the password can also be specified using environment variables. In Linux they can be specified as follows:

$ export E4_USER=[username]
$ export E4_PWD=[password]

Examples

$ python3 emp-client.py -u [email protected] -p pass -a -o out

Downloads all the episodes in the out folder.

$ python3 emp-client.py -i 67677

Downloads the session that has 67677 as identifier. Since no credentials are specified, it is assumed that they are registered in the environment variables.

$ python3 emp-client.py -r 67677

Removes de session with ID 67677.

$ python3 emp-client.py -l -o output.csv

Downloads the list of episodes as a CSV (output.csv).

$ python3 emp-client.py -p

Downloads the list of purchased devices.

$ python3 emp-client.py -f users.txt -a

Downloads all the episodes of the patients specified in the users.txt file.

$ python3 emp-client.py -f users.txt -a -l -d

Downloads all the episodes of the patients specified in the users.txt file, including in each user folder the related sessions and purchased devices files.

Documentation

To use the E4 client as a library the e4client package can be imported. Inside its E4Connect class different methods to retrieve the information of the platform are defined. It can be imported as follows:

from e4client import E4Connect

Documentation can be accessed here.

About

Client to download information of the E4 Connect platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages