utilix-sdk
394 developer utility functions for Python: runs entirely locally, no API key required.
Installation
pip install utilix-sdk
Requires Python 3.11 or later.
Quick Start
Encoding
from utilix.tools.encoding import encode_base64, decode_base64
result = encode_base64("hello world")
# {"ok": True, "output": "aGVsbG8gd29ybGQ=", "inputBytes": 11, "outputChars": 16}
result = decode_base64("aGVsbG8gd29ybGQ=")
# {"ok": True, "output": "hello world", "outputBytes": 11}
Hashing
from utilix.tools.hashing import hash_all, hash_one
result = hash_all("my-secret")
# Returns MD5, SHA-1, SHA-256, SHA-384, SHA-512 digests in one call
sha256 = hash_one("SHA-256", "my-secret")
# {"ok": True, "algorithm": "SHA-256", "hex": "...", "bits": 256}
JSON Tools
from utilix.tools.json_tools import format_json, minify_json, yaml_to_json
pretty = format_json('{"name":"utilix","version":"0.1.0"}', indent=2)
# {"status": "valid", "output": "{\n \"name\": \"utilix\", ...", ...}
minified = minify_json('{\n "a": 1,\n "b": 2\n}')
# {"ok": True, "output": "{\"a\":1,\"b\":2}", ...}
as_json = yaml_to_json("name: utilix\nversion: 0.1.0")
# {"ok": True, "output": "{\"name\": \"utilix\", \"version\": \"0.1.0\"}"}
Color
from utilix.tools.color import hex_to_rgb, check_contrast, generate_palette
rgb = hex_to_rgb("#3B82F6")
# {"ok": True, "r": 59, "g": 130, "b": 246}
contrast = check_contrast("#FFFFFF", "#3B82F6")
# {"ratio": 3.94, "aa_normal": False, "aa_large": True, "aaa_normal": False, ...}
palette = generate_palette("#3B82F6", scheme="complementary")
# Returns list of hex colors forming a complementary palette
Media
from utilix.tools.media import compress_image, convert_image, read_image_info, read_exif_data, read_pdf_metadata, read_wav_info, read_id3_tags
with open("photo.jpg", "rb") as f:
image_bytes = f.read()
result = compress_image(image_bytes, quality=75, format="JPEG")
# {"ok": True, "output": bytes, "original_size": 204800, "compressed_size": 61440, "ratio": 0.3}
converted = convert_image(image_bytes, target_format="WEBP")
# {"ok": True, "output": bytes, "format": "WEBP"}
# Read format, dimensions, bit depth, and alpha channel straight from file
# bytes: no decoding, no Pillow required. Supports PNG, JPEG, GIF, WebP, BMP.
info = read_image_info(image_bytes)
# {"ok": True, "format": "jpeg", "width": 1920, "height": 1080, "bitDepth": 8, "colorType": "rgb"}
# Read camera make/model, orientation, timestamps, exposure settings, and
# GPS coordinates directly from a JPEG's EXIF data. JPEG only.
exif = read_exif_data(image_bytes)
# {"ok": True, "make": "Canon", "model": "EOS R5", "exposureTime": "1/125", "fNumber": 2.8, ...}
# Read title, author, dates, page count, and encryption flag from a PDF's
# trailer/Info dictionary: no PDF rendering library required.
with open("report.pdf", "rb") as f:
pdf_metadata = read_pdf_metadata(f.read())
# {"ok": True, "version": "1.7", "pageCount": 12, "title": "Q3 Report", "author": "Jane Doe", ...}
# Read sample rate, channels, bit depth, and duration from a WAV file's
# RIFF/fmt/data chunk headers: no audio library required.
with open("recording.wav", "rb") as f:
wav_info = read_wav_info(f.read())
# {"ok": True, "audioFormat": 1, "audioFormatLabel": "PCM", "channels": 2, "sampleRate": 44100, "bitsPerSample": 16, "durationSeconds": 12.4, ...}
# Read title, artist, album, year, genre, comment, and track number from an
# MP3's ID3 tags. Prefers ID3v2.3/2.4 text frames, falls back to the classic
# 128-byte ID3v1/1.1 trailer.
with open("track.mp3", "rb") as f:
id3_tags = read_id3_tags(f.read())
# {"ok": True, "version": "ID3v2.3.0", "title": "Track Name", "artist": "Artist Name", "genre": "Rock", ...}
CSS
from utilix.tools.css import generate_gradient, calc_specificity, minify_css
gradient = generate_gradient({
"type": "linear",
"angle": 135,
"stops": [{"color": "#667eea", "position": 0}, {"color": "#764ba2", "position": 100}]
})
# "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
specificity = calc_specificity("#nav .item:hover")
# {"score": (0, 1, 1, 1), "display": "0,1,1,1", "explanation": [...]}
minified = minify_css("body {\n margin: 0;\n padding: 0;\n}")
# {"ok": True, "output": "body{margin:0;padding:0}", "saved_bytes": 14}
Time Tools
from utilix.tools.time_tools import from_unix, diff_dates, get_next_runs
parsed = from_unix(1735689600)
# {"ok": True, "iso": "2025-01-01T00:00:00+00:00", "relative": "6 months ago", ...}
delta = diff_dates("2024-01-01", "2024-12-31")
# {"ok": True, "days": 365, "months": 12, "human": "12 months"}
schedule = get_next_runs("0 9 * * MON-FRI", count=5)
# Next 5 weekday 9am runs as ISO strings
Network
from utilix.tools.network import ip_to_decimal, cidr_info, is_valid_ipv4
decimal = ip_to_decimal("192.168.1.1")
# {"ok": True, "output": 3232235777}
subnet = cidr_info("10.0.0.0/24")
# {"ok": True, "network": "10.0.0.0", "broadcast": "10.0.0.255",
# "hosts": 254, "netmask": "255.255.255.0", ...}
print(is_valid_ipv4("256.0.0.1")) # False
from utilix.tools.network import parse_har
# Parse a DevTools .har network export into entries + summary stats
with open("network.har") as f:
result = parse_har(f.read())
# {"ok": True, "output": {"entries": [...], "summary": {"totalRequests": 12, ...}}}
Modules
| Module | Description |
|---|---|
encoding |
Base64, Base32, URL encoding/decoding, HTML entity encoding |
hashing |
MD5, SHA-1/256/384/512 digests, bcrypt password hashing, htpasswd |
json_tools |
JSON formatting, minification, diffing, CSV conversion, JSONPath, JSON Schema, YAML-JSON |
color |
Color conversion (hex/RGB/HSL/HSV), palettes, contrast ratios, shades/tints, blending |
css |
Gradients, box shadows, border radius, animations, cubic bezier, clamp, specificity, minifier |
media |
Image compression, format conversion, favicon generation, SVG optimization, header-based format/dimension reading, PDF metadata reading |
time_tools |
Unix timestamp parsing, cron expression parsing, date diffing, timezone conversion |
network |
IPv4 conversion, CIDR calculator, DNS lookup (DoH), IP geolocation, HAR file parsing |
api_tools |
cURL builder/parser, cURL-to-code, JWT decode/sign, JWKS parsing, HTTP status codes, CORS/CSP builders |
code |
Regex tester, SQL formatter, HTML formatter/minifier, GraphQL formatter, semver, URL parser, JS minifier |
data |
YAML, TOML, XML, CSV, INI, NDJSON, and .env file parsing, validation, and conversion |
generators |
UUID v4/v7, ULID, password generator, random data, QR code generation |
text |
Word counter, case converter, lorem ipsum, slugifier, string escaping, diff viewer, Markdown/HTML, passive voice detection |
misc |
Unicode analysis, ASCII art, Morse code, JSON-to-TypeScript/Go/Python/Zod schema generation |
units |
px/rem/vw conversions, byte formatter, number base conversion, aspect ratio, chmod calculator |
ai_agent |
Token estimate/trim, chunk text, extract URLs/JSON/keywords, sanitize HTML, flatten/merge JSON, dedupe lines, validate schema, PII/secret/injection detect |
Surface A vs Surface B
Surface A: this package (utilix-sdk)
Everything in this package runs locally in your Python process. There are no network calls for the core utilities (DNS lookup and IP geolocation are the only exceptions, and both hit public free APIs). No account, no API key, no rate limits.
pip install utilix-sdk
Ideal for: scripts, CI pipelines, offline environments, CLIs, and any situation where you want deterministic, zero-cost utility functions.
REST API (api.utilix.tech/v1)
The same 140+ tools are also available as a hosted REST API at https://api.utilix.tech/v1. This surface requires an API key and is subject to rate limits and pricing tiers.
curl -X POST https://api.utilix.tech/v1/tools/hash \
-H "Authorization: Bearer $UTILIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "hello world", "algorithm": "sha256"}'
- Free: 1,000 requests/day: no credit card required
- Pro: 10,000 requests/day: $9/month
- Try it live at utilix.tech/api: no signup needed for the first 10 endpoints
- Get your API key at utilix.tech/dashboard
Ideal for: polyglot teams, environments where installing Python packages is not possible, and browser-based tooling that needs a backend.
Contributing
The source for this package is maintained in a private monorepo; this repository holds examples, quickstarts, and the issue tracker. Found a bug or want to request a tool? Open an issue at github.com/utilix-tech/utilix-sdk/issues or email hello@utilix.tech.
Publishing to PyPI
Build the distribution
python -m build
# Produces dist/utilix_sdk-x.y.z.tar.gz and dist/utilix_sdk-x.y.z-py3-none-any.whl
Test on TestPyPI first
python -m twine upload --repository testpypi dist/*
# Install from TestPyPI to verify
pip install --index-url https://test.pypi.org/simple/ utilix-sdk
Publish to PyPI
python -m twine upload dist/*
GitHub Actions with OIDC trusted publisher (recommended)
Store no tokens. Configure a trusted publisher on PyPI (Settings > Publishing > Add a new publisher) and use the official PyPA action:
# .github/workflows/publish.yml
name: Publish to PyPI
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build
run: |
pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No api-token needed: OIDC trusted publisher handles auth
Tag a release (git tag v0.2.0 && git push --tags) and the workflow publishes automatically with no stored credentials.
License
MIT. See LICENSE for the full text.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file utilix_sdk-0.8.0.tar.gz.
File metadata
- Download URL: utilix_sdk-0.8.0.tar.gz
- Upload date:
- Size: 224.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d8cfd551f4ada27be6cb876ddbe3891ae0963a786a2ec1df7708d333a34def6
|
|
| MD5 |
d8a7e868d4e3f461fe601e1e9f1518a8
|
|
| BLAKE2b-256 |
b82891c08bf55f0d3bfb9e9e6c02edc5414d2ea0a6bc87b338f41cb50d853326
|
Provenance
The following attestation bundles were made for utilix_sdk-0.8.0.tar.gz:
Publisher:
ci.yml on utilix-tech/utilix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
utilix_sdk-0.8.0.tar.gz -
Subject digest:
1d8cfd551f4ada27be6cb876ddbe3891ae0963a786a2ec1df7708d333a34def6 - Sigstore transparency entry: 2095495764
- Sigstore integration time:
-
Permalink:
utilix-tech/utilix@7ffcc225b172c4e28ff04350e17554716eac3671 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/utilix-tech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7ffcc225b172c4e28ff04350e17554716eac3671 -
Trigger Event:
push
-
Statement type:
File details
Details for the file utilix_sdk-0.8.0-py3-none-any.whl.
File metadata
- Download URL: utilix_sdk-0.8.0-py3-none-any.whl
- Upload date:
- Size: 150.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5161126c9b16b50a580a5fe407cef15fcff16a47668192092dea1d20527d4603
|
|
| MD5 |
362215597756d9bc3a83e521e0930371
|
|
| BLAKE2b-256 |
4b4b93ec51074317c7681af12b2062ce57c4718e9279e38290e02fe98c2b29ca
|
Provenance
The following attestation bundles were made for utilix_sdk-0.8.0-py3-none-any.whl:
Publisher:
ci.yml on utilix-tech/utilix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
utilix_sdk-0.8.0-py3-none-any.whl -
Subject digest:
5161126c9b16b50a580a5fe407cef15fcff16a47668192092dea1d20527d4603 - Sigstore transparency entry: 2095496649
- Sigstore integration time:
-
Permalink:
utilix-tech/utilix@7ffcc225b172c4e28ff04350e17554716eac3671 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/utilix-tech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7ffcc225b172c4e28ff04350e17554716eac3671 -
Trigger Event:
push
-
Statement type: