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.15.tar.gz (23.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.15-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.15.tar.gz
Algorithm Hash digest
SHA256 e7393d4e1a8e01bfc294607a16046af252c4d9bfba235278047a5710a19bf8a1
MD5 3fa4a37934575959a645c15c639b0785
BLAKE2b-256 4bad1baa79cb0026c049c46df25638fb3d6603803ab3d3c9833438776e832f87

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 f0317c4891e486fd1bc50ad4525a84100b50b819304eadb757808935072c62ac
MD5 2e86a45b7feecbdb34a4eeb75b02aff3
BLAKE2b-256 4c1c5cffa3ffdff4e6fe891b04d5c74223898aef0d3884a5608b4f03f36b42ff

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