Skip to content

Repo for code to generate and store example Freshdesk ticket activity data

Notifications You must be signed in to change notification settings

mantmic/freshdesk-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freshdesk Data Generator

Repo for code to generate and store example Freshdesk ticket activity data

Software Requirements

  • python >= 3.7
  • sqlite3 >= 3.28

These scripts have been tested using Ubuntu, results may vary in Windows or MacOS.

Python packages

  • numpy
  • random
  • sqlite3

Overview

Data generation

The following state machine has been implemented to generate freshdesk data.

State Machine

Transitions between states are randomly chosen until a state is reached where there are no more transitions.

Relational schema

Data lands in a raw format into the stg_activity table. It is then normalized into the freshdesk_ tables for reporting.

Usage

This codebase contains scripts to

  1. Generate example Freshdesk data
  2. Create an sqlite schema to store data
  3. Insert freshdesk data into the sqlite database
  4. Normalize freshdesk data into a relational structure
  5. Generate a ticket summary report

To run all of the steps end to end, run the Makefile in this directory.

git clone https://github.com/mantmic/freshdesk-data
cd freshdesk-data
make

Generate data

To generate data use the ticken_gen.py file. This can be executed in the bash terminal. Run the following to see the parameters

python3 ticket_gen.py -h

Running the ticket_gen.py will by default generate data for 1000 tickets and output the data to activities.json

python3 ticket_gen.py

DB Setup

To set up the database run the following using test.db

sqlite3 test.db
.read sql/schema.sql

Data insert

To insert data generated by the ticket_gen.py script run the data_insert.py script. Run the following to see the parameters.

python3 data_insert.py -h

Running data_insert.py will by default insert data from the activities.json file into the sqlite database, test.db

python3 data_insert.py

Normalize data

To normalize raw Freshdeck data in the sqlite schema run the following

sqlite3 test.db
.read sql/update_data.sql

Ticket summary

To output the ticket data summary report run the following

sqlite3 test.db -header
.read sql/ticket_summary.sql

About

Repo for code to generate and store example Freshdesk ticket activity data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published