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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.12.tar.gz
Algorithm Hash digest
SHA256 3b200b75290a87e417b280e683315e1618cca687332736a8fe120ca0a5f4e98a
MD5 2b35b01ccb73b16c02a1cf3ee24115f4
BLAKE2b-256 ca2c0ebc268dc035ddea8dddce69748c63c95794f7cac961b2186587a5e90dd3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for permalint-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4f8b39914951ca07f39e17556f097ba03bc0d9a25f0267fd72d13611286f6700
MD5 3593d41bcade0a819f16ba97d786ef16
BLAKE2b-256 e85da5ab8d3383e7ea7755f14ba219790675e96f2315feec27eb3b23239b3d97

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