Install & Compatibility
Where this runs
tested against v0.9.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.092s · 18.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.086s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
log
✓ from pockets.autolog import log
camel
✓ from pockets import camel
✗ from pockets.string import camel
Functions are often hoisted to the top-level 'pockets' package for convenience, making direct submodule imports less common but still correct.
uncamel
✓ from pockets import uncamel
✗ from pockets.string import uncamel
Functions are often hoisted to the top-level 'pockets' package for convenience, making direct submodule imports less common but still correct.
resolve
✓ from pockets import resolve
✗ from pockets.inspect import resolve
Functions are often hoisted to the top-level 'pockets' package for convenience, making direct submodule imports less common but still correct.
iterpeek
✓ from pockets import iterpeek
✗ from pockets.iterators import iterpeek
Functions are often hoisted to the top-level 'pockets' package for convenience, making direct submodule imports less common but still correct.
groupify
✓ from pockets.collections import groupify
This quickstart demonstrates common string manipulation utilities like `camel` and `uncamel`, object resolution using `resolve`, and advanced iterator functionality with `iterpeek`.
from pockets import camel, uncamel, resolve, iterpeek
# String utilities
camel_case_str = camel("xml_http_request", upper_segments=[1])
print(f"Camel case: {camel_case_str}")
underscore_str = uncamel("XmlHTTPRequest")
print(f"Underscore case: {underscore_str}")
# Object resolution
list_class = resolve("builtins.list")
print(f"Resolved object: {list_class}")
# Iterator peeking
p = iterpeek(["a", "b", "c", "d", "e"])
print(f"Peek next: {p.peek()}")
print(f"Next item: {next(p)}")
print(f"Peek 3 items: {p.peek(3)}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pockets'
The 'pockets' library is not installed in the current Python environment.
ImportError: cannot import name 'log' from 'pockets' (unknown location)
The 'log' object is part of the 'pockets.autolog' submodule, not directly available from the top-level 'pockets' package.
fixfrom pockets.autolog import log
AttributeError: module 'pockets.string' has no attribute 'camel_case'
The 'pockets.string' module provides functions named 'camel' and 'uncamel' for string case conversion, not an attribute or function called 'camel_case'.
fixfrom pockets.string import camel
ImportError: cannot import name 'resolve' from 'pockets.object'
The 'resolve' function is located in the 'pockets.inspect' submodule, not a hypothetical 'pockets.object' submodule.
fixfrom pockets.inspect import resolve
Upgrade
Version history
0.9.1latest on PyPI · released Nov 2, 2019
Audit
Dependencies
sixrequiredUsed for Python 2/3 compatibility features in older versions; listed as a runtime dependency.