Skip to main content

Personal collection of helpers and often-useful snippets for Python

Install the latest version with pip install -U “git+https://gitlab.com/hoverhell/pyaux.git#egg=pyaux”

Contains:

  • window: iterator over a ‘window’ of N adjacent elements

  • dotdict: attr→item dict subclass (e.g. for d.key instead of d[‘key’])

  • DebugPlug: recursive duck-object for debug and testing purposes

  • repr_call: convenient syntactically-appropriate representation of call arguments (also used in DebugPlug)

  • fxrange, frange, dxrange, drange: xrange() / range() equivalents for float (without error accumulation) and Decimal

  • dict_fget, dict_fsetdefault: versions of dict.get and dict.setdefault with lazy-computation of the default value

  • split_list: simple one-pass splitting of list into two by a condition

  • use_cdecimal: forced instance-wide use (by monkey-hack) of cdecimal instead of decimal (for performance)

  • use_exc_ipdb: set unhandled exception handler to run ipdb.pm()

  • use_exc_log: set unhandled exception handler to log (by logging) the exception and the stack trace including (when possible) the local variables.

  • use_colorer: monkey-patch logging for colored logging

  • obj2dict: recursive converter of tree-structure of classes into a tree-structure of dicts, e.g. for pretty-printing the result

  • mk_logging_property: make a property that debug-logs the value and caller info when set

  • Some other things that are too minor to be listed here.

Also, in separate submodules:

  • psql: helpers for saving Django ORM objects into an SQL ‘COPY’-like file and loading it in one SQL command (for high-performance loading of large amounts of data into the database)

  • lzmah: lzma compress (as function and as an executable file); also provides a function unjsllzma to stream-read (json) lines from a pylzma-compressed file

  • lzcat: lzcat for pylzma-specific format (as function and as an executale file)

  • runlib: various things for runscripts:

    • init_logging: logging.basicConfig with useful defaults (for development runscripts).

    • sigeventer: list-based signal handler for SIGINT and SIGTERM (for appending handler functions, similarly to atexit)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaux-5.1.0.tar.gz (84.7 kB view details)

Uploaded Source

Built Distribution

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

pyaux-5.1.0-py3-none-any.whl (97.5 kB view details)

Uploaded Python 3

File details

Details for the file pyaux-5.1.0.tar.gz.

File metadata

  • Download URL: pyaux-5.1.0.tar.gz
  • Upload date:
  • Size: 84.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyaux-5.1.0.tar.gz
Algorithm Hash digest
SHA256 d8c3eecf522954bf2f26e71a86b807389d88554e972dbaded523ee9ff7a24446
MD5 fed354e328b1c9607a59f5f50a204c14
BLAKE2b-256 a0262504f3ea7d8ff33af0e68bb81cf92264df11d7a46af9719ce60b40fea77d

See more details on using hashes here.

File details

Details for the file pyaux-5.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyaux-5.1.0-py3-none-any.whl
  • Upload date:
  • Size: 97.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyaux-5.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 634b20a79e91eeadf70d9090100230b9ff0ce4b35c5aa7ed11a731557795a579
MD5 74c9dc65cd3102999f1b36de68378836
BLAKE2b-256 f30ed9c85329d3e432577c5692b99dd2fe74aa1f2dd6f241b5418d11b76ec058

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

5.1.0 This release

2 files

5.0.0

2 files

4.0.0

2 files

3.3.0

2 files

3.1.0

2 files

3.0.0

2 files

2.11.0

2 files

2.10.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.1

1 file

2.4.0

1 file

2.3.1

1 file

2.3.0

1 file

2.2.0

1 file

2.1.0

1 file

2.0.0

1 file

1.15.0

1 file

1.14.0

1 file

1.13.0

1 file

1.12.0

1 file

1.11.0

1 file

1.10.0

1 file

1.9.0

1 file

1.8.0

1 file

1.7.2

1 file

1.7.1

1 file

1.7.0

1 file

1.6.0

1 file

1.5.0

1 file

1.3.2

1 file

1.3.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page