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.13.tar.gz (22.5 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.13-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.13.tar.gz
Algorithm Hash digest
SHA256 178ed77a0d0dbfbce0de0445764204e1b91c1b58343d7dfd478ec429809b9771
MD5 1fc2cb7d596fbb75d63a7824eee009ac
BLAKE2b-256 8d9ffbb7f6bb7e7c1bf007c6b8581ab1dd330f12b34d81c7f7f84168d5a03006

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 9c562418148b61f47cc086b6f47544d808787630c53f0b90ac5adf357da6039e
MD5 6379c8f840402bce9263bd346b6f9889
BLAKE2b-256 ef33808670427af39e95cd1626694c82a8db0c3176ea56f22f4df8ac26ce592a

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