Alyx Connector, based on the Open Neurophysiology Environment
Project description
Python Connector to Alyx-Local instance(s)
Install
Install with
pip install alyx-connector
or
pip install git+https://github.com/JostTim/alyx-local-connector.git@docker-compatible
First use
You need to create a connector object to the alyx_instance that you are using.
The easyest way to create one at the beginning, or for any other new connection with a different username or to a different instance, you can use the Connector.setup() class function :
from alyx_connector import Connector
connector = Connector.setup()
You will be prompted to enter informations for setting the new connection.
First, the address of the server :
Second, the username to use :
Optionally, decide wether to make this the default address and username combo, when you call Connector() without arguments, at later times :
Lastly, the password to use with that address / username combo : (if successfull, the server will provide a token that will be saved by the connector for that adress/username combo, so that you don't need to retype the password again, but the pasword itself is not saved for security reasons)
If the connection succeeds, you will get a connector object :
Subsequent uses
After setting up at least a first connection, you can use the connector at later times (even after restarting python) using several ways :
Using the default server / username :
from alyx_connector import Connector
connector = Connector()
Using a specific server, but the default username for that server :
from alyx_connector import Connector
connector = Connector(url="127.0.0.1")
Using a specific server and username :
from alyx_connector import Connector
connector = Connector(url="127.0.0.1", username="myname")
At any time, you can check the server and username used by the connect, by typing connector.url or connector.username
Accessing experimental data using the connector
Searching for a session
The main use of the connector is usually to search experimental sessions data, based on some filter.
To get a table of session when the animal used is for example named ea04, you can type :
sessions = connector.search(subject = "ea04")
you will get a pandas.DataFrame where each row is corresponding to a session, and each column to some information relative to that session, as available on the alyx-local website.
Example :
You can get the session infos narrative for example, for the third session that you obtained here, by doing :
session = sessions.iloc[3] # get the third session in the table, by index order
print(session.narrative) # print the narrative
You can also access the json based fields : session.json and session.extended_qc, which are standard python dictionnaries. (containing potentially nested data that you entered)
session.json
The json field is meant as a way to store additionnal metadata that you cannot enter inside the regular session table fields. (as different experiments may need different fields)
The extended_qc field is meant as a way to store detailed Quality Check information, that you can use to get only the sessions that passed particular criterias after checking the data. (non exhaustive examples : a noise level in the electrophy recordings, etc...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alyx_connector-2.1.47.tar.gz.
File metadata
- Download URL: alyx_connector-2.1.47.tar.gz
- Upload date:
- Size: 967.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d9b4010d0c6253a3e79daba4a56e3fc3a789b7839a4b6864c79a86d9f511195
|
|
| MD5 |
5626a5aecd1770d3673a3a79c535c77b
|
|
| BLAKE2b-256 |
21ad96402cb70548adedefbf2ea6a7ed41df21bf119b0fe556deb3ed36e492b2
|
File details
Details for the file alyx_connector-2.1.47-py3-none-any.whl.
File metadata
- Download URL: alyx_connector-2.1.47-py3-none-any.whl
- Upload date:
- Size: 80.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d4031b715fdf340aeaac7af004579af3fd189e3e40392a598f165a9a3fd312a
|
|
| MD5 |
d4a56ba97bfb457aa43716c003f09ed7
|
|
| BLAKE2b-256 |
fcb96c21dc270ef53eb71913a792700349b0db145cd25c3a6aa05d1781ca7f9f
|