Skip to main content

a python library to clean textual data fetched from API's

Project description

CleanTweet version 2.1.0

CleanTweet is a python library created for cleaning textual data fetched from API. In the second version of the cleantweet library, there are 6 new classes that have been introduced. They include the DiagramTweet

PredictionTweet, SaveTweet, SentimentTweet, StatsTweet, and SyntheticTweet. Each of these classes have different methods specific

to each class and most of them inherit the clean() method from the CleanTweet class which was the only class present in the version

0.1.1.

You can find more detailed documentation about the various classes, their implementation and their various methods (close to 50) in

cleantweet's permanent home: https://cleantweet.org/

Installation

pip install cleantweet

Get Started

How to clean your Twitter Object:

Example 1: If the text file containing the Twitter/X JSON Data is in the same directory as project files.

!pip install cleantweet

import cleantweet as clt

Instantiate the CleanTwitter Object

data = clt.CleanTweet('sample_text.txt')

Call the clean method

data = data.clean())

Print the data object

print(data)

Various Implementations for the new classes

Draw a Wordcloud from your textual data

import cleantweet as clt

diagram = clt.DiagramTweet('sample_text.txt')

diagram.word_cloud()

Amount of Plural Proper Nouns in your text

import cleantweet as clt

text = clt.StatsTweet('sample_text.txt')

text = text.amount_of_proper_nouns(plural=True)

print(text)

Sentiment Analysis

import cleantweet as clt

sentiments = clt.SentimentTweet('sample_text.txt')

sentiments = sentiments.vader()

print(sentiments)

Synthetic Data

import cleantweet as clt

synths = clt.SyntheticTweet('sample_text.txt')

synths = synths.rule_based()

print(synths)

Update

For version 2.1.0, a new class was created called the ClassificationTweet class; the implementation is the same with the

other classes - create an instance of the class while passing the document as a .txt file, then using that class

instance to have access to the different methods in the class.

New methods have been added to the DiagramTweet class like pie_chart() and the lexicon_chart().

InferenceTweet class has been enhanced with frequency-based and TextRank summarization methods.

Named Entity Recognition (NER) has been implemented in the StatsTweet class for extracting named entities from text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cleantweet-2.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cleantweet-2.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file cleantweet-2.1.0.tar.gz.

File metadata

  • Download URL: cleantweet-2.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cleantweet-2.1.0.tar.gz
Algorithm Hash digest
SHA256 361f814634fb0f87a484cfe926311758c73d3a70f117bbd030b671e7a54fe97b
MD5 744cfd8c09572ac66763544999af02bb
BLAKE2b-256 9fe102aa42fb23a3a30dc5ca64290caa8508f6c046ff205b7f737a7e7dd9c9a7

See more details on using hashes here.

File details

Details for the file cleantweet-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: cleantweet-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cleantweet-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d2b2f187ec4e6fb2956c9242cc70a8b4d108fb799b8176999660b7677f1286b
MD5 a1a26b211fa29c09e65bfe0f17e9ae22
BLAKE2b-256 c01bc82fdf487a3340c754468882e8bf44b7e2d3e52bf4bef6bdc811faa8a458

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page