Registry / testing / pockets

pockets

JSON →
library0.9.1pypypi✓ verified 21d ago

The Pockets library is a collection of Python helper functions that streamline common development tasks. It provides utilities for logging, collections, datetime manipulation, object inspection, string operations, and iterators. The current version is 0.9.1, last updated in November 2019, suggesting a maintenance or slow release cadence.

pip install pockets
INSTALL
IMPORT
SIG · POCKETS
P
pockets
testingpythonv0.9.1
Install
1.6s avg
Import
89ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.092s · 18.1MB
glibc
py 3.103.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)}")
Debug
Known issues
breakingThe library's last update was in November 2019. While it aims for Python 2/3 compatibility, this old version may have compatibility issues or lack features with newer Python 3.x releases (e.g., Python 3.10+).
fix
Thoroughly test `pockets` in your target Python environment. Consider migrating to more actively maintained, purpose-built libraries for specific utilities if compatibility issues arise or if modern Python features are desired.
affects: <=0.9.1
gotchaThe `resolve` function, which converts a string name into a Python object, can be a security risk if the input string is from an untrusted source. Malicious input could lead to arbitrary code execution.
fix
Always restrict the search path by explicitly specifying the `modules` parameter when using `resolve` with user-provided input. E.g., `resolve('my_module.MyClass', modules=['my_module'])`.
affects: All versions
deprecatedSome classes in `pockets.iterators` were renamed in version 0.9 (e.g., `modify_iter` to `itermod`, `peek_iter` to `iterpeek`). While original names are still exported for backwards compatibility, relying on them might lead to issues in future versions if they are eventually removed.
fix
Use the new names (`itermod`, `iterpeek`) for clarity and future compatibility.
affects: >=0.9
gotchaThe library's reliance on `six` and notes about Python 2.6 specific behaviors (e.g., `groupify` returning regular dicts instead of OrderedDicts) suggest it was developed with older Python versions in mind. Using it in a modern Python 3-only project might introduce unnecessary overhead or less Pythonic patterns.
fix
Be aware of potential performance or style implications. For new Python 3 projects, evaluate if a more modern, Python 3-native utility library or built-in functions would be more appropriate.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pockets'
The 'pockets' library is not installed in the current Python environment.
fix
pip install pockets
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.
fix
from 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'.
fix
from 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.
fix
from 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.
Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
2
Resources
pockets — pip install pockets · libregistry