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.0.tar.gz (27.9 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.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cogzen-0.1.0.tar.gz
  • Upload date:
  • Size: 27.9 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.0.tar.gz
Algorithm Hash digest
SHA256 98f23eaecf78adeb7bbb62a12894bcaa89b4eaddf435cd994fc2dc5d34b1de27
MD5 73b790ba3aba168ccce139417e07a7c3
BLAKE2b-256 eef417356b72ca1649eedfd55981f5857c89c77971fa3bfe274edea41575ce24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cogzen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e640e71fa0ff0e86f3f6737f4602f6715e291498dc90628a452a49566324d2bc
MD5 b13e7854e3a94afe3650631df11ec657
BLAKE2b-256 bff6a0a31329f88d3cde28b163495dec4e479b76cced86db6195cb0fa92fcc95

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