Metadata-Version: 2.1
Name: np-session
Version: 0.2.4
Summary: Tools for accessing data, metadata, and jobs related to ecephys and behavior sessions for the Mindscope Neuropixels team.
Author: Ben Hardcastle
Author-email: ben.hardcastle@alleninstitute.org
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3
Requires-Dist: backports.cached-property
Requires-Dist: np_logging (>=0.3.8)
Requires-Dist: psycopg2-binary (>=2,<3)
Requires-Dist: redis (>=4.5.1,<5.0.0)
Requires-Dist: requests (>=2,<3)
Requires-Dist: typing-extensions (>=4)
Project-URL: Bug Tracker, https://github.com/alleninstitute/np_session/issues
Project-URL: Repository, https://github.com/alleninstitute/np_session
Description-Content-Type: text/markdown

# np_session


### *For use on internal Allen Institute network*


```python
>>> from np_session import Session

# initialize with a lims session ID or a string containing one: 
>>> session = Session('c:/1116941914_surface-image1-left.png') 
>>> session.lims.id
1116941914
>>> session.folder
'1116941914_576323_20210721'
>>> session.is_ecephys_session
True
>>> session.rig.acq # hostnames reflect the computers used during the session, not necessarily the current machines
'W10DT05515'

# some properties are objects with richer information:
>>> session.mouse
Mouse(576323)
>>> session.project
Project('NeuropixelVisualBehavior')

# - `pathlib` objects for filesystem paths:
>>> session.lims_path.as_posix()
'//allen/programs/braintv/production/visualbehavior/prod0/specimen_1098595957/ecephys_session_1116941914'
>>> session.data_dict['es_id']
'1116941914'

# - `datetime` objects for easy date manipulation:
>>> session.date
datetime.date(2021, 7, 21)

# - dictionaries from lims (loaded lazily):
>>> session.mouse.lims
LIMS2MouseInfo(576323)
>>> session.mouse.lims.id
1098595957
>>> session.mouse.lims['full_genotype']
'wt/wt'

# with useful string representations:
>>> str(session.mouse)
'576323'
>>> str(session.project)
'NeuropixelVisualBehavior'
>>> str(session.rig)        # from `np_config` package
'NP.0'

```

