purrito
A Python wrapper for CatGt, providing a human-readable interface to generate command-line arguments for the CatGt tool.
Overview
CatGt is a command-line tool for preprocessing SpikeGLX data from Neuropixels probes. This wrapper simplifies the process of creating CatGt commands by allowing users to specify options in Python.
Installation
pip install purrito-catgt-wrapper
Import it in Python as:
from purrito import CatGt
For development:
pip install -e .
Usage
Basic Example
from purrito import CatGt
# Create a CatGt instance with basic parameters
catgt = CatGt(
basepath="/path/to/data",
run="g0",
gate=0,
trigger=0
)
# Check the command that will be executed
catgt.dry_run()
# Output: CatGt -dir=/path/to/data -run=g0 -g=0 -t=0
# Run catgt
catgt.run()
# Generate the command line string
Advanced Example with Options
from purrito import CatGt
# Create a CatGt instance with preprocessing options
catgt = CatGt(
basepath="/data/neuropixels",
run="g0",
gate=0,
trigger=0,
ap=True, # Process AP band
lf=True, # Process LF band
prb=0, # Probe index
prb_fld=True, # Probe folder
dest="/data/processed", # Output destination
)
cmd = catgt.build_command()
print(cmd)
Using with subprocess
import subprocess
from purrito import CatGt
catgt = CatGt(
basepath="/data/test",
run="g0",
gate=0,
ap=True
)
# Get command as list for subprocess
args = catgt.get_command_args(catgt_path="/usr/local/bin/CatGt")
# Run the command
# subprocess.run(args)
Features
- Intuitive Python API: Specify options using Python arguments
- Flexible Options: Support for boolean flags, string values, numeric values, and lists
- Native CatGt Flags: Uses CatGt's underscore-based option names such as
prb_fld - Path Handling: Automatically converts relative paths to absolute paths
- Command Generation: Generate command strings for direct use or subprocess execution
API Reference
CatGt Class
CatGt(basepath, run=None, gate=None, trigger=None, catgt_path="CatGt", **options)
Parameters:
basepath(str): Base directory path containing the SpikeGLX datarun(str, optional): Run name (e.g., "g0", "g0_t0"). If omitted, it is inferred frombasepathgate(int, optional): Gate indextrigger(int, optional): Trigger indexcatgt_path(str, optional): Path to the CatGt executable. Defaults toCatGt**options: Additional CatGt options as keyword arguments
Methods:
build_command(catgt_path="CatGt"): Build the complete command line stringget_command_args(catgt_path="CatGt"): Get command and arguments as a list for subprocess
Testing
Run tests using unittest:
python -m unittest discover tests
Or with pytest (if installed):
pytest tests/
Releasing to PyPI
This package is automatically published to PyPI when a new GitHub release is created. To create a new release:
-
Update the version number in:
purrito/__init__.py
-
Create a new GitHub release:
- Go to the repository's Releases page
- Click "Draft a new release"
- Create a new tag (e.g.,
v0.1.1) - Fill in the release title and description
- Click "Publish release"
-
The GitHub Actions workflow will automatically:
- Build the package
- Run quality checks
- Publish to PyPI
PyPI Setup (One-time)
Before the first release, you need to configure PyPI trusted publishing:
- Go to PyPI and create an account if you don't have one
- Create the
purrito-catgt-wrapperproject on PyPI (or wait for the first upload) - Go to your project's settings on PyPI
- Under "Publishing", add a new "trusted publisher"
- Configure it with:
- Owner:
eliezyer - Repository:
purrito - Workflow:
publish-to-pypi.yml - Environment: (leave empty)
- Owner:
This allows GitHub Actions to publish directly to PyPI without needing API tokens.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed in Rajasethupathy Lab
Metadata
Release files for purrito-catgt-wrapper 0.1.0
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 |
|---|---|---|---|---|
| purrito_catgt_wrapper-0.1.0.tar.gz | 9.0 kB | With provenance | Details for purrito_catgt_wrapper-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| purrito_catgt_wrapper-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for purrito_catgt_wrapper-0.1.0-py3-none-any.whl |
Total release size: 17.7 kB
Release files / purrito_catgt_wrapper-0.1.0.tar.gz
| Download URL | purrito_catgt_wrapper-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89a4154968621644b92df31f2e4fc777d6c08bb1306b18334bc643a1f272dd9c
|
|
BLAKE2b-256 checksum How to use checksums |
5d5f2590b2b20ee5a9b0c7489038be2c4413f0e9d65829a6895fa060d7252a3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.
Transparency logRelease files / purrito_catgt_wrapper-0.1.0-py3-none-any.whl
| Download URL | purrito_catgt_wrapper-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae5cb1783ce5a38a1ff80d806cee4b7e1e15a1b711226e46ca028122a0fd10c9
|
|
BLAKE2b-256 checksum How to use checksums |
df1d90e865aa4ddb93e9116dcc24ddcfc41ebf3294f1e6557a05eec91347e787
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.
Transparency logSecurity for purrito-catgt-wrapper 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for purrito_catgt_wrapper-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.
Transparency logA 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.