gslides: Creating charts in Google slides
gslides is a Python package that helps analysts turn pandas dataframes into Google slides & sheets charts by configuring and executing Google API calls.
The package provides a set of classes that enable the user full control over the creation of new visualizations through configurable parameters while eliminating the complexity of working directly with the Google API.
Quick Installation
pip install gslides
Usage
Below is an example that only showcases a simple workflow. Full discussion around features can be found in the docs.
1. Initialize package and connection
import gslides
from gslides import (
Frame,
Presentation,
Spreadsheet,
Table,
Series, Chart
)
from sklearn import datasets
gslides.initialize_credentials(creds) #BringYourOwnCredentials
2. Create a presentation
prs = Presentation.create(name = 'demo pres')
3. Create a spreadsheet
spr = Spreadsheet.create(
title = 'demo spreadsheet',
sheet_names = ['demo sheet']
)
4. Load the data to the spreadsheet
plt_df = #Iris data
frame = Frame.create(df = plt_df,
spreadsheet_id = spr.spreadsheet_id,
sheet_id = spr.sheet_names['demo sheet'],
sheet_name = 'demo sheet',
overwrite_data = True
)
5. Create a scatterplot
sc = Series.scatter(series_columns = target_names)
ch = Chart(
data = frame.data,
x_axis_column = 'sepal length (cm)',
series = [sc],
title = f'Demo Chart',
x_axis_label = 'Sepal Length',
y_axis_label = 'Petal Width',
legend_position = 'RIGHT_LEGEND',
)
6. Create a table
tbl = Table(
data = plt_df.head()
)
7. Create a slide with the scatterplot
prs.add_slide(
objects = [ch, tbl],
layout = (1,2),
title = "Investigation into Fischer's Iris dataset",
notes = "Data from 1936"
)
8. Preview the slide you have just created in your notebook
prs.show_slide(prs.slide_ids[-1])
gslides also supports basic templating functionality. See this notebook for an example.
Advanced Usage
Find this Jupyter notebook detailing advanced usage of gslides.
Developer Instructions
To install the package with development dependencies run the command
pip install -e .[dev]
This will enable the following
Metadata
Release files for gslides 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gslides-0.1.1.tar.gz | 240.9 kB | Without provenance | Details for gslides-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gslides-0.1.1-py37-none-any.whl | Python 3.7 | none | any | Details for gslides-0.1.1-py37-none-any.whl |
Total release size: 283.3 kB
Release files / gslides-0.1.1.tar.gz
| Download URL | gslides-0.1.1.tar.gz |
|---|---|
| Size | 240.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
920fe9c3e74c07c48ad7d6862964961f408ed12ec8f893c23bc7f3a49cd65280
|
|
BLAKE2b-256 checksum How to use checksums |
305bd4212ec8cf3fd3f10af66c330ab01f75d9fd30dbb4f60d96b9c36a466992
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / gslides-0.1.1-py37-none-any.whl
| Download URL | gslides-0.1.1-py37-none-any.whl |
|---|---|
| Size | 42.5 kB |
| Tags | Python 3.7 |
|
SHA-256 checksum How to use checksums |
99d07186b8c5bbee401a8ac3d8749d7d0c7349962c7354b70fa19fe1eadc5468
|
|
BLAKE2b-256 checksum How to use checksums |
f8f3af78ea7a78917ee8001898b9bf57ee7a85025c253dc3c728e72aa1e7b7ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for gslides 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.