Skip to main content

Lint URLs

Project description

permalint

Lint URLs (mostly for teaxyz/chai, but hopefully other uses too)

Features

  • Ignores protocol (http, https, etc.)
  • Normalizes GitHub URLs to owner/repo
  • Removes query strings and fragments
  • Lowercases domains and removes www

Usage

from permalint import normalize_url

url = "https://github.com/user/repo?utm_source=foo#readme"
print(normalize_url(url))  # Output: github.com/user/repo

Development

  • Install dependencies: pkgx rye sync
  • Run tests: pkgx rye run pytest
  • Lint: pkgx ruff check src/
  • Type check: pkgx ty src/

Contributing / Wishlist

  • guess-canonical-url to guess the correct URL based on a passed list of URLs
  • actual source of Homepages for

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

permalint-0.1.8.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

permalint-0.1.8-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file permalint-0.1.8.tar.gz.

File metadata

  • Download URL: permalint-0.1.8.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.5

File hashes

Hashes for permalint-0.1.8.tar.gz
Algorithm Hash digest
SHA256 2a35c6058e25d9454be475d7e44e0035c18588f2296012cbd66d8814c48f39f4
MD5 1dc0910f6022ef36be5002992a761193
BLAKE2b-256 5e195d80f6149903d11071abc1f69a80c2e36a7f8d7ea23c208015d30ac33d9e

See more details on using hashes here.

File details

Details for the file permalint-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: permalint-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.5

File hashes

Hashes for permalint-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ec86581edea460276c5109be64d41a81871167e4773ea1168885ef4a2a98c4a7
MD5 58aa8c96d43fb99fb72b29c23404c5b4
BLAKE2b-256 c4f8a47dfdf1d58eb7399977737ac7fdd4d0432436aad9d4bb6de616bc63d046

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