Skip to main content

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 : Enter address

Second, the username to use : Enter username

Optionally, decide wether to make this the default address and username combo, when you call Connector() without arguments, at later times : Enter set default

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) Enter password

If the connection succeeds, you will get a connector object : connector obtained

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 : session_table

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

session_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

session_json session_json_getitem

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alyx_connector-2.1.46.tar.gz (968.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alyx_connector-2.1.46-py3-none-any.whl (80.4 kB view details)

Uploaded Python 3

File details

Details for the file alyx_connector-2.1.46.tar.gz.

File metadata

  • Download URL: alyx_connector-2.1.46.tar.gz
  • Upload date:
  • Size: 968.2 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

Hashes for alyx_connector-2.1.46.tar.gz
Algorithm Hash digest
SHA256 e97122d667a3e924c4fc24f878da0677a018f29202af326494be137d1d52c45c
MD5 28bc7cee195b40889f4c647e2c538292
BLAKE2b-256 27469124d96dd6fd2411afb93516e4b29476327ecb356d02b56552fc7767c781

See more details on using hashes here.

File details

Details for the file alyx_connector-2.1.46-py3-none-any.whl.

File metadata

  • Download URL: alyx_connector-2.1.46-py3-none-any.whl
  • Upload date:
  • Size: 80.4 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

Hashes for alyx_connector-2.1.46-py3-none-any.whl
Algorithm Hash digest
SHA256 9461f0065055a710ff7ed67ab12f4c031f94aa8e07638bea5c1322fed78558d3
MD5 cbd017809414f3a3e254f153a2b02c22
BLAKE2b-256 fb76059ea21c94e2286f52a5f005bdfdb02fe4f5d7b72fb2f283e14415ceefe6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page