Skip to main content

Framework-agnostic canonical URL normalization and SEO payload generation

Project description

seoslug

DeepWiki

Canonical URL normalization and deterministic SEO payload generation for content platforms.

Installation

pip install seoslug

For local development:

pip install -e .

Quick usage

from seoslug import SEOConfig, URLPolicy, SEOEntity, build_seo_payload

config = SEOConfig(
    canonical_host="portal.example.com",
    public_base_url="https://portal.example.com",
    url_policy=URLPolicy(
        enforce_https=True,
        lowercase_paths=True,
        trailing_slash="never",
        collapse_duplicate_slashes=True,
        strip_tracking_params=True,
        allowed_query_params=["page", "q"],
    ),
    default_og_image="https://cdn.example.com/default.jpg",
)

entity = SEOEntity(
    entity_type="post",
    slug="my-post",
    title="My Post",
    excerpt="Example excerpt",
    body_html="<p>Body content</p>",
    status="published",
    featured_image="https://cdn.example.com/post.jpg",
)

payload = build_seo_payload(entity, "/posts/my-post", config)

Full docs, API reference, and usage examples are in docs/ and published with MkDocs.

License

MIT, see LICENSE.

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

seoslug-1.0.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seoslug-1.0.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file seoslug-1.0.1.tar.gz.

File metadata

  • Download URL: seoslug-1.0.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for seoslug-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4637fac5688070433235b5993e1bc9905543149b26fdc4d3ea60e01c05ba2801
MD5 da4944a1ff38b975c41e9a2ed4cf5010
BLAKE2b-256 7681194a0a2c80da1a5512cb7f739b98fbd21a206d5fbaef548e83e72c30700e

See more details on using hashes here.

File details

Details for the file seoslug-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: seoslug-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for seoslug-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d1aa63e3613fadd466ab729bf486013db8721d869b6475c69b5b143b79cec33
MD5 20514351ac6d4107a83d681469ae3a78
BLAKE2b-256 4c10bce3307e7a7e95385168700f40f44819e3a2b0290eab355d42dd468030dd

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