fold-to-ascii
A Python port of the Apache Lucene ASCII Folding Filter that converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the ‘Basic Latin’ Unicode block) into ASCII equivalents, if they exist.
What it is and what it does
fold_to_ascii is a lightweight Python library that strips Unicode characters down to their ASCII equivalents. It converts accented letters, symbols, and other non-ASCII Unicode characters into plain ASCII representations—for example, turning 'paté' into 'pate' and '®' into nothing (or a custom replacement character you specify). It's based on Apache Lucene's ASCII Folding Filter, making it predictable for text processing workflows that need ASCII-safe output.
The package has no runtime dependencies and installs as a simple pure-Python wheel. It differs from other Unicode-to-ASCII libraries by allowing you to specify a custom replacement character for unmapped symbols, rather than forcing the empty string. However, it has been unmaintained since 2020-05-03, so it receives no updates or security reviews.
Use it for:
- Normalize user-generated text for search indexing or database storage where ASCII-only fields are required
- Clean up product names or URLs containing accented characters for compatibility with legacy systems
- Prepare multilingual text for ASCII-based APIs or services that don't handle Unicode
- Sanitize input text for filename generation or slug creation in web applications
- Deduplicate search queries by folding accented variants to a common ASCII form
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Unicode characters outside the basic ASCII range into their ASCII equivalents or a specified replacement character, following the Apache Lucene ASCII Folding Filter approach.
Yes, if you need straightforward Unicode-to-ASCII folding with no dependencies and can tolerate an unmaintained package. The library is simple, has no vulnerabilities on record, and works for its narrow purpose. Install it only if you're comfortable with a codebase last updated in 2020-05-03 and have no expectation of future updates or support.
Install
fold-to-ascii on PyPI
pip
pip install fold-to-asciiuv
uv add fold-to-asciipoetry
poetry add fold-to-asciiInstalling fold-to-ascii
Before you install
Installation is straightforward with no runtime dependencies. However, the package has been abandoned since its last release on 2020-05-03, so maintenance and security fixes are not expected.
License in practice
Licensed under MIT License (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
from fold_to_ascii import fold
s = u'Astroturf® paté'
result = fold(s)
# result: u'Astroturf pate'
# With custom replacement character:
result = fold(s, u'?')
# result: u'Astroturf? pate'
Verify before relying
- Whether astral character removal behavior (always removed even with replacement specified) is acceptable for your use case
- Current compatibility with modern Python versions beyond what the fact sheet specifies
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,294 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 151,845/month — #10,919 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fold_to_ascii-1.0.2.post1-py3-none-any.whl
Keywords: ascii, unicode, sanitize, diacritics, fold, folding, ligatures
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
zalgolibEncodes text with overlapping Unicode…
permissive · top 15,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
UnidecodeConverts Unicode text to ASCII-safe…
copyleft · top 1,000 on PyPI
ftfyDetects and fixes mojibake (garbled Unicode…
permissive · top 5,000 on PyPI
normalityNormality removes diacritics, punctuation, and…
permissive · top 15,000 on PyPI
unicode-slugifyConverts strings into URL-friendly slugs while…
permissive · top 15,000 on PyPI
humpsConverts strings to camelCase format, handling…
copyleft · top 15,000 on PyPI
sanitize-filenameRemoves or replaces problematic characters from…
permissive · top 15,000 on PyPI
PyArabicPyArabic provides functions to manipulate…
copyleft · top 15,000 on PyPI