skillfed

smartypants

Python with the SmartyPants

smartypants v2.0.2 232.6K downloads/30d#9,062 on PyPI44
Permissive license BSD License AGING released

What it is and what it does

smartypants is a Python port of the original SmartyPants text filter. It transforms plain-text punctuation into typographically correct HTML entities—converting straight quotes to curly quotes, replacing hyphens and double-hyphens with en-dashes and em-dashes, and handling other common typographic improvements. It works as both a Python module and a command-line tool, making it useful for preprocessing text before publishing to the web or for document generation pipelines.

The package has no external dependencies and installs with low friction. It is classified as Production/Stable and has been maintained since 2008, though releases are infrequent. The repository remains active, indicating the project is mature and unlikely to break, but the aging maintenance status suggests it is not under active feature development.

Use it for:

  • Preprocess blog post or article text before publishing to ensure professional typography in HTML output
  • Filter user-generated content in web applications to improve readability without requiring manual editing
  • Convert plain-text documentation or markdown to typographically correct HTML for static site generators
  • Clean up text in content management systems to standardize punctuation across published material
  • Process text files from legacy systems or plain-text sources before importing into publishing platforms

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts plain-text punctuation to typographically correct HTML entities—replacing straight quotes with curly quotes, hyphens with em-dashes, and similar transformations for improved typography in web and document output.

Yes, if you need simple, dependency-free text punctuation normalization for web or document output. The permissive BSD License, zero runtime dependencies, and stable codebase make it a low-risk addition. The aging maintenance is not a concern for a mature, narrow-purpose tool, but verify that its punctuation rules match your typographic requirements before committing to it in a pipeline.

Install

smartypants on PyPI

pip

pip install smartypants

uv

uv add smartypants

poetry

poetry add smartypants

Installing smartypants

Before you install

Low install friction with no runtime dependencies. Maintenance is aging—last release was 423 days ago—but the repository remains active with a recent commit on 2025-06-17, suggesting the project is stable rather than abandoned.

License in practice

BSD License (permissive) allows free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

import smartypants

text = '"Hello" -- world\'s best'
result = smartypants.smartypants(text)
print(result)

Verify before relying

  • Whether Python 2 support is actively maintained or merely declared in classifiers
  • Performance characteristics on large text volumes or streaming input
  • Customization options for which punctuation transformations to apply
  • Specific HTML entity output format and which punctuation rules are applied

Package facts

License BSD License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 423 days since the last release
Last repo commit
First released
Downloads 232,590/month — #9,062 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: smartypants-2.0.2-py2.py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: End Users/DesktopLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Text Processing :: Filters

Tags

smart quotes and dashestypography text processinghtml entity conversioncurly quotes em-dashtext punctuation formattingsmartypants typographytypographic text filter
typographyhtml-entitiestext-filter

More Filters packages