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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.9.tar.gz
Algorithm Hash digest
SHA256 40b9069b2cfe97312d3e846d8c7a882843ebd268555634065ba120dffcfba41e
MD5 479a7ed0f7f198ce2a989493b7a11cc9
BLAKE2b-256 afd78eaa5f87a23a0f7c7d88a9f1c949c6bc06a0ddc7cda9dac070039dc4affd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4edb6dfe84fd613530914d5c4c2733a968b3ae47d076c0c5586c950751f28332
MD5 5bee8501b5cbc289b1b540ab98708061
BLAKE2b-256 b4c9495d37a924f8cbdeffa4a0ab5182b2d3b957d64261621f0a73bb8ed21233

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