gslides-automator 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: gslides_automator
3
+ Version: 0.4.0
4
+ Summary: Generate data and reports from Google Sheets and Drive
5
+ Project-URL: Homepage, https://github.com/rvignesh89/gslides_automator
6
+ Classifier: Development Status :: 4 - Beta
7
+ Classifier: Intended Audience :: Developers
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE.txt
16
+ Requires-Dist: gspread>=5.0.0
17
+ Requires-Dist: google-auth>=2.0.0
18
+ Requires-Dist: google-auth-httplib2>=0.1.0
19
+ Requires-Dist: google-api-python-client>=2.0.0
20
+ Requires-Dist: pandas>=1.5.0
21
+ Provides-Extra: dev
22
+ Dynamic: license-file
23
+
24
+ # Google Slides Automator
25
+
26
+ This repository contains a python package / binary for generating multiple Google Slide reports in Google Drive by copying data from Google sheets. This package can be used to a automate pdf report generation by first modifying placeholders ({{placeholder}}) in a Google Slide with data and converting the slide to a report.
27
+
28
+ Following elements in a slide can be replaced,
29
+ 1. Text placeholders in a paragraph
30
+ 2. Charts
31
+ 3. Tables
32
+ 4. Pictures
33
+
34
+ The real value of this package is the ability to generate a report for different entities. By providing the raw data for each entity the package in a structure format the code can generate reports for each entitiy automatically.
35
+
36
+ ## Getting Started
37
+
38
+ Requirements to running the reports are:
39
+
40
+ 1. Python 3.12 or above.
41
+ 2. Google Sheets, Slides and Drive API enabled service account credentials.
42
+ 3. Access to Google Drive Shared Drive containing slide and data templates and L0 data.
43
+
44
+ ### Service Account Setup
45
+
46
+ 1. Create a service account in Google Cloud Console with the following scopes:
47
+ - https://www.googleapis.com/auth/spreadsheets
48
+ - https://www.googleapis.com/auth/drive.readonly
49
+ - https://www.googleapis.com/auth/drive.file
50
+ - https://www.googleapis.com/auth/drive
51
+ - https://www.googleapis.com/auth/presentations
52
+ 2. Download the JSON key file and save it as `service-account-credentials.json` in the project root
53
+ 3. **Important**: Share all required Google Drive files and folders with the service account email (found in the JSON file as `client_email`) with **Editor** permissions
54
+ - This includes all folders (L0-Data, L1-Data, output folders)
55
+ - All template files (spreadsheets, presentations)
56
+ - For Shared Drives, add the service account as a member with appropriate permissions
57
+
58
+ If you see "File not found" errors when trying to delete files, it means the service account doesn't have access to those files. The error messages will include the service account email that needs to be granted access.
59
+
60
+ ## How it works
61
+
62
+ The package works exclusively on Google Drive files only. One of the inputs to the package functions will be a Google Drive folder id. It expects the Google Drive to have the exact structure.
63
+
64
+ ```
65
+ /
66
+ ├── L0-Raw/
67
+ │ ├── entity-1/
68
+ │ │ ├── s1-table-performance.csv
69
+ │ │ ├── s2-chart-profit.csv
70
+ │ │ ├── s3-picture-distribution.png
71
+ │ │ └── ...
72
+ │ ├── entity-2/
73
+ │ │ ├── s1-table-performance.csv
74
+ │ │ ├── s2-chart-profit.csv
75
+ │ │ ├── s2-picture-distribution.png
76
+ │ │ └── ...
77
+ │ └── ...
78
+ ├── L1-Merged/
79
+ │ ├── entity-1/
80
+ │ │ ├── entity-1.gsheet
81
+ │ │ ├── s3-picture-distribution.png
82
+ │ ├── entity-2/
83
+ │ │ ├── entity-2.gsheet
84
+ │ │ ├── s3-picture-distribution.png
85
+ │ └── ...
86
+ ├── L2-Slide/
87
+ │ ├── entity-1.gslide
88
+ │ ├── entity-2.gslide
89
+ │ └── ...
90
+ ├── L3-Pdf/
91
+ │ ├── entity-1.pdf
92
+ │ ├── entity-2.pdf
93
+ │ └── ...
94
+ ├── templates/
95
+ │ ├── slide-template.gslide
96
+ │ ├── data-template.gsheet
97
+ │ └── ...
98
+ └── entities.csv
99
+ ```
100
+
101
+ - **entities.csv** - Two columns: first column is the entity name; the second column `generate` controls processing. Rows with `generate` set to `Y` are processed, while `N` (or blank) rows are skipped. The first row is treated as a header.
102
+
103
+ - **templates/** - This folder contains 2 files. A data template gsheet file and a slide template gslide file.
104
+
105
+ The data template is will have multiple sheets. Each sheet will have the data for a single element (chart/table/picture). One sheet will have data for a element and there can be multiple elements in a sheet.
106
+
107
+ The main purpose of template is to create charts to be embedded into the Google Slide report.
108
+
109
+ - **L3-Pdf/**: Pdf reports for each entity. These are generated by converting the Google Slide reports to pdf.
110
+
111
+ - **L2-Slide/**: Google Slide reports for each entity. These are generated by copying the slide template and replacing the placeholders with the data from the L1-Data sheet. This folder will have one slide per entity.
112
+
113
+ - **L1-Merged/**: Processed and structured data—one spreadsheet per entity, used to generate charts. This folder will have sub folders for each entity. Each entity folder will have a spreadsheet for each slide and also the pictures used in the slides.
114
+
115
+ - **L0-Raw/**: Raw input data for each entity. This folder will have sub folders for each entity. Each entity folder will have the raw data for each slide and also the pictures used in the slides.
116
+
117
+ To understand the data better refer to the drive below which contains sample data for a couple of bike dealers.
118
+
119
+ https://drive.google.com/drive/u/0/folders/1EaaTMa5H6EOuWMom_4iE6RZ51qWYf2af
120
+
121
+ ### Why is L0-Raw needed?
122
+
123
+ Technically if you are able to generate data in the L1-Merged structure you do not need L0-Raw. However, not all languages have good API's to interact with Google Sheets like R. So to be compatible in such scenarios the library provides L0-Raw as just csv files. But if have the ability to generate merged datat for L1, skip L0 data generation.
124
+
125
+ ## Steps to use the libary
126
+
127
+ WIP
128
+
129
+ ## Future work
130
+
131
+ - Distribute as binary for OSX (brew), Windows (nuget)
@@ -0,0 +1,13 @@
1
+ gslides_automator/__init__.py,sha256=M3WFqSvO_rXCTs0vqfBDst_CfBYVkjXAjztMJU3gokI,1268
2
+ gslides_automator/__main__.py,sha256=tpfodmg8j5bfNWeFkglZ8z4bzyWbwEG5Equ6XC2G0ZU,160
3
+ gslides_automator/auth.py,sha256=sWzsunyV_qYsouBO-4H8mTAmJBhnICCOpEtsACc2Q6E,3627
4
+ gslides_automator/cli.py,sha256=A-J_mo07DVcFmaatTIaMv4hZg3hYmOSW3rBmzQ3bJKg,3053
5
+ gslides_automator/drive_layout.py,sha256=ooUZ0H0bg8J6oGI5EWiXtZq0BxVRnVbR296b2OQRyeI,7231
6
+ gslides_automator/generate_data.py,sha256=CiBNLJcgk7P4LUTFDBnK_Ea-C0SE6RyNrl7MWVIqVhM,32784
7
+ gslides_automator/generate_report.py,sha256=F6pDisT-Ldg0YZn7WXefFVj5Q9zDWlv_MYjbb9FF2rU,125631
8
+ gslides_automator-0.4.0.dist-info/licenses/LICENSE.txt,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
9
+ gslides_automator-0.4.0.dist-info/METADATA,sha256=ISLT19Fr2i5qfafwZCWS4Ng9mqq2vM8UTnfm1z5iSwQ,6208
10
+ gslides_automator-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ gslides_automator-0.4.0.dist-info/entry_points.txt,sha256=Nj2M5Qx5zN19a9aLpc7DeJ5mIPCedWK3NyxYrU2w0R4,65
12
+ gslides_automator-0.4.0.dist-info/top_level.txt,sha256=3IDhIJ9O_sAtz5VZv9rBfLRY5f-vTeD0Yz8qdmMXhjU,18
13
+ gslides_automator-0.4.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ gslides_automator = gslides_automator.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ gslides_automator