EmDashify — Em Dashes Made Easy
The Python library you think you'll never need—until you use it more than the ones you do.
Why?
ChatGPT, Claude, and other large language models often use the em dash (—) when answering users. It's become especially noticeable in AI-generated responses: Pew Research Center found that em dashes appeared about twice as often in the English-language web text it studied as in 2023. Of course, the em dash predates AI—it's ordinary punctuation, not proof that a text was AI-written.
Yet most QWERTY keyboards have a - key, not a dedicated — key. EmDashify lets you type -- and turn it into a proper em dash in text, Markdown, or Word documents. No AI needed. Just punctuation.
Quick start
pip install emdashify
emdashify "Hello -- world"
# Hello—world
from emdashify import convert
convert("Hello -- world") # 'Hello—world'
convert("hello--world") # 'hello—world'
convert("Hello -- world", compact=False) # 'Hello — world'
Edit files in place (with a backup)
Prefer updating the file directly? Add --in-place to convert it safely, keeping the unmodified original as a .bak file:
emdashify --file notes.md --in-place # saves notes.md.bak
emdashify --file draft.docx --in-place # saves draft.docx.bak (requires [word])
from emdashify import convert_in_place
convert_in_place("notes.md") # True if changed, False if already clean
Existing backups are never overwritten. No backup is created if the document is already clean. Symlinks are not edited in place, and writing a file over itself with --output is rejected.
Word documents (.docx)
Convert an entire Word document, including paragraphs, tables, headers and footers, without flattening text formatting. Install the optional Word extra:
pip install "emdashify[word]"
emdashify --file draft.docx --output draft-fixed.docx
emdashify --file draft.docx --check
from emdashify import convert_docx
convert_docx("draft.docx", "draft-fixed.docx")
By default, the source file is untouched; use --in-place for an explicit backup-protected update. Word support is for .docx, not legacy .doc. Review complex documents with tracked changes or advanced Word fields after conversion.
Text and Markdown files
emdashify --file notes.md --diff
emdashify --file notes.md --output notes-fixed.md
emdashify --file notes.md --check
Compact by default: both word--word and word -- word become word—word. Flags (--help), dates, and --- stay unchanged; Markdown code blocks are protected. Use --spaced in the CLI (or compact=False in Python) to retain the former spaced style.
Requires Python 3.10+. For development or publishing, see release instructions.
License
BSD-3-Clause-Attribution. Redistributing EmDashify requires retaining license notices and this acknowledgment:
This product includes software developed by edujbarrios (https://github.com/edujbarrios/EmDashify).
Metadata
Release files for emdashify 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| emdashify-0.4.0.tar.gz | 19.8 kB | With provenance | Details for emdashify-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| emdashify-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for emdashify-0.4.0-py3-none-any.whl |
Total release size: 32.8 kB
Release files / emdashify-0.4.0.tar.gz
| Download URL | emdashify-0.4.0.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ad52ded8af15a5ead41fddf7d104bd50c047e90ed2028d12bd831085e7a8edf
|
|
BLAKE2b-256 checksum How to use checksums |
b95c599058238159b2d582913939dd7e62f3f84a89f5795ad42a6c05d1858a2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / emdashify-0.4.0-py3-none-any.whl
| Download URL | emdashify-0.4.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e12f9a5ed5a1028f08c1d890c18075a79143e933f7cc0b5fadc81b1fd99ca1bb
|
|
BLAKE2b-256 checksum How to use checksums |
4608c64efca697e65dd88c929119967c154e39713f47e7f3ccfe2b3c6c8074d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for emdashify 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for emdashify-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.