This is a Python script that compiles csv files of blog post views from Wordpress' Jetpack.
The wordpress website is under a Business Plan, equipped with Jetpack plug-in.

As there is currently no other way to download data except as to save them as csv files (link), I made a Python script that puts together data from all the downloaded csv files.
- Make sure all csv files are saved in a target folder.
- The Jetpack stats have no headers, has 3 columns corresponding to the post title, views and the URL.
- The program creates a dataframe that will contain the relevant data.
- For every csv file, the program takes the month label from the filename and creates a new column that will contain the views of each post. The resulting dataframe will have the following columns: Post title (values: titles) and 1 month for every available file (values: views).
- The program outputs a csv file in a nested folder labeled "results". This is an example of the table that combines all the monthly views.
- Additionally, if you are doing data analysis on the site analytics, the program also outputs the data into long format via pd.melt for easier data visualization with your tool of choice. It outputs a csv file labeled "tidy" in the results folder.




You can study your analytics easier:
