Skip to main content

Shadow Tools

shadow-tools is a lightweight Python toolbox for everyday apps and scripts. It keeps the basics in one clean package without trying to replace specialized libraries.

Install

pip install shadow-tools
pip install "shadow-tools[websocket]"  # optional WebSocket client

What is included

  • HTTP requests with no required third-party dependency
  • WebSocket connections through an optional extra
  • Async execution for blocking jobs
  • File and directory helpers
  • JSON and CSV reading/writing
  • Email, URL, and required-key checks
  • DNS lookup, subdomain parsing, and documentation-only test IPs
  • Provider-neutral AI prompt and tool-schema helpers
  • shadow command-line tool

Quick start

from shadowtools import get, write_json, is_email

response = get("https://api.github.com")
print(response.status, response.json())
write_json("output.json", {"ready": True})
assert is_email("person@example.com")

DNS, subdomains, and test IPs

from shadowtools import generate_random_ips, generate_test_ips, make_subdomain, resolve_dns

print(make_subdomain("api", "example.com"))  # api.example.com
print(resolve_dns("example.com"))
print(generate_test_ips(2))  # safe documentation-only addresses
print(generate_random_ips(5))  # mixed private, public, and special IPv4 addresses
print(generate_random_ips(3, family=6))

Reverse-DNS lookup for IP addresses:

from shadowtools import generate_random_ips, reverse_dns

for ip in generate_random_ips(5):
    print(reverse_dns(ip))

# Or look up every generated IP at once.
print(reverse_dns(generate_random_ips(5)))

AI app helpers

from shadowtools.ai import prompt, tool_schema

message = prompt("Explain {topic} in {words} words.", topic="DNS", words=50)
search_tool = tool_schema(
    "search_docs", "Search internal documentation",
    {"query": {"type": "string"}}, required=["query"]
)
shadow get https://api.github.com --json
shadow json-format settings.json

WebSockets

from shadowtools.websocket import connect

socket = connect("wss://example.com/socket")
socket.send("hello")
print(socket.recv())
socket.close()

Release

Build locally with python -m build, then publish only after reviewing the generated distributions and confirming the PyPI project name is available.

License

MIT

Metadata

Release files for shadow-tools 0.2.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 shadow-tools 0.2.3
File Size Uploaded Provenance Actions
shadow_tools-0.2.3.tar.gz 110.6 kB Without provenance Details for shadow_tools-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shadow-tools 0.2.3
File Interpreter ABI Platform Actions
shadow_tools-0.2.3-py3-none-any.whl Python 3 none any Details for shadow_tools-0.2.3-py3-none-any.whl

Total release size: 121.1 kB

Release files / shadow_tools-0.2.3.tar.gz

Download URL shadow_tools-0.2.3.tar.gz
Size 110.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5b06c89430688e2ac7831d76f3b48421fddcd88464e2fde8426d21a936d3fe09
BLAKE2b-256 checksum
How to use checksums
e4640b2403fdd67c8be50304d32f1f8c5d9e3c71c40a52422b0cc05726da80cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / shadow_tools-0.2.3-py3-none-any.whl

Download URL shadow_tools-0.2.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c1e401a500502e2b9a7b9e2a395a9d3ba8161565b4133b329d498167058310e
BLAKE2b-256 checksum
How to use checksums
71106bb33c8bb6684f103d84b6534348ca1894c7296825eb507cf97bf9d4d1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for shadow-tools 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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