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

Uploaded Python 3

File details

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

File metadata

  • Download URL: urltrim-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 91fcf5acb4f33055ca29d0e82cf64c5bb4b75f03cb6ccddf8a6bffb18bf4f51a
MD5 5030f4dd0c4e4744c6852c8ea15ceea6
BLAKE2b-256 fc92afe6e9d1325793ea5655ba912588a7ba16f89673934417c6fe9fd1c161df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: urltrim-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b3bf53da0096a5c547e5fb6d0035c81c23ecb3042988300fc784bab2bc8754a6
MD5 4366819f3d2e71685cf71e571853a1cb
BLAKE2b-256 5dc6d9806dd2388b6eb62aa3d7500deb44280ab18c036b9e62bc8ad75068c259

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