Python package to do analysis on Occasion
Project description
Installation:
pip install occasion-analysis-package
Get started:
Description: Python package to do analysis on Occasion.
Long Description: This package consist of 3 functions: export sql data to csv(export_data_to_csv), create word cloud(create_word_cloud), create emoji chart(create_emoji_chart).
- export_data_to_csv(credential_file_path, export_file_path): The function will export data based on SQL query into csv file. For data loading, create a file named: "credentials.env" which has database credential details in following format:
DATABASE = 'database_name'
USER = 'user_name'
PASSWORD = 'password'
HOST = 'host'
PORT = 'port_number'
Parameters:
credential_file_path (string): File Path for Credential File without file name (as it is set to credentials.env). Please enter file path with double backslash "\\".
export_file_path (string): File Path to export the data(as it is set to occasion.csv). Please enter file path with double backslash "\\".
Package Import: psycopg2, os, csv, io, pandas, dotenv
- create_word_cloud(import_file_path,stop_words): The function will create Word Cloud using Document Term Matrix.
Parameters:
import_file_path (string): File Path to export the data. Please enter file path with double backslash "\\" with file name. There should be two columns in the file: "use_case", "all_text". File name should be .csv extension.
stop_words (list/string): Enter the list of stop words, which should be avoided while creating word cloud. Example: "mother, mom, mum".
Package Import: numpy, pandas, matplotlib, re, string, spacy, sklearn
- create_emoji_chart(import_file_path): The function will create Emoji Frequency Chart.
Parameters:
import_file_path (string): File Path to export the data. Please enter file path with double backslash "\\" with file name. There should be two columns in the file: "use_case", "all_text". File name should be .csv extension.
Package Import: pandas, plotly, advertools
Example: from occasion_analysis_package import export_data_to_csv, create_word_cloud, create_emoji_chart
export_data_to_csv("D:\\Analysis\\Occassion Analysis","D:\\Analysis\\Occassion Analysis\\test")
create_word_cloud("D:\\Analysis\\Occassion Analysis\\test\\occasion.csv","mother, mom, mum, mummy, grandmother, grand mother, grand ma, grandma, step mom, stepmom") --Stop words for Mother''s Day
create_emoji_chart("D:\\Analysis\\Occassion Analysis\\test\\occasion.csv")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for occasion_analysis_package-2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59bbc3241bc85c083f42743b1f2d9cc71f95917b131a4a0e6d5e5fe9658ef52e |
|
MD5 | 17ad1e43b0b2b845c9a111d620faae48 |
|
BLAKE2b-256 | 756175a9312dd58a7e3aae83a252f2e7289c6bbdb4bcf3979ac5d9d377607f79 |
Hashes for occasion_analysis_package-2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973b85f0b7def08c67cd50c69fa7ac5c1601983ffe0c5c4bf32402a5c4ef8216 |
|
MD5 | e00dff079c1a107c479efa947eeac3ed |
|
BLAKE2b-256 | dc4fde4a9da7e22717428a8ac69354c60851f42d12d8eb37eaa62ea48f25d44a |