Skip to main content

justin_utils

Shared utility library for the Justin Python ecosystem. Provides reusable building blocks for filesystem operations, CLI tooling, functional sequences, EXIF handling, and more — designed to be installed as a lightweight dependency across multiple projects.

Requirements

Python 3.11+

Installation

pip install justin_utils

To install only specific modules and their dependencies, use extras:

pip install "justin_utils[filesystem]"
pip install "justin_utils[exif,sources]"

For development:

pip install -e ".[test]"

Modules

filesystem

File and Folder wrappers over pathlib.Path with move/copy/rename operations, cross-drive detection, and recursive tree handling. RelativeFileset preserves relative paths when moving groups of files.

util

General-purpose functions: sequence operations (distinct, flatten_lazy, group_by, stride, first), date/time parsing, BFS traversal, user prompts (ask_for_permission, ask_for_choice), and keydefaultdict — a dict subclass with a key-dependent default factory.

pylinq

Lazy Sequence wrapper with a LINQ-style API: filter, map, flat_map, group_by, distinct, take, skip, reduce, any, and terminal operations like to_list, to_dict, to_set.

joins

SQL-style join operations over arbitrary iterables: inner, left, right, full_outer.

exif

EXIF metadata extraction from image files via Pillow and the exif library. parse_exif auto-selects the parser by file extension. exif_sorted sorts a sequence of paths by date taken.

sources

Photo source abstraction: groups raw files (NEF, RAF, ARW) with their XMP sidecar metadata, and JPEG/TIFF/DNG/HEIC files with embedded metadata. parse_sources returns a flat list of Source objects ready for sorting or moving.

transfer

TransferSpeedMeter tracks a rolling transfer speed over recent history. TransferTimeEstimator estimates remaining time given current speed and remaining size.

data

DataSize and DataSpeed with human-readable formatting (B/KB/MB/GB and per-second variants).

time_formatter

format_time(delta) — formats a timedelta as a human-readable string ("X h", "Y m", "Z s").

singleton

Singleton abstract base class. Subclasses get a single cached instance via .instance().

json_migration

JsonMigrator applies versioned migrations to JSON objects in order, updating the stored version key after each step.

cli

Lightweight argparse wrapper: App, Command, Action, Parameter. Supports multi-action commands and typed parameters.

CLI tools

Two command-line utilities are installed as entry points:

parts — manages numbered folder structures (01.name, 02.name, …):

parts make <count>       create N numbered folders
parts renumber           renumber existing parts sequentially
parts offset <n>         shift all part indices by n

sf — moves files into a named subfolder:

sf <subfolder>

Download files

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

Source Distribution

justin_utils-0.2.1.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

justin_utils-0.2.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file justin_utils-0.2.1.tar.gz.

File metadata

  • Download URL: justin_utils-0.2.1.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for justin_utils-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f6a47f8678ca54d41f0adbf0bdfc04e3a092c2d17001eae0cc6a70692ad41096
MD5 ec522240e50cb6930bf4d5b295815aa4
BLAKE2b-256 8f5567805fcf50d72d42fff900730c1c9a4a6709a4cb75553c0ba6f2d6e43b34

See more details on using hashes here.

Provenance

The following attestation bundles were made for justin_utils-0.2.1.tar.gz:

Publisher: release.yml on djachenko/justin_utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file justin_utils-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: justin_utils-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for justin_utils-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cba87b3f30a6501929cb6c62df5b4eacb454c252a2ec70be8ba3eff4ec5d38c
MD5 a5de7cc06527674f0ffa525073af6c22
BLAKE2b-256 7877e9ed6932c8a329e6b348f96af5c06587fd76717a29c8141cb7957ea43b5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for justin_utils-0.2.1-py3-none-any.whl:

Publisher: release.yml on djachenko/justin_utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page