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.4.tar.gz (13.3 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.4-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6712c1c4afa538a79ee7d3c4aa124dbc3a20be590fb0be806807a020347ba6cc
MD5 0ae809795057a356d2eb92e148c7a867
BLAKE2b-256 96449a7175b3c573f438981819eeb12e2e81f0305ee9bcd7526b5dde1718bf1f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cee35d8c73bf4e254242148f8f384390a1535d8dda280d7b23d9a737936a5357
MD5 9d274c7cc6d60898a2c4da02c2627ba3
BLAKE2b-256 99cc52c1a07c5b1266b83eafbd38e8503107002a59436d603c493285959d2e12

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