DBnomics PowerPoint (pptx) tools
Project description
DBnomics PowerPoint (pptx) tools
This CLI tool allows to update data coming from DBnomics in PowerPoint presentations.
Example
See the samples directory
Usage
First, define a YAML metadata file describing the charts and tables on each slide to update.
Read the metadata file section below for more details.
Take inspiration from the sample simple_presentation_1.yaml
fetch
command
This command reads all the series needed by the charts and tables of all slides in the YAML metadata file, deduplicate and download them in a cache directory, where they are stored as JSON files.
dbnomics-pptx fetch samples/simple_presentation_1.yaml
Use the -v
option to display debug messages.
By default, the series that always downloaded, even if they are already present in the cache directory.
Use the --resume
option otherwise.
save-data-archive
command
This command creates a ZIP archive of the series used to update the presentation (cf update
command).
dbnomics-pptx -v save-data-archive samples/simple_presentation_1.yaml series.zip
unzip -t series.zip
Archive: series.zip
testing: OECD/KEI/NAEXKP01.DEU.GP.A.csv OK
testing: OECD/GDP_GROWTH/W.Eurozone.tracker_yoy.csv OK
testing: OECD/KEI/NAEXKP01.EA20.GP.A.csv OK
testing: OECD/KEI/NAEXKP01.FRA.GP.A.csv OK
testing: OECD/GDP_GROWTH/W.USA.tracker_yoy.csv OK
testing: OECD/KEI/NAEXKP01.ITA.GP.A.csv OK
No errors detected in compressed data of series.zip.
update
command
This command takes a PowerPoint presentation file in input, and a YAML metadata file, and updates the charts and tables defined in the metadata file, then saves the result in an output presentation file (it does not modify the input one).
dbnomics-pptx update samples/simple_presentation_1.pptx --metadata-file samples/simple_presentation_1.yaml samples/simple_presentation_1.output.pptx
Use the -v
option to display debug messages.
Metadata file
Here is a dummy file with made-up IDs to show how it is structured:
slides:
AE_GDP: # the ID of the slide (as defined in the slide notes, cf below)
charts:
US_EU_GDP: # the ID of the chart (as defined in the "Selection pane")
series:
- id: OECD/GDP_GROWTH/W.USA.tracker_yoy # the ID of the series on DBnomics
name: United States
- id: OECD/GDP_GROWTH/W.Eurozone.tracker_yoy
name: Eurozone
tables:
EU_GDP: # the ID of the table (as defined in the "Selection pane")
series:
- id: OECD/KEI/NAEXKP01.EA19.GP.A
name: Euro Area
- id: OECD/KEI/NAEXKP01.DEU.GP.A
name: Germany
- id: OECD/KEI/NAEXKP01.FRA.GP.A
name: France
- id: OECD/KEI/NAEXKP01.ITA.GP.A
name: Italy
Slide ID
To be updated, a slide must have been given an ID. As PowerPoint does not provide a way to assign one, we decided to use a special string in the slide notes, by using the syntax slide_id:xxx
where xxx
is to be replaced with the real value. For example, in the YAML file above, the slide ID is AE_GDP
, so we expect the corresponding slide notes to contain the string slide_id:AE_GDP
.
Chart and table ID
The IDs of the charts and tables can be read or modified from the "Selection pane" in PowerPoint.
The "Selection pane" can be opened with Alt+F10 in PowerPoint. Then you just have to select a chart or a table, and it will highlight the corresponding line in the "Selection pane", showing its ID.
You can also modify the ID to improve readability.
Once you get the ID of a chart or a table, you can put it in the YAML file. In the previous example, the IDs are "My chart 1" and "My table 1".
See also:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dbnomics_pptx_tools-0.2.19.tar.gz
.
File metadata
- Download URL: dbnomics_pptx_tools-0.2.19.tar.gz
- Upload date:
- Size: 60.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 635e3267fd6f2b4894109be578b12ccb70f8bca211c5e9002046449d5791e0af |
|
MD5 | 0315833f6a34a8e6570c72533f3bc4bb |
|
BLAKE2b-256 | c91a3aba5c5dd7853578d951aac6508ab8ddbc4a893f4be03f06a09dd860cc4d |
File details
Details for the file dbnomics_pptx_tools-0.2.19-py3-none-any.whl
.
File metadata
- Download URL: dbnomics_pptx_tools-0.2.19-py3-none-any.whl
- Upload date:
- Size: 54.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71a148c42389eb7da7575c854b7eb61b76808b2836b9c659ca8348c5f961191f |
|
MD5 | ee185fd08c7441bb9ae05839ce27597a |
|
BLAKE2b-256 | f84d0765a3862de440f501729a473b87a6f2d7593b474f68528f98ee70b53d79 |