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.0.tar.gz (3.9 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.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: urltrim-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 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.0.tar.gz
Algorithm Hash digest
SHA256 3f8db44c0d71961813cecb1856f0cd6b4324fcfba306a9e0cdc93402cca496c8
MD5 98e7738fabcebec5b599d20c14c7e0ec
BLAKE2b-256 438a1c1011f4f53453b8c790bcc19fa88db20348e977895b1d75857e5c868e8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: urltrim-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 328bf8619020d1e682ebf81f82b500f694bcceed310934686987de605cd7bba0
MD5 56d08478e4c0a4020b2e334b7f3961e6
BLAKE2b-256 d12ba905cfddde951265bb35bdabeb7087072255eff9eeee67ec3ef21dbcc970

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