Listed in editorial order, grouped by use case. Click a column to re-sort the whole list.
Press / to search. Tap a tag to filter. Click any row for details.
Search and filter
Results
| Row number | Tags | |||||
|---|---|---|---|---|---|---|
Encoding and Unicode 3 projects |
||||||
| 1 | charset-normalizer Encoding and Unicode | 1,194,739,615 | 798 | Encoding and Unicode Text Processing Text & Documents | → | |
|
Universal character encoding detector, and a dependency of requests.
|
||||||
| 2 | chardet Encoding and Unicode | 164,865,407 | 2,675 | Encoding and Unicode Text Processing Text & Documents | → | |
|
Python character encoding detector.
|
||||||
| 3 | ftfy Encoding and Unicode | 14,252,070 | 4,067 | Encoding and Unicode Text Processing Text & Documents | → | |
|
Makes Unicode text less broken and more consistent automagically.
|
||||||
Fuzzy Matching 1 project |
||||||
| 4 | rapidfuzz Fuzzy Matching | 119,847,030 | 4,149 | Fuzzy Matching Text Processing Text & Documents | → | |
|
Rapid fuzzy string matching using various string metrics, with a C++ core.
|
||||||
General 2 projects |
||||||
| 5 | difflib General | Stdlib | 77,383 | General Text Processing Text & Documents Stdlib | → | |
|
(Python standard library) Helpers for computing deltas.
|
||||||
| 6 | pyfiglet General | 5,965,288 | 1,587 | General Text Processing Text & Documents | → | |
|
An implementation of figlet written in Python.
|
||||||
Internationalization 1 project |
||||||
| 7 | babel Internationalization | 104,141,572 | 1,469 | Internationalization Text Processing Text & Documents | → | |
|
An internationalization library for Python.
|
||||||
Parser 5 projects |
||||||
| 8 | pygments Parser | 933,250,675 | 2,214 | Parser Text Processing Text & Documents | → | |
|
A generic syntax highlighter.
|
||||||
| 9 | pyparsing Parser | 318,913,439 | 2,494 | Parser Text Processing Text & Documents | → | |
|
A Python library for creating PEG parsers.
|
||||||
| 10 | sqlparse Parser | 109,968,141 | 4,021 | Parser Text Processing Text & Documents | → | |
|
A non-validating SQL parser.
|
||||||
| 11 | phonenumbers Parser | 35,038,572 | 3,774 | Parser Text Processing Text & Documents | → | |
|
Parsing, formatting, storing and validating international phone numbers.
|
||||||
| 12 | parsy Parser | 4,310,015 | 451 | Parser Text Processing Text & Documents | → | |
|
Easy, generic parser combinator library for creating parsers.
|
||||||
Transliteration and Slugs 2 projects |
||||||
| 13 | python-slugify Transliteration and Slugs | 65,171,523 | 1,626 | Transliteration and Slugs Text Processing Text & Documents | → | |
|
A Python slugify library that translates unicode to ASCII.
|
||||||
| 14 | unidecode Transliteration and Slugs | 26,219,209 | 611 | Transliteration and Slugs Text Processing Text & Documents | → | |
|
ASCII transliterations of Unicode text.
|
||||||
Unique identifiers 1 project |
||||||
| 15 | shortuuid Unique identifiers | 16,925,188 | 2,198 | Unique identifiers Text Processing Text & Documents | → | |
|
A generator library for concise, unambiguous and URL-safe UUIDs.
|
||||||
No projects match your search or filter.
Try a broader term, or .
Text Processing guide
ftfy fixes Unicode that's broken in various ways: bad Unicode goes in, good Unicode comes out. It's a mojibake detector and fixer, not an encoding detector, so give it text you've already tried to decode, never bytes. The function you'll call most is ftfy.fix_text(), which applies every fix it can. ftfy aims never to change text that was decoded correctly.
charset-normalizer reads text from an unknown charset encoding. Call from_bytes(data).best(), or from_path(path).best() for a file, and str() of the result is your decoded text. chardet does the job differently: charset-normalizer decodes candidate encodings and scores the text, while chardet scores raw bytes against per-language models.
RapidFuzz does fuzzy string matching with various string metrics, mostly in C++, with a pure Python fallback for every algorithm. To compare one string against a list, use the process module, like process.extractOne().
difflib comes with Python and compares sequences, mostly lines of text, producing unified, context, and HTML diffs like the ones diff and git diff print. For a "did you mean" suggestion, get_close_matches() returns the best "good enough" matches for a word.
pyfiglet is a full port of FIGlet into pure Python: it renders text in ASCII-art fonts, as in pyfiglet.figlet_format("text", font="slant").
Babel does two jobs: it builds gettext message catalogs without the GNU gettext tools for common tasks, and it formats dates, numbers, and locale names from CLDR data. Run catalogs through the pybabel command: extract messages, init a catalog per language, update it, and compile it.
Pygments is a generic syntax highlighter for code hosting, forums, wikis, and other apps that show source code. If you highlight code your users submit, its docs recommend you stop the Pygments process after a short timeout.
pyparsing builds a grammar directly in Python code from a library of classes, instead of lex/yacc or regular expressions. It handles whitespace, quoted strings, and embedded comments for you. Its best practices start with writing a BNF before any code. Use results names to get tokens by field name rather than by position. parsy combines small parsers into larger ones and gives you building blocks only. Its docs say it excels at easy-to-read parsers for relatively small languages.
sqlparse is a non-validating SQL parser: it splits scripts into statements, formats them, and walks their token tree, whatever the dialect. Its three module-level functions, split(), format(), and parse(), cover most needs.
phonenumbers is a Python port of Google's libphonenumber. Parse a number together with the country it's dialed from, unless it's in E.164 format. Then check it with is_possible_number() or is_valid_number(), and print it with format_number().
python-slugify makes Unicode-aware slugs with your choice of transliteration backend: by default, Unidecode if it's installed, otherwise text-unidecode. Its own code is MIT, while Unidecode is GPL, so check that license before you install Unidecode next to it.
Unidecode makes lossy ASCII transliterations of Unicode text, close to what someone on a US keyboard would type. Use it for ASCII machine identifiers. Its README says it's best kept off strings your users see.
shortuuid generates concise, unambiguous, URL-safe UUIDs for IDs users will see: it takes UUIDs from Python's uuid module, writes them in base57, and drops look-alike characters such as l, 1, I, O, and 0. Call shortuuid.uuid() for a new ID.
Decode with the encoding you were told whenever there is one. charset-normalizer's FAQ calls detection a last resort, and ftfy's docs say to assume UTF-8 unless you have a specific reason to believe otherwise.
Contribute
Know a project that belongs here?
Tell us what it does and why it stands out.