Skip to main content

pyurlmapper

URLMapper — lightweight library to map and proxy URLs and optionally provide a small DNS mapper for local testing.

Features

  • URLMapper: simple HTTP proxy to map alias URL -> target URL (handles headers, query strings, binary bodies, streaming).
  • DNSMapper: minimal DNS responder using dnslib for mapping hostnames to IPs (useful for local networks/tests).
  • Ready-to-publish packaging (pyproject, setup.py, LICENSE, README).

Install (development)

pip install -e .
# or for runtime:
pip install flask requests dnslib

Quick example

from urlmapper import URLMapper, DNSMapper

# DNS (optional): resolve web.servermon -> 192.168.15.9 (for clients you control)
dns = DNSMapper()
dns.add_record("web.servermon", "192.168.15.9")
dns.start_background(listen_host="0.0.0.0", port=5353)  # uses 5353 for tests (non-root)

# Proxy: forward requests from alias to real service
mapper = URLMapper()
mapper.translate_url("http://192.168.15.9:5000", "http://web.servermon:5000")
mapper.run(host="0.0.0.0", port=5000)

See tests/example_usage.py for a runnable example.

License

MIT

Metadata

Release files for pyurlmapper 0.1.0

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

Source distribution (sdist)

Source distribution for pyurlmapper 0.1.0
File Size Uploaded
pyurlmapper-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

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

Total release size: 9.8 kB

Release files / pyurlmapper-0.1.0.tar.gz

Download URL pyurlmapper-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
585132041bbac6f5fab47504e9edfc126138cd54e3c1f6209356446ff4d61283
BLAKE2b-256 checksum
How to use checksums
3c1368cef44d688bb7942b1e50b52373a8add418edec5dbc54d2a08385cc6363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pyurlmapper-0.1.0-py3-none-any.whl

Download URL pyurlmapper-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10772d5ab5cad7563ff8f1b112424e310c27acfb4dc122764db73ea708c81544
BLAKE2b-256 checksum
How to use checksums
347d875feb28f1ddcfa711d6dc27a73a4d23c875a186d85b1398403ba0edb032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

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