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.44.tar.gz (85.4 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.44-py3-none-any.whl (76.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alyx_connector-2.1.44.tar.gz
  • Upload date:
  • Size: 85.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.25.9 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for alyx_connector-2.1.44.tar.gz
Algorithm Hash digest
SHA256 66834d1bd4e267e67d9584ad32d8ef0c80eeb9e932574b5d26219dfa70405fcb
MD5 e92e5266bdba3a34fc73efad840dc115
BLAKE2b-256 1d9e3b993cee76dbf1f5fa260f81042622cf0d33de820346aaa8b4b006472508

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alyx_connector-2.1.44-py3-none-any.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.25.9 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for alyx_connector-2.1.44-py3-none-any.whl
Algorithm Hash digest
SHA256 7f0696f497a03d291f35bc59580860b6b5d6b593063c3c3ca102f9b8d625f22c
MD5 2610ebff3a2dc27195bd53af978d1cd4
BLAKE2b-256 fe5810129c1c129a455de9b00878bd0b9eb3b8889cf6f8c914b9330b77d30909

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