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.4.tar.gz (4.4 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.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: urltrim-0.1.4.tar.gz
  • Upload date:
  • Size: 4.4 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.4.tar.gz
Algorithm Hash digest
SHA256 e5ea6d996a5d995f16239fbb19a16e942086cc1641b9991b4f9a347fa0565cb8
MD5 c8a9efb77d523b9f52f58cd22e8cba7d
BLAKE2b-256 65c884a3aaaacd8f6ef4d9f7344271de5948a129eb11dd87ce0174697779bb77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: urltrim-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a067fc632af4fda6dba877002b398cb2eee4bd4028cfe33c97d607c8a4e15705
MD5 65aff6e6e90c060b134f518e71070608
BLAKE2b-256 6bbe0a4533d8295205b3be77682449b4cb36e0ca9aa1984fdb232a03a13c5968

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