{"id":2806,"library":"textblob","title":"TextBlob: Simple, Pythonic Text Processing","description":"TextBlob is a Python library designed for processing textual data, providing a simplified API for common Natural Language Processing (NLP) tasks. It encompasses functionalities like sentiment analysis, part-of-speech tagging, noun phrase extraction, and more, building on top of NLTK and pattern libraries. The current version is 0.20.0, with a release cadence that indicates active maintenance and updates, as seen with recent releases in late 2025 and early 2026.","status":"active","version":"0.20.0","language":"en","source_language":"en","source_url":"https://github.com/sloria/TextBlob","tags":["nlp","text-processing","sentiment-analysis","part-of-speech-tagging","noun-phrase-extraction","nltk"],"install":[{"cmd":"pip install textblob","lang":"bash","label":"Install TextBlob"},{"cmd":"python -m textblob.download_corpora","lang":"bash","label":"Download NLTK Corpora (Essential)"}],"dependencies":[{"reason":"TextBlob relies on NLTK for core NLP functionalities; it is automatically installed but requires separate corpus downloads.","package":"NLTK","optional":false},{"reason":"Required for certain advanced features like the maximum entropy classifier, but not for basic usage.","package":"numpy","optional":true}],"imports":[{"symbol":"TextBlob","correct":"from textblob import TextBlob"},{"note":"The core package was renamed from 'text' to 'textblob' in version 0.8.0. Older imports will fail.","wrong":"from text.blob import TextBlob","symbol":"TextBlob (legacy)","correct":"from textblob import TextBlob"},{"note":"Python is case-sensitive; the class name is 'TextBlob' (capital T and B).","wrong":"from textblob import textblob","symbol":"TextBlob (casing)","correct":"from textblob import TextBlob"}],"quickstart":{"code":"from textblob import TextBlob\n\ntext = \"TextBlob is amazingly simple to use. What great fun!\"\nblob = TextBlob(text)\n\nprint(f\"Original text: {text}\")\nprint(f\"Sentiment Polarity: {blob.sentiment.polarity}\") # Range [-1.0, 1.0]\nprint(f\"Sentiment Subjectivity: {blob.sentiment.subjectivity}\") # Range [0.0, 1.0]\nprint(f\"Part-of-speech tags: {blob.tags}\")\nprint(f\"Noun phrases: {blob.noun_phrases}\")\n\n# Example of a common warning: not downloading corpora leads to LookupError\n# Run `python -m textblob.download_corpora` if you get a LookupError.","lang":"python","description":"This quickstart demonstrates basic sentiment analysis, part-of-speech tagging, and noun phrase extraction using TextBlob. It initializes a TextBlob object with a string and then accesses its `sentiment`, `tags`, and `noun_phrases` properties."},"warnings":[{"fix":"Run `python -m textblob.download_corpora` after installation. For minimal corpora, use `python -m textblob.download_corpora lite`.","message":"Failing to download NLTK corpora will result in `LookupError` when performing NLP tasks (e.g., sentiment analysis, POS tagging). This is a very common initial setup mistake.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update import statements from `text.blob` to `textblob`.","message":"The main package import path changed from `from text.blob import TextBlob` to `from textblob import TextBlob`.","severity":"breaking","affected_versions":"<=0.7.1 to >=0.8.0"},{"fix":"Rename your script file to something other than `textblob.py` (e.g., `my_script.py`).","message":"Naming your Python script file `textblob.py` can cause an import collision, leading to `AttributeError` or `ImportError` because Python will try to import your local file instead of the installed library.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure correct casing: `from textblob import TextBlob`.","message":"The main class is `TextBlob` (capital 'T' and 'B'). Using `textblob` (lowercase) in the import statement will result in an `ImportError` or `AttributeError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to Python 3.7 or newer. TextBlob 0.20.0 requires Python >=3.10.","message":"Support for Python 3.4 was officially dropped.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Use a dedicated HTML parsing library like Beautiful Soup (`BeautifulSoup(html_doc).get_text()`) for HTML cleaning.","message":"The `clean_html` parameter has been deprecated. It was removed as it was also deprecated in NLTK.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Call `json()` as a method: `blob.json()` instead of accessing it as a property `blob.json`.","message":"The `TextBlob.json` property was changed to a method `TextBlob.json()`.","severity":"breaking","affected_versions":">=0.11.0"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}