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...)
Metadata
Release files for alyx-connector 2.1.47
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alyx_connector-2.1.47.tar.gz | 967.4 kB | Without provenance | Details for alyx_connector-2.1.47.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alyx_connector-2.1.47-py3-none-any.whl | Python 3 | none | any | Details for alyx_connector-2.1.47-py3-none-any.whl |
Total release size: 1.0 MB
Release files / alyx_connector-2.1.47.tar.gz
| Download URL | alyx_connector-2.1.47.tar.gz |
|---|---|
| Size | 967.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d9b4010d0c6253a3e79daba4a56e3fc3a789b7839a4b6864c79a86d9f511195
|
|
BLAKE2b-256 checksum How to use checksums |
21ad96402cb70548adedefbf2ea6a7ed41df21bf119b0fe556deb3ed36e492b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure
|
Release files / alyx_connector-2.1.47-py3-none-any.whl
| Download URL | alyx_connector-2.1.47-py3-none-any.whl |
|---|---|
| Size | 80.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d4031b715fdf340aeaac7af004579af3fd189e3e40392a598f165a9a3fd312a
|
|
BLAKE2b-256 checksum How to use checksums |
fcb96c21dc270ef53eb71913a792700349b0db145cd25c3a6aa05d1781ca7f9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure
|
Security for alyx-connector 2.1.47
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.