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

Uploaded Python 3

File details

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

File metadata

  • Download URL: permalint-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 fb0112dcfd2f041c38f87fde68a4ff4c23afa2f326725f6abee8105beb5f94ec
MD5 01d6073e396b70b63516e9a755901c29
BLAKE2b-256 c297a9c5a4f4ded64deb8084fd413e091b9ecf7c4f3d4cdc3ba8fb23af07905b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: permalint-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 63aedc0a8cd54d3a41c2bd3e7c48a2712eba625205f78557ad106fb8d2cd0760
MD5 4fd46bcb6a19c30182ba2adc5294bc55
BLAKE2b-256 75a9d6e479b5cabd113c4308054b3399f06f50244e6a2da3413ccb803b1180cc

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