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.2.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.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: urltrim-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8494c95e16829d4a745e5d27f5c43c7ec5caf8e485cb74d25fb7e38292962648
MD5 11a176196f2f056d8687830031e1d0ab
BLAKE2b-256 5bd431d27b0b513984c0cb9345fbf32420dddd6dfb3df2626bb2fbac4b29d288

See more details on using hashes here.

File details

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

File metadata

  • Download URL: urltrim-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd4c7ce57f013d7e9bc12071e16006713fe18948ee6b81ac14206c1ea3cd07e
MD5 81cc429ddc000193d5bd24fee8978cac
BLAKE2b-256 09f35aeeeab338b68d2061cfe6c1767312d4daeae89b9dc24f0a588129d38687

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