123 / README.md
Constance2222's picture
Upload 7 files
542b1cf verified

A newer version of the Gradio SDK is available: 6.12.0

Upgrade
metadata
title: Book Analytics Space
emoji: πŸ“š
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 5.22.0
app_file: app.py
pinned: false

Book Analytics Space

This Hugging Face Space runs a Jupyter notebook on two CSV datasets and then exposes the outputs in a Gradio interface.

Files included

  • app.py β€” the Gradio application
  • style.css β€” a clean style file with no background images
  • requirements.txt β€” Python dependencies
  • 2a_Python_Analysis_Constance_Gonnelle.ipynb β€” the analysis notebook
  • books_data.csv β€” sales dataset
  • synthetic_book_reviews.csv β€” reviews dataset

How it works

  1. The app copies books_data.csv to synthetic_sales_data.csv because the notebook expects that filename.
  2. The app executes the notebook with papermill.
  3. The notebook writes figures and tables to artifacts/py/figures and artifacts/py/tables.
  4. The Dashboard tab reads those outputs and displays KPIs, charts, images, and tables.

Expected notebook exports

The current app is ready for these notebook outputs:

  • artifacts/py/figures/sales_trends_sampled_titles.png
  • artifacts/py/figures/sentiment_distribution_sampled_titles.png
  • artifacts/py/figures/arima_forecasts_sampled_titles.png
  • artifacts/py/figures/kpis.json
  • artifacts/py/tables/df_dashboard.csv
  • artifacts/py/tables/sentiment_counts_sampled.csv
  • artifacts/py/tables/top_titles_by_units_sold.csv

Deploy on Hugging Face Spaces

  1. Create a new Gradio Space.
  2. Upload all files from this package.
  3. Wait for the build to finish.
  4. Open the Space and click Run notebook.
  5. Open Dashboard to inspect the generated outputs.

Notes

  • The notebook contains a !pip install ... cell. It is better to keep dependencies in requirements.txt, but the app can still run with the current notebook.
  • If you change the notebook filename, update the NB_ANALYSIS environment variable or rename the file in the repository.