Skip to main content

hunterMakesPy

Utilities for converting mixed input to integers, calculating CPU limits, handling None values, importing code dynamically, and manipulating nested data.

pip install hunterMakesPy

Validate, Convert, and Parse Inputs

Convert Mixed Input to Validated Integers

Accepts strings, floats, complex numbers, and binary data and returns a list of validated integers. Ambiguous or incompatible values produce descriptive errors.

from hunterMakesPy.parseParameters import intInnit

ports = intInnit(["8080", 443, "22"], "server_ports")
# Returns: [8080, 443, 22]

Calculate Concurrency Limits from Flexible Specifications

Pass 0.75 for 75% of CPUs, True for 1 CPU, 4 for exactly 4 CPUs, or -2 to reserve 2 CPUs.

from hunterMakesPy.parseParameters import defineConcurrencyLimit

workers = defineConcurrencyLimit(limit=0.75)  # 6 on an 8-core machine

Interpret Strings as Boolean or None

Parse string values such as "true", "false", or "none" into their Python equivalents without raising exceptions on mismatch.

from hunterMakesPy.parseParameters import oopsieKwargsie

oopsieKwargsie("True")   # Returns: True
oopsieKwargsie("none")   # Returns: None
oopsieKwargsie("hello")  # Returns: "hello"

Eliminate None with Runtime Validation

Convert Type | None return annotations to Type by raising at runtime if the value is None. Removes None-checking noise from downstream code and satisfies type checkers.

from hunterMakesPy import raiseIfNone

config = raiseIfNone(getConfig(), "Missing configuration")

Replace Ambiguous Numeric Literals with Semantic Names

Use decreasing instead of -1, inclusive for boundary adjustments, and zeroIndexed for index conversions. Intent becomes explicit and the code reads as prose.

from hunterMakesPy import decreasing, inclusive, zeroIndexed

rangeEnd = lengthSequence + inclusive
indexLast = lengthSequence - zeroIndexed
step = decreasing

Import Modules by Dot-Notation Path or File Path

Load functions or classes from "scipy.signal.windows" or "path/to/file.py" without manual module-loading boilerplate.

from hunterMakesPy.filesystemToolkit import importLogicalPath2Identifier

windowFunction = importLogicalPath2Identifier("scipy.signal.windows", "hann")

Create Directories Safely and Write Files with Formatting

Write to "deep/nested/path/file.txt" and parent directories are created automatically. writePython removes unused imports and sorts import statements before writing.

from hunterMakesPy.filesystemToolkit import writeStringToHere, writePython

writeStringToHere("content", "nested/dirs/file.txt")  # Creates dirs
writePython(sourceCode, "output/module.py")           # Formats, then writes

Extract Strings from Arbitrarily Nested Data

Recursively traverse dictionaries, lists, tuples, and sets and collect every string value into a flat list.

from hunterMakesPy.dataStructures import stringItUp

strings = stringItUp({"users": ["alice"], "config": {"host": "localhost"}})
# Returns: ["users", "alice", "config", "host", "localhost"]

Merge Dictionaries with List Values

Combine {"a": [1, 2]} and {"a": [3], "b": [4]} into {"a": [1, 2, 3], "b": [4]} with optional deduplication and sorting.

from hunterMakesPy.dataStructures import updateExtendPolishDictionaryLists

merged = updateExtendPolishDictionaryLists(
    {"servers": ["chicago"]},
    {"servers": ["tokyo", "chicago"]},
    destroyDuplicates=True,
)
# Returns: {"servers": ["chicago", "tokyo"]}

Compress NumPy Arrays to Self-Decoding Strings

Encode repetitive patterns and consecutive sequences using run-length encoding and Python range syntax. The resulting string evaluates back to the original data.

from hunterMakesPy.dataStructures import autoDecodingRLE

encoded = autoDecodingRLE(arrayTarget)

Configure Package Metadata at Runtime

PackageSettings reads pyproject.toml automatically to resolve the package name and installation path.

from hunterMakesPy import PackageSettings

settings = PackageSettings(identifierPackageFALLBACK="myPackage")

Reuse Test Suites for Custom Implementations

Import parameterized test generators to validate custom functions that match the expected signatures.

from hunterMakesPy.tests.test_parseParameters import PytestFor_intInnit

@pytest.mark.parametrize("test_name,test_func", PytestFor_intInnit(myFunction))
def test_my_integer_validator(test_name, test_func):
    test_func()

My recovery

Static Badge YouTube Channel Subscribers

CC-BY-NC-4.0

Release files for hunterMakesPy 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hunterMakesPy 0.7.3
File Size Uploaded
huntermakespy-0.7.3.tar.gz 48.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hunterMakesPy 0.7.3
File Interpreter ABI Platform
huntermakespy-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size:100.8 kB

Release files / huntermakespy-0.7.3.tar.gz

Download URL huntermakespy-0.7.3.tar.gz
Size 48.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e265149cb316ce97dbd44068a05dd0f9822190fbe0b9d6e8a2dee60c126d0855
BLAKE2b-256 checksum
How to use checksums
a3b8ee49c1d5a358286e2b2db12f7f2d82fc8ff43254712037308d72f3918fef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / huntermakespy-0.7.3-py3-none-any.whl

Download URL huntermakespy-0.7.3-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f359c25adaff8e27fc30640d903d4dfa3ea8ef3d977bc4f45d7561657661c22e
BLAKE2b-256 checksum
How to use checksums
737de2bc57bc529ee200d69228d75ca04e3d51c90a50f7f804f60ce406d846e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

1 release file

0.6.0

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.8

1 release file

0.4.7

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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