Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.12.0
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 applicationstyle.cssβ a clean style file with no background imagesrequirements.txtβ Python dependencies2a_Python_Analysis_Constance_Gonnelle.ipynbβ the analysis notebookbooks_data.csvβ sales datasetsynthetic_book_reviews.csvβ reviews dataset
How it works
- The app copies
books_data.csvtosynthetic_sales_data.csvbecause the notebook expects that filename. - The app executes the notebook with
papermill. - The notebook writes figures and tables to
artifacts/py/figuresandartifacts/py/tables. - 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.pngartifacts/py/figures/sentiment_distribution_sampled_titles.pngartifacts/py/figures/arima_forecasts_sampled_titles.pngartifacts/py/figures/kpis.jsonartifacts/py/tables/df_dashboard.csvartifacts/py/tables/sentiment_counts_sampled.csvartifacts/py/tables/top_titles_by_units_sold.csv
Deploy on Hugging Face Spaces
- Create a new Gradio Space.
- Upload all files from this package.
- Wait for the build to finish.
- Open the Space and click Run notebook.
- Open Dashboard to inspect the generated outputs.
Notes
- The notebook contains a
!pip install ...cell. It is better to keep dependencies inrequirements.txt, but the app can still run with the current notebook. - If you change the notebook filename, update the
NB_ANALYSISenvironment variable or rename the file in the repository.