Skip to main content

A Python library to trim long URLs in code

Project description

URLTrim

A Python library to trim long URLs in your code while retaining their full functionality.

Installation

pip install urltrim

from urltrim import URLTrim

url = "https://www.example.com/some/very/long/path?query=123" link = URLTrim(url) # Default mode: domain + first path segment print(link) # Outputs: example.com/some print(link.get_full_url()) # Outputs: the full URL

Custom modes

link_domain = URLTrim(url, mode="domain") # Domain only print(link_domain) # Outputs: example.com

link_full = URLTrim(url, mode="full_path") # Full path print(link_full) # Outputs: example.com/some/very/long/path

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urltrim-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urltrim-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file urltrim-0.1.1.tar.gz.

File metadata

  • Download URL: urltrim-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for urltrim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5c065a3fd263269e069fcd0e54fd248b6dad3aaf5965df2034d38eb246b117e8
MD5 1d694f1f999f4e5508b8ce8d5293ff11
BLAKE2b-256 ae429ae3e62839562efaf89b823583c99114ef08da1446e3cf011a2d4e425ded

See more details on using hashes here.

File details

Details for the file urltrim-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: urltrim-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for urltrim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb2db18f9d03fc181f3ab727245c90c9e79de31f353b0fc41d8ee236ed88ec48
MD5 6ba39d8ef159916c249930145593b363
BLAKE2b-256 08dad4d1e3a2625703bd071fd76d0edf85eaddf74c2628bf4205fcab9deb5ad6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page