Skip to main content

MTSB

MTSB (Movie Tweet Sentiment Boxoffice) is a python module that collects tweets about movies, performs a sentiment analysis and correlates it with the boxoffice result of the 7 days after the movie release.

Features

  • Collect tweets about movies
  • Creates hashtags for each movie
  • Performs sentiment analysis on those tweets using Google's API or Textblob and returns the average score and the average magnitude
  • Gets boxoffice data from boxofficemojo
  • Performs correlation between the sentiment analysis and boxoffice data

Requirements

Installation

In order to install MTSB you can simply:

pip install mtsb

Docs

  • tweet_collector()

Collect tweets about movies. It lets you choose between movies released in 2019 and releasing in 2020. It then creates a list of hashtags based on the movie's name and top actors and uses it to collect tweets from twitter.

import mtsb

mtsb.tweet_collector()
  • sentiment()

Performs sentiment analysis on collected tweets using Google's API or Textblob and returns the average score, the average magnitude, their standard deviations and the percentage of positive tweets.

import mtsb

mtsb.sentiment()
  • sentiment_boxoffice_all()

Creates a dataframe with the following info for each movie: * Movie title and genres * Average mean and std of the tweets' scores and magnitudes * Percentage of positive and negative labelled tweets (if score==0 is labelled as positive) * Sum of the boxoffice of the 7 days after the movie release

import mtsb

mtsb.sentiment_boxoffice_all()
  • spearman_corr(df)

Performs a spearman correlation using the df returned by sentiment_boxoffice_all().

mtsb.spearman_corr(df)

Links

Acknowledgements

Useful python libraries used:

Licence

MIT licensed. See the bundled LICENSE file for more details.

Release files for mtsb 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mtsb 0.0.7
File Size Uploaded
mtsb-0.0.7.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mtsb 0.0.7
File Interpreter ABI Platform
mtsb-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 23.5 kB

Release files / mtsb-0.0.7.tar.gz

Download URL mtsb-0.0.7.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c89d410ed4bdd643dfc006aba8ce9f4581794c91a3445ea4856b375c3dac432f
BLAKE2b-256 checksum
How to use checksums
3ed51bbb6cfc332398ee706b1fc92c360c85cc1687c34007fa675e05f2cc8cd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / mtsb-0.0.7-py3-none-any.whl

Download URL mtsb-0.0.7-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8728aa903070ec6909499171f4ed6b22133fe3975c135380926247fbc8e432d
BLAKE2b-256 checksum
How to use checksums
8a0bc548950c688c0911a2160b0115b206dd9b0131524f1a5f7cefa51b780908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page