SMARTYPANTS(1) smartypants SMARTYPANTS(1)

# [NAME](#NAME)

smartypants - smartypants Documentation

Contents:

# [INTRODUCTION](#INTRODUCTION)

smartypants &lt;https://github.com/justinmayer/smartypants.py&gt; is a Python fork of SmartyPants &lt;http://daringfireball.net/projects/smartypants/&gt;.

smartypants can perform the following transformations:

- Straight quotes (**"** and **'**) into “curly” quote HTML entities
- Backticks-style quotes (**\`\`like this''**) into “curly” quote HTML entities
- Dashes (**--** and **---**) into en- and em-dash entities
- Three consecutive dots (**...** or **. . .**) into an ellipsis entity

This means you can write, edit, and save your posts using plain old ASCII straight quotes, plain dashes, and plain dots, but your published posts (and final HTML output) will appear with smart quotes, em-dashes, and proper ellipses.

smartypants does not modify contents in some HTML element, see Skipped HTML Elements &lt;#skip-html&gt;. Typically, these tags are used to display text where smart quotes and other "smart punctuation" would not be appropriate, such as source code or example markup.

## [Quick usage](#Quick_usage)

To use it as a module:

```
import smartypants
text = '"SmartyPants" is smart, so is <code>smartypants</code> -- a Python port'
print(smartypants.smartypants(text))
```

To use the command-line script **smartypants**:

```
echo '"SmartyPants" is smart, so is <code>smartypants</code> -- a Python port' | smartypants
```

Both produce:

```
&#8220;SmartyPants&#8221; is smart, so is <code>smartypants</code> &#8212; a Python port
```

## [Installation](#Installation)

smartypants package on PyPI &lt;https://pypi.python.org/pypi/smartypants/&gt; can be installed via **pip**:

```
python -m pip install smartypants
```

If you want to install latest development code, you can run:

```
python -m pip install git+https://github.com/justinmayer/smartypants.py
```

# [USAGE](#USAGE)

Typically, you import **smartypants** &lt;#module-smartypants&gt; and call the **smartypants.smartypants()** &lt;#smartypants.smartypants&gt; to convert a text, for example:

```
import smartypants
text = '"SmartyPants" is smart, so is <code>smartypants.py</code> -- a Python port'
print(smartypants.smartypants(text))
```

It results:

```
&#8220;SmartyPants&#8221; is smart, so is <code>smartypants.py</code> &#8212; a Python port
```

## [Attributes](#Attributes)

**smartypants.smartypants()** &lt;#smartypants.smartypants&gt; accepts processing attributes, which tells it what need to be converted.

**See also:**

**smartypants.Attr** &lt;#smartypants.\_Attr&gt; for a list of attributes.

To use these attributes, simply using bitwise *OR* operator, that is **A | B**:

```
from smartypants import Attr
attrs = Attr.q | Attr.d
smartypants.smartypants(text, attrs)
attrs = Attr.set1 | Attr.w
smartypants.smartypants(text, attrs)
```

## [Skipped HTML elements](#Skipped_HTML_elements)

## [Elements](#Elements)

By default, there are a few HTML elements that **smartypants.smartypants()** &lt;#smartypants.smartypants&gt; do not try to be smart with them:

```
tags_to_skip = ['pre', 'samp', 'code', 'tt', 'kbd', 'script', 'style', 'math']
```

If you need to change, for example, adding additional tags and remove one of them:

```
>>> from smartypants import tags_to_skip as tags
>>> tags.append('a')
>>> tags.remove('code')
>>> tags
['pre', 'samp', 'tt', 'kbd', 'script', 'style', 'math', 'a']
```

The **smartypants.tags\_to\_skip** &lt;#smartypants.tags\_to\_skip&gt; is compiled into a regular expression for being used by **smartypants.smartypants()** &lt;#smartypants.smartypants&gt;. You could actually overwrite **smartypants.\_tags\_to\_skip\_regex()** &lt;#smartypants.\_tags\_to\_skip\_regex&gt; and return with your own regular expression.

## [Comments](#Comments)

HTML comments are always skipped since they are not rendered in browsers.

```
>>> from smartypants import smartypants as sp
>>> print(sp('<!-- <span>"foobar"</span> -->'))
<!-- <span>"foobar"</span> -->
```

**Important:**

Beware of **--**, which should not or must not be in a HTML comment.

```
>>> from smartypants import smartypants as sp
>>> print(sp('<!-- <span>"foo--bar"</span> -->'))
<!&#8212; <span>&#8221;foo&#8212;bar&#8221;</span> &#8212;>
```

## [Backslash escapes](#Backslash_escapes)

If you need to use literal straight quotes (or plain hyphens and periods), for example, text like **6'2"** may become **6‘2”**. To avoid such situation, you can use backslash escapes like **6\\'2\\"**.

**See also:**

**smartypants.process\_escapes()** &lt;#smartypants.process\_escapes&gt; for a complete list of backslash escapes.

# [DEVELOPMENT](#DEVELOPMENT)

smartypants &lt;https://github.com/justinmayer/smartypants.py&gt; is hosted on GitHub. You can clone the repository or file an issue report from there.

## [Contributing](#Contributing)

You are welcome to contribute whatever you can. Coding, documenting, reporting issues, requesting features, even correcting typos.

## [Testing](#Testing)

If you want to contribute to the source code, be sure that you check your modification can pass tests. Normally, if you use Unix-like system, you should be able to run all tests with:

```
make test
```

It will test DOC8, PEP8, pyflakes, unittest, and package installation:

```
make test_isort
make test_doc8
make test_pep8
make test_pyflakes
make test_test
make test_setup
```

**Note:**

They will all be tested with both Python 2 and Python 3. You may need to override **PY2\_CMD** and/or **PY3\_CMD**.

If **make** isn't available, **setup.py** can be used:

```
python setup.py isort
python setup.py pep8
python setup.py pyflakes
python setup.py test
```

For manual package installation test:

```
python -m pip install -e .
pip install --user --upgrade dist/smartypants-<x.y.z>.tar.gz
```

## [Building](#Building)

## [Package](#Package)

You should be able to build the package with either of:

```
make
```

**Note:**

**make** builds source tarball, zip, and win32 setup.

or:

```
python setup.py sdist
```

## [Documentation](#Documentation)

You should be able to build the documentation with either of:

```
make doc
```

or:

```
python setup.py build_sphinx
```

## [Reporting](#Reporting)

Please head over to Issues &lt;https://github.com/justinmayer/smartypants.py/issues&gt; and create an issue for a bug report or feature request.

# [REFERENCE](#REFERENCE)

## [smartypants module](#smartypants_module)

**smartypants()** is the core of smartypants module.

[**smartypants.Attr = &lt;smartypants.\_Attr object&gt;**](#smartypants.Attr)

Processing attributes, which tells **smartypants()** what to convert

**See also:**

**\_Attr**

[**class smartypants.\_Attr**](#class)

class for instantiation of module attribute **Attr**.

[**B = 6**](#B)

flag for double quotes (**\`\`backticks''**) and single quotes (**\`single'**) to curly ones.

**See also:**

**convert\_backticks()** and **convert\_single\_backticks()**

[**D = 24**](#D)

flag for old-school typewriter dashes (**--**) to en-dashes and dashes (**---**) to em-dashes.

**See also:**

**convert\_dashes\_oldschool()**

[**b = 2**](#b)

flag for double quotes (**\`\`backticks''**) to curly ones.

**See also:**

**convert\_backticks()**

[**d = 8**](#d)

flag for dashes (**--**) to em-dashes.

**See also:**

**convert\_dashes()**

[**property default**](#property)

Default value of attributes, same value as **set1**

[**e = 64**](#e)

flag for dashes (**...**) to ellipses.

**See also:**

**convert\_ellipses()**

[**h = 512**](#h)

Output HTML named entities instead of numeric character references, for example, from **&#8220;** to **&ldquo;**.

**See also:**

**convert\_entities()**

[**i = 40**](#i)

flag for inverted old-school typewriter dashes (**--**) to em-dashes and dashes (**---**) to en-dashes.

**See also:**

**convert\_dashes\_oldschool\_inverted()**

[**q = 1**](#q)

flag for normal quotes (**"**) and (**'**) to curly ones.

**See also:**

**convert\_quotes()**

[**s = 768**](#s)

Output ASCII equivalents instead of numeric character references, for example, from **&#8212;** to **--**.

**See also:**

**convert\_entities()**

[**set0 = 0**](#set0)

suppress all transformations. (Do nothing.)

[**set1 = 75**](#set1)

equivalent to **q** | **b** | **d** | **e**

[**set2 = 91**](#set2)

equivalent to **q** | **b** | **D** | **e**

For old school en- and em- dash.

[**set3 = 107**](#set3)

equivalent to **q** | **b** | **i** | **e**

For inverted old school en & em- dash."

[**u = 256**](#u)

Output Unicode characters instead of numeric character references, for example, from **&#8220;** to left double quotation mark (**“**) (U+201C).

**See also:**

**convert\_entities()**

[**w = 128**](#w)

flag for dashes (**&quot;**) to ASCII double quotes (**"**).

This should be of no interest to most people, but of particular interest to anyone who writes their posts using Dreamweaver, as Dreamweaver inexplicably uses this entity to represent a literal double-quote character. SmartyPants only educates normal quotes, not entities (because ordinarily, entities are used for the explicit purpose of representing the specific character they represent). The "w" option must be used in conjunction with one (or both) of the other quote options ("q" or "b"). Thus, if you wish to apply all SmartyPants transformations (quotes, en- and em-dashes, and ellipses) and also convert **&quot;** entities into regular quotes so SmartyPants can educate them.

[**smartypants.\_tags\_to\_skip\_regex(tags=None)**](#smartypants._tags_to_skip_regex%28tags=None%29)

Convert a list of skipped tags into regular expression

The default *tags* are **tags\_to\_skip**.

```
>>> f = _tags_to_skip_regex
>>> print(f(['foo', 'bar']).pattern)
<(/)?(foo|bar)[^>]*>
    
```

[**smartypants.\_tokenize(text)**](#smartypants._tokenize%28text%29)

Reference to an array of the tokens comprising the input string. Each token is either a tag (possibly with nested, tags contained therein, such as **&lt;a href="&lt;MTFoo&gt;"&gt;**, or a run of text between tags. Each element of the array is a two-element array; the first is either 'tag' or 'text'; the second is the actual value.

Based on the \_tokenize() subroutine from Brad Choate's MTRegex plugin &lt;http://www.bradchoate.com/past/mtregex.php&gt;.

[**smartypants.convert\_backticks(text)**](#smartypants.convert_backticks%28text%29)

Convert **\`\`backticks''**-style double quotes in *text* into HTML curly quote entities.

```
>>> print(convert_backticks("``Isn't this fun?''"))
&#8220;Isn't this fun?&#8221;
    
```

[**smartypants.convert\_dashes(text)**](#smartypants.convert_dashes%28text%29)

Convert **--** in *text* into em-dash HTML entities.

```
>>> quote = 'Nothing endures but change. -- Heraclitus'
>>> print(convert_dashes(quote))
Nothing endures but change. &#8212; Heraclitus
    
```

[**smartypants.convert\_dashes\_oldschool(text)**](#smartypants.convert_dashes_oldschool%28text%29)

Convert **--** and **---** in *text* into en-dash and em-dash HTML entities, respectively.

```
>>> quote = 'Life itself is the proper binge. --- Julia Child (1912--2004)'
>>> print(convert_dashes_oldschool(quote))
Life itself is the proper binge. &#8212; Julia Child (1912&#8211;2004)
    
```

[**smartypants.convert\_dashes\_oldschool\_inverted(text)**](#smartypants.convert_dashes_oldschool_inverted%28text%29)

Convert **--** and **---** in *text* into em-dash and en-dash HTML entities, respectively.

Two reasons why:

- First, unlike the en- and em-dash syntax supported by **convert\_dashes\_oldschool()**, it's compatible with existing entries written before SmartyPants 1.1, back when **--** was only used for em-dashes.
- Second, em-dashes are more common than en-dashes, and so it sort of makes sense that the shortcut should be shorter to type. (Thanks to Aaron Swartz for the idea.)

```
>>> quote = 'Dare to be naïve. -- Buckminster Fuller (1895---1983)'
>>> print(convert_dashes_oldschool_inverted(quote))
Dare to be naïve. &#8212; Buckminster Fuller (1895&#8211;1983)
```

[**smartypants.convert\_ellipses(text)**](#smartypants.convert_ellipses%28text%29)

Convert **...** in *text* into ellipsis HTML entities

```
>>> print(convert_ellipses('Huh...?'))
Huh&#8230;?
    
```

[**smartypants.convert\_entities(text, mode)**](#smartypants.convert_entities%28text,)

Convert numeric character references to, if *mode* is

- *0*: Unicode characters
- *1*: HTML named entities
- *2*: ASCII equivalents

```
>>> print(convert_entities('&#8216;', 0))
‘
>>> print(convert_entities('&#8216;SmartyPants&#8217;', 1))
&lsquo;SmartyPants&rsquo;
>>> print(convert_entities('&#8220;Hello &#8212; world.&#8221;', 2))
"Hello -- world."
```

[**smartypants.convert\_quotes(text)**](#smartypants.convert_quotes%28text%29)

Convert quotes in *text* into HTML curly quote entities.

```
>>> print(convert_quotes('"Isn\'t this fun?"'))
&#8220;Isn&#8217;t this fun?&#8221;
    
```

[**smartypants.convert\_single\_backticks(text)**](#smartypants.convert_single_backticks%28text%29)

Convert **\`backticks'**-style single quotes in *text* into HTML curly quote entities.

```
>>> print(convert_single_backticks("`Isn't this fun?'"))
&#8216;Isn&#8217;t this fun?&#8217;
    
```

[**smartypants.process\_escapes(text)**](#smartypants.process_escapes%28text%29)

Processe the following backslash escape sequences in *text*. This is useful if you want to force a "dumb" quote or other character to appear.

Escape Value Character **\\\\** **&#92;** **\\** **\\"** **&#34;** **"** **\\'** **&#39;** **'** **\\.** **&#46;** **.** **\\-** **&#45;** **-** **\\\`** **&#96;** **\\\`**

```
>>> print(process_escapes(r'\\'))
&#92;
>>> print(smartypants(r'"smarty" \"pants\"'))
&#8220;smarty&#8221; &#34;pants&#34;
    
```

[**smartypants.smartypants(text, attr=None)**](#smartypants.smartypants%28text,)

SmartyPants function

```
>>> print(smartypants('"foo" -- bar'))
&#8220;foo&#8221; &#8212; bar
>>> print(smartypants('"foo" -- bar', Attr.d))
"foo" &#8212; bar
    
```

[**smartypants.tags\_to\_skip = \['pre', 'samp', 'code', 'tt', 'kbd', 'script', 'style', 'math'\]**](#smartypants.tags_to_skip)

Skipped HTML elements

**See also:**

Skipped HTML elements &lt;#skip-html&gt;

# [HISTORY](#HISTORY)

For changelog, please see Changes &lt;&gt;.

## [SmartyPants](#SmartyPants)

**Perl SmartyPants or original SmartyPants.**

In 2002, John Gruber &lt;http://daringfireball.net/&gt; started the SmartyPants for Movable Type &lt;http://www.movabletype.org/&gt;, written in Perl.

Rael Dornfest &lt;http://raelity.org/&gt; ported SmartyPants to Blosxom. Portions of the SmartyPants are based on Brad Choate &lt;http://bradchoate.com/&gt;'s nifty MTRegex plug-in. Jeremy Hedley &lt;http://antipixel.com/&gt; and Charles Wiltgen &lt;http://playbacktime.com/&gt; deserve mention for exemplary beta testing of SmartyPants.

## [smartypants.py](#smartypants.py)

**smartypants.py, Python \[port of] SmartyPants.**

In 2004, Chad Miller &lt;http://web.chad.org/&gt; ported it to Python to use with Pyblosxom &lt;http://pyblosxom.github.io/&gt;.

Brad Choate also contributed a few bits of source code to the Python port. Brad Choate is a fine hacker indeed. It was later packaged for PyPI by Hao Lian.

## [smartypants](#smartypants)

**smartypants, Python \[fork of] SmartyPants.**

In August 2013, smartypants became managed by Yu-Jie Lin &lt;http://yjl.im/&gt; after they contacted Chad Miller and Hao Lian. Lin took over the project manager role and the package ownership on PyPI. Leo Hemsted &lt;https://github.com/leohemsted&gt; managed the project in 2017.

Since 2025, smartypants has been managed by Justin Mayer &lt;https://justinmayer.com&gt;.

# [CHANGES](#CHANGES)

**Note:**

Releases without timestamps mean they will be released in the future.

*Development* means it's current changes in development repository.

## [Releases 2.0 and greater](#Releases_2.0_and_greater)

## [Release 2.0.2 (2025-06-17)](#Release_2.0.2_%282025)

- Fix double closing quotes after an HTML block
- Fix regular expressions and tests for Python 3.12+
- Move documentation to ReadTheDocs

## [Release 2.0.1 (2017-12-20)](#Release_2.0.1_%282017)

•

use **re.match** instead of **re.search** to improve performance on large strings

## [Release 2.0.0 (2016-12-28T06:18:42Z)](#Release_2.0.0_%282016)

- drop Pyblosxom support
- drop str-type **attr**

•

use **Attr.default** instead of **default\_smartypants\_attr**

•

drop fooBarXyz functions, such as **smartyPants**, **educateQuotes**, and **processEscapes**

•

add **Attr.u** and **Attr.h** for Unicode characters and HTML named entities outputs, respectively. The **stupefy\_entities** has become **convert\_entities** to support all three types of conversions. (#6)

•

Makefile

- do not build **bdist\_wininst --plat-name win32** per **PEP 527#bdist-dmg-bdist-msi-and-bdist-wininst** &lt;https://peps.python.org/pep-0527/#bdist-dmg-bdist-msi-and-bdist-wininst&gt;
- do not make **sdist --format=zip**, it would get a duplicate warning on PyPI

•

test packages build in **test\_setup** target

•

rename target **install\_test** to **test\_setup**

## [Releases 1.7 and greater](#Releases_1.7_and_greater)

## [Release 1.8.6: 2014-07-19T11:20:52Z](#Release_1.8.6:_2014)

•

Makefile

•

add **LC\_ALL=C** test for locale setting on **setup.py** wrt #5

•

change virtualenv invocation method in **install\_test** target

•

fix UnicodeDecodeError on opening **smartypants.py**, which includes Unicode characters, when running **setup.py** with Python 3 and specific locales (#5, patch by Benoît Monin)

## [Release 1.8.5: 2014-07-03T01:56:03Z](#Release_1.8.5:_2014)

•

fix requirement of Wheel, now optional (#4)

## [Release 1.8.4: 2014-06-29T04:39:59Z](#Release_1.8.4:_2014)

- add missing **COPYING** and **CHANGES.rst** to package (#3)
- add **bdist\_wheel** to the building process for Python Wheel format
- add **test\_doc8** target

<!--THE END-->

- fix **install\_test** on missing of Wheel package
- fix argparse version option breaks CLI on Python 3

## [Release 1.8.3: 2013-11-08T03:03:43Z](#Release_1.8.3:_2013)

•

fix **\_tokenize** can not handle HTML comment properly

This fix includes pull request #1 with modification for handling **--** appears in a comment, which makes the comment not a comment

## [Release 1.8.2: 2013-08-28T11:38:42Z](#Release_1.8.2:_2013)

•

deprecate fooBarXyz functions, such as **educateQuotes** and **processEscapes**

- fix **---** being converted in **educateDashes**
  
  The Perl doesn't do such, and it's possibly a mistaken in version v1.5\_1.5 (eed4a8a16f11)
  
  If you want the same behavior with default attributes, you need to use **Attr.q | Attr.b | Attr.i | Attr.e**
- setup.py

•

add **build\_sphinx** and **upload\_sphinx** commands

•

Makefile

- add **doc** for documentation generation
- add **upload\_doc** for uploading to PyPI
- add **clean** for cleaning up built files

•

add documentation generation

## [Release 1.8.1: 2013-08-20T02:27:35Z](#Release_1.8.1:_2013)

•

fix deprecated **smartyPants** returns nothing (#2)

•

add test file for deprecated stuff

## [Release 1.8.0: 2013-08-18T11:47:27Z](#Release_1.8.0:_2013)

•

deprecate str-type **attr** with:

•

redesign attr input with new **Attr** object

•

**"-1"** now is **Attr.s** (**"s"**)

•

**\_str\_attr\_to\_int()** to handle str-type before the removal

- deprecate function name **smartyPants**, now **smartypants**
- remove **tags\_to\_skip\_regex** and add **tags\_to\_skip** as a list of skipped HTML with a helper function to compile a regular expression

•

command-line

- add **--version**
- add **--skip** for skipped elements

•

add Makefile:

- **test\_pep8**, **test\_pyflakes**, and **test\_test** (unittest) targets
- **install\_test** target for checking package installation

•

**test** target for all tests above

•

add **style**, **samp**, and **tt** to be skipped HTML elements

## [Release 1.7.1: 2013-08-14T06:45:59Z](#Release_1.7.1:_2013)

•

fix **README-PyPI.rst** missing while installing

## [Release 1.7.0: 2013-08-14T05:51:20Z](#Release_1.7.0:_2013)

- deprecate Pyblosxom support
- remove HBS language translation added in 1.5\_1.7.

•

fix **convert\_quot** always enabled

It was always turned on. To have same effect of previous **1** attr, equivalent attrs are **qbdew**. Now **1** means **qbde**

- add Python 3 support
- add unittest and checks
- add CLI script

## [Releases 1.6](#Releases_1.6)

The following releases were made by Hao Lian:

## [Release 1.6.0.3: 2009-04-21](#Release_1.6.0.3:_2009)

**smartypants.py** exactly the same as 1.5\_1.6

## [Release 1.6.0.2: 2008-12-20](#Release_1.6.0.2:_2008)

**smartypants.py** exactly the same as 1.5\_1.6

## [Releases 1.5](#Releases_1.5)

The following releases were made by Chad Miller:

## [Release 1.5\_1.7: Fri, 09 Aug 2013 07:34:16 -0400](#Release_1.5_1.7:_Fri,_09_Aug_2013_07:34:16_)

- Add HBS language translation. Patch by by Vera Djuraskovic from Webhostinggeeks.com
- Add Python3 support

## [Release 1.5\_1.6: Fri, 27 Jul 2007 07:06:40 -0400](#Release_1.5_1.6:_Fri,_27_Jul_2007_07:06:40_)

•

Fixed bug where blocks of precious unalterable text was instead interpreted. Thanks to Le Roux and Dirk van Oosterbosch

## [Release 1.5\_1.5: Sat, 13 Aug 2005 15:50:24 -0400](#Release_1.5_1.5:_Sat,_13_Aug_2005_15:50:24_)

- Fix bogus magical quotation when there is no hint that the user wants it, e.g., in "21st century". Thanks to Nathan Hamblen
- Be smarter about quotes before terminating numbers in an en-dash'ed range

## [Release 1.5\_1.4: Thu, 10 Feb 2005 20:24:36 -0500](#Release_1.5_1.4:_Thu,_10_Feb_2005_20:24:36_)

- Fix a date-processing bug, as reported by jacob childress
- Begin a test-suite for ensuring correct output
- Removed import of "string", since I didn't really need it (This was my first every Python program. Sue me!)

## [Release 1.5\_1.3: Wed, 15 Sep 2004 18:25:58 -0400](#Release_1.5_1.3:_Wed,_15_Sep_2004_18:25:58_)

- Abort processing if the flavour is in forbidden-list. Default of \[ "rss" ] (Idea of Wolfgang SCHNERRING.)
- Remove stray virgules from en-dashes. Patch by Wolfgang SCHNERRING

## [Release 1.5\_1.2: Mon, 24 May 2004 08:14:54 -0400](#Release_1.5_1.2:_Mon,_24_May_2004_08:14:54_)

•

Some single quotes weren't replaced properly. Diff-tesuji played by Benjamin GEIGER

## [Release 1.5\_1.1: Sun, 14 Mar 2004 14:38:28 -0500](#Release_1.5_1.1:_Sun,_14_Mar_2004_14:38:28_)

•

Support upcoming pyblosxom 0.9 plugin verification feature

## [Release 1.5\_1.0: Tue, 09 Mar 2004 08:08:35 -0500](#Release_1.5_1.0:_Tue,_09_Mar_2004_08:08:35_)

•

Initial release

# [COPYRIGHT](#COPYRIGHT)

## [SmartyPants](#SmartyPants~2)

```
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
*   Redistributions of source code must retain the above copyright


  notice, this list of conditions and the following disclaimer.
*   Redistributions in binary form must reproduce the above copyright


  notice, this list of conditions and the following disclaimer in


  the documentation and/or other materials provided with the


  distribution.
*   Neither the name "SmartyPants" nor the names of its contributors


  may be used to endorse or promote products derived from this


  software without specific prior written permission.
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall the copyright
owner or contributors be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use,
data, or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use
of this software, even if advised of the possibility of such damage.
```

## [smartypants](#smartypants~2)

```
smartypants is a derivative work of SmartyPants.
Copyright (c) 2025–present, Justin Mayer
Copyright (c) 2017, Leo Hemsted
Copyright (c) 2013, 2014, 2015, 2016 Yu-Jie Lin
Copyright (c) 2004, 2005, 2007, 2013 Chad Miller
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
*   Redistributions of source code must retain the above copyright


  notice, this list of conditions and the following disclaimer.
*   Redistributions in binary form must reproduce the above copyright


  notice, this list of conditions and the following disclaimer in


  the documentation and/or other materials provided with the


  distribution.
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall the copyright
owner or contributors be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use,
data, or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use
of this software, even if advised of the possibility of such damage.
```

- Index &lt;&gt;
- Module Index &lt;&gt;
- Search Page &lt;&gt;

# [Author](#Author)

Justin Mayer

# [Copyright](#Copyright)

2025–present, Justin Mayer; 2013–2016, Yu-Jie Lin; 2004–2013, Chad Miller

June 21, 2026 2.0

---

Document: smartypants(1) from smartypants 2.0.2-r6 (Chainguard OS)
Source: https://github.com/leohemsted/smartypants.py
