Skip to content

Instantly share code, notes, and snippets.

View natyrix's full-sized avatar

Natnael Melese natyrix

View GitHub Profile
import os
import pandas as pd
import mysql.connector as mysql
from mysql.connector import Error
def DBConnect(dbName=None):
"""
Parameters
----------
CREATE TABLE IF NOT EXISTS `TweetInformation`
(
`id` INT NOT NULL AUTO_INCREMENT,
`created_at` TEXT NOT NULL,
`source` VARCHAR(200) NOT NULL,
`full_text` TEXT DEFAULT NULL,
`polarity` FLOAT DEFAULT NULL,
`subjectivity` FLOAT DEFAULT NULL,
`language` TEXT DEFAULT NULL,
`favorite_count` INT DEFAULT NULL,
name: twitter-data-analysis
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
import unittest
import pandas as pd
import sys
import os
sys.path.append(os.path.abspath(os.path.join("../Twitter-Data-Analysis/")))
from extract_dataframe import read_json
from extract_dataframe import TweetDfExtractor
# For unit testing the data reading and processing codes,
import json
import pandas as pd
from textblob import TextBlob
import re
def read_json(json_file: str) -> list:
"""
json file reader to open and read json files into a list
Args:
import pandas as pd
import re
class Clean_Tweets:
"""
The PEP8 Standard AMAZING!!!
"""
def __init__(self, df: pd.DataFrame):
self.df = df
print('Clean_Tweets INSTANCE CREATED')