skillfed

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.

fold-to-ascii v1.0.2.post1 151.8K downloads/30d#10,919 on PyPI17
Permissive license MIT License Abandoned released

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-ascii

uv

uv add fold-to-ascii

poetry

poetry add fold-to-ascii

Installing 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

unicode to ascii conversionremove diacritics pythonascii folding filterunicode normalizationtext sanitizationcharacter foldingdiacritic removal
text-normalizationunicode-handling

More Text Processing packages