Skip to main content

A small, modern toolkit of data-wrangling helpers for cognitive-science workflows.

Project description

CogZen

A small, modern toolkit of data-wrangling helpers for cognitive-science workflows — a 2026 rewrite of the original cogzen package.

Importing cogzen is cheap: heavy libraries (pandas, scikit-learn, IPython) are imported lazily, only when the helper that needs them is first used.

Install

uv pip install cogzen          # or: pip install cogzen
uv pip install "cogzen[dev]"   # + pytest, ruff

Modules

All public submodules are named aux_*:

Module Highlights
cogzen.aux_sys chdir(locations) (host/user-aware), pushdir context manager
cogzen.aux_log Log0 — stdout + optional file logger
cogzen.aux_str clean_str + mapping presets, is_ascii, now(), regexes
cogzen.aux_pandas disp_df/repr_df, fix_column_names, split_dataframe, wine demo
cogzen.aux_srsly jsonable, yamlstr
cogzen.aux_bids dict_from_bids_filename
cogzen.aux_data bundled example data via importlib.resources

Quick start

import cogzen
from cogzen.aux_str import clean_str
from cogzen.aux_str.now import now

logZ = cogzen.Log0()
log0 = logZ.logger
log0.info(now())
log0.info(clean_str("  messy   text\n\n "))

Package data, the modern way

The bundled Emacs logo is an example of how data ships and is read — no __file__ path arithmetic, works even from inside a wheel/zip:

from cogzen import aux_data

png = aux_data.read_bytes(aux_data.EMACS_LOGO_PNG)   # bytes
svg = aux_data.read_text(aux_data.EMACS_LOGO_SVG)    # str

with aux_data.path(aux_data.EMACS_LOGO_SVG) as p:    # real Path when needed
    ...

Develop

uv sync --extra dev
uv run pytest
uv run ruff check .
uv run ruff format --check .

License

GPL-3.0-or-later © cogsys.io

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

cogzen-0.1.1.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

cogzen-0.1.1-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file cogzen-0.1.1.tar.gz.

File metadata

  • Download URL: cogzen-0.1.1.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for cogzen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1d146b216730b6465cec31347a0c73513e68e5db696a63a54067be84ec172023
MD5 4e130da7217e2c268847665b8f85ce1d
BLAKE2b-256 bd6d0f21fd6075105ac89f84af82664bdb5cb4293f505f324b3a79a0695d0d54

See more details on using hashes here.

File details

Details for the file cogzen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cogzen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for cogzen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91e1b4ac6169af78c79f2f043a1e38b85e5800a3c81093d7f2de3ced571c31f0
MD5 e7c779936091922f76b11174cfe02deb
BLAKE2b-256 5e3470dd3349010b1a4af25df4a0bfb312dd54677cdc52a63dbf23eaa84a81ce

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