OpenStats is a library built on top of streamlit that extracts data from the Github API and shows the main KPIs

Overview

Open Stats

Discover and share the KPIs of your OpenSource project.

Release License


OpenStats is a library built on top of streamlit that extracts data from the Github API and shows the main KPIs for an OpenSource project:

  • Star evolution: What is the popularity of the repo?
  • Good First issues: Is there a focus towards the community?
  • Recurrent collaborators: How many people are involved?
  • Repository traffic: How many visits and clones do we have?

While there many other things to take into account, these metrics help us get a taste on how our project is doing in a single view.

If you'd like to see other metrics or graphics, open an issue or jump into the action!


Requirements

  • Python 3.6+
  • The main dependencies are streamlit and pandas. The configuration is managed with Levy.
  • In terms of permissions, the traffic data requires an account (token) with write to the repo.

You can install OpenStats with:

$ pip install openstats
---> 100%
Successfully installed openstats

How does it work?

OpenStats is a helper tool to build an amazing dashboard from a config file. You can check an example here:

img

To run a streamlit app, we need the following ingredients:

  • app.py file that triggers the application.
  • requirements.txt, where we will just add openstats
  • Optionally, a .streamlit/config.toml config file with the theme.

By creating an openstats.yaml file, we will pick up the necessary information, build the streamlit components and help you generate the theme file πŸš€

This means that the final setup can look like this:

  • An app.py with:
    from openstats.app import run
    
    if __name__ == "__main__":  
        run()
  • A requirements.txt file with openstats.
  • An openstats.yaml file following the examples πŸ‘‡

Theme

To generate the theme file based on the config, you can run openstats-theme after installing openstats.

This will create the .streamlit/config.toml file with the properties defined in our openstats.yaml.

Config

Let's take a look at how to configure openstats.yaml. You can see an example here:

title: "Dashboard title"
logo_file: "Image file to show at the sidebar"

client:  # Information about the repository
  root: "api.github.com"  # We only support GitHub API
  owner: "e.g., pmbrull"
  repo: "e.g., OpenStats"
  start_date: "Start counting stars from this date"  # Format "Aug 1 2021" (`%b %d %Y`)

style:  # To generate the streamlit theme
  primary_color: "#7147E8"  # Also used for the charts coloring
  background_color: "#F9F8FD"
  secondary_background_color: "#EEEAF8"
  text_color: "#37352F"
  font: "sans serif"

social: "
        Free markdown text! Show your badges πŸ’ͺ
        "

Note that the style section is only to centralise and generate the config.toml file for streamlit. The only added value here is that we will use the primary_color for the theme and charts.

If you don't want to add any image to the sidebar, just remove the YAML entry.

More on streamlit themes πŸ‘‰ blog

Minimum Config

The app can run with as minimum configuration as:

title: "Levy"

client:
  root: "api.github.com"  # We only support GitHub API
  owner: "pmbrull"
  repo: "levy"
  start_date: "Aug 1 2021"  # Format `%b %d %Y`

Secrets

To show the traffic data and to have a higher API query rate, we need to identify ourselves to the GitHub API.

OpenStats only supports authenticated requests. To make things work, there are two options:

  1. Prepare an API_TOKEN environment variable before running the app
  2. Use streamlit secrets when publishing the app. The secret should also be named API_TOKEN.

The app will first try to obtain the token from the environment variables and will fall back to using streamlit secrets.

How to create an access token πŸ‘‰ docs

Caching

Not all computations are lightning fast. In order to provide the best possible UX, we cache the API results using streamlit memoization features. If you want to refresh the data, there is a clear cache button available.

Publishing

You can create and manage your streamlit apps at https://share.streamlit.io/. You can follow the docs for more information.

Contributing

Take a look at our CONTRIBUTING guide.

Acknowledgements

Thanks to streamlit for an amazing library and the GitHub API for sharing all the information!

License

OpenStats is released under Apache License, Version 2.0

You might also like...
Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

NorthPitch is a python soccer plotting library that sits on top of Matplotlib
NorthPitch is a python soccer plotting library that sits on top of Matplotlib

NorthPitch is a python soccer plotting library that sits on top of Matplotlib.

Wikipedia WordCloud App generate Wikipedia word cloud art created using python's streamlit, matplotlib, wikipedia and wordcloud packages
Wikipedia WordCloud App generate Wikipedia word cloud art created using python's streamlit, matplotlib, wikipedia and wordcloud packages

Wikipedia WordCloud App Wikipedia WordCloud App generate Wikipedia word cloud art created using python's streamlit, matplotlib, wikipedia and wordclou

Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner

streamlit-dashboards Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner Tutorial Video https://ww

πŸ—Ύ Streamlit Component for rendering kepler.gl maps
πŸ—Ύ Streamlit Component for rendering kepler.gl maps

streamlit-keplergl πŸ—Ύ Streamlit Component for rendering kepler.gl maps in a streamlit app. 🎈 Live Demo 🎈 Installation pip install streamlit-keplergl

This component provides a wrapper to display SHAP plots in Streamlit.
This component provides a wrapper to display SHAP plots in Streamlit.

streamlit-shap This component provides a wrapper to display SHAP plots in Streamlit.

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

Releases(v0.1.9.3)
Owner
Pere Miquel Brull
Mathematician | Big Data Engineer
Pere Miquel Brull
Domain Connectivity Analysis Tools to analyze aggregate connectivity patterns across a set of domains during security investigations

DomainCAT (Domain Connectivity Analysis Tool) Domain Connectivity Analysis Tool is used to analyze aggregate connectivity patterns across a set of dom

DomainTools 34 Dec 09, 2022
Create Badges with stats of Scratch User, Project and Studio. Use those badges in Github readmes, etc.

Scratch-Stats-Badge Create customized Badges with stats of Scratch User, Studio or Project. Use those badges in Github readmes, etc. Examples Document

Siddhesh Chavan 5 Aug 28, 2022
A declarative (epi)genomics visualization library for Python

gos is a declarative (epi)genomics visualization library for Python. It is built on top of the Gosling JSON specification, providing a simplified interface for authoring interactive genomic visualiza

Gosling 107 Dec 14, 2022
termplotlib is a Python library for all your terminal plotting needs.

termplotlib termplotlib is a Python library for all your terminal plotting needs. It aims to work like matplotlib. Line plots For line plots, termplot

Nico SchlΓΆmer 553 Dec 30, 2022
Graphing communities on Twitch.tv in a visually intuitive way

VisualizingTwitchCommunities This project maps communities of streamers on Twitch.tv based on shared viewership. The data is collected from the Twitch

Kiran Gershenfeld 312 Jan 07, 2023
Political elections, appointment, analysis and visualization in Python

Political elections, appointment, analysis and visualization in Python poli-sci-kit is a Python package for political science appointment and election

Andrew Tavis McAllister 9 Dec 01, 2022
Quickly and accurately render even the largest data.

Turn even the largest data into images, accurately Build Status Coverage Latest dev release Latest release Docs Support What is it? Datashader is a da

HoloViz 2.9k Dec 28, 2022
Customizing Visual Styles in Plotly

Customizing Visual Styles in Plotly Code for a workshop originally developed for an Unconference session during the Outlier Conference hosted by Data

Data Design Dimension 9 Aug 03, 2022
Alternative layout visualizer for ZSA Moonlander keyboard

General info This is a keyboard layout visualizer for ZSA Moonlander keyboard (because I didn't find their Oryx or their training tool particularly us

10 Jul 19, 2022
A GUI for Pandas DataFrames

About Demo Installation Usage Features More Info About PandasGUI is a GUI for viewing, plotting and analyzing Pandas DataFrames. Demo Installation Ins

Adam Rose 2.8k Dec 24, 2022
NorthPitch is a python soccer plotting library that sits on top of Matplotlib

NorthPitch is a python soccer plotting library that sits on top of Matplotlib.

Devin Pleuler 30 Feb 22, 2022
Altair extension for saving charts in a variety of formats.

Altair Saver This packge provides extensions to Altair for saving charts to a variety of output types. Supported output formats are: .json/.vl.json: V

Altair 85 Dec 09, 2022
A GUI for Pandas DataFrames

PandasGUI A GUI for analyzing Pandas DataFrames. Demo Installation Install latest release from PyPi: pip install pandasgui Install directly from Githu

Adam 2.8k Jan 03, 2023
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

Randy Zwitch 9 Nov 03, 2022
Python Package for CanvasXpress JS Visualization Tools

CanvasXpress Python Library About CanvasXpress for Python CanvasXpress was developed as the core visualization component for bioinformatics and system

Dr. Todd C. Brett 5 Nov 07, 2022
Data Visualizations for the #30DayChartChallenge

The #30DayChartChallenge This repository contains all the charts made for the #30DayChartChallenge during the month of April. This project aims to exp

Isaac Arroyo 7 Sep 20, 2022
A D3.js plugin that produces flame graphs from hierarchical data.

d3-flame-graph A D3.js plugin that produces flame graphs from hierarchical data. If you don't know what flame graphs are, check Brendan Gregg's post.

Martin Spier 740 Dec 29, 2022
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 1.6k Jan 08, 2023
Generate visualizations of GitHub user and repository statistics using GitHub Actions.

GitHub Stats Visualization Generate visualizations of GitHub user and repository statistics using GitHub Actions. This project is currently a work-in-

Aditya Thakekar 1 Jan 11, 2022
Getting started with Python, Dash and Plot.ly for the Data Dashboards team

data_dashboards Getting started with Python, Dash and Plot.ly for the Data Dashboards team Getting started MacOS users: # Install the pyenv version ma

Department for Levelling Up, Housing and Communities 1 Nov 08, 2021