The goal of the BraindocsClient is to provide a utility for BrainDocs users to interact with the BrainDocs API.
Currently it contains braindocsclient
library for talking to the BrainDocs API and the script braindocs2database
that helps the user to export analysis results from BrainDocs into a database of their choice.
The current version of BraindocsClient can be installed by issuing the following command:
$ pip install git+https://github.com/ai-one/braindocsclient.git
To install a specific release or experimental branch, run:
$ pip install git+https://github.com/ai-one/braindocsclient.git@v1.0.1
Requirements
Before installing and running this utility, the user must have the following:
Installation
The current version of BraindocsClient can be found at https://github.com/ai-one/braindocsclient/releases
C:\> pip install [location and name of the downloaded zip file]
For example: C:\> pip install C:\Users\[yourname]\Downloads\braindocsclient-1.0.2.zip
.
braindocs2database
Core Features:
Usage:
After installation the command can be run in a terminal window.
Since all files (export data, settings, etc.) are stored in the current working directory, make sure to change directory to the location of your choice, e.g.:
C:\>cd C:\Users\[yourname]\Desktop\BD SQL Data
Then run braindocs2database
:
C:\Users\[yourname]\Desktop\BD SQL Data>braindocs2database
The response then should be:
braindocs2database
Copyright (c) 2015 ai-one inc. All rights reserved.
>>> Current settings:
BRAINDOCS
username: bd_user
password: bd_password
url: https://nathandev2.cloudapp.net/at
DATABASE
url: sqlite:///braindocs_export.db
Update settings? [no]?
It displays the current settings and asks the user if he wants to update the configuration. no
is the default response as no settings will be changed.
braindocs2database
exports the data into a local SQLite database.DATABASE -> url
option needs to be changed from sqlite:///braindocs_export.db
to e.g. mysql://root@localhost/braindocs
. Make sure that the appropriate Python extension for MySQL is installed. This can be done via: $ pip install mysql-python
.Once the user has completed any changes to the settings and verified the changes, [enter] at the Update settings? Prompt will run the program as in the example below.
Per default braindocs2database
now exports the data into a local SQLite database.
If no
(default option when hitting Enter
), the program runs the export/import with the given settings:
Starting import...
importing analysis results: processed 1 of 11 ...
importing analysis results: processed 2 of 11 ...
importing analysis results: processed 3 of 11 ...
importing analysis results: processed 4 of 11 ...
importing analysis results: processed 5 of 11 ...
importing analysis results: processed 6 of 11 ...
importing analysis results: processed 7 of 11 ...
importing analysis results: processed 8 of 11 ...
importing analysis results: processed 9 of 11 ...
importing analysis results: processed 10 of 11 ...
importing analysis results: processed 11 of 11 ...
importing analysis results: done
Additional Suggested Requirements:
database2braindocs
(not yet implemented)Core Features:
The braindocsclient.BraindocsApi
class facilitates the communication between a client and the analyst-toolbox's BrainDocs:
braindocsclient.BraindocsApi
getAnalysisResults()
Retrieve JSON with all available analysis results.
getAnalysisDetailsTextUnits(analysisId)
Retrieve JSON with textunit scores for a specific analysis result.