Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbnomics_pptx_tools-0.2.18.tar.gz (60.3 kB view details)

Uploaded Source

Built Distribution

dbnomics_pptx_tools-0.2.18-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file dbnomics_pptx_tools-0.2.18.tar.gz.

File metadata

  • Download URL: dbnomics_pptx_tools-0.2.18.tar.gz
  • Upload date:
  • Size: 60.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for dbnomics_pptx_tools-0.2.18.tar.gz
Algorithm Hash digest
SHA256 cd7e0bb123898f360b163f83d2a4aded166a2a7f8a5553565b9037237a28e0cd
MD5 0d76421e0da67daafa262519d922bf60
BLAKE2b-256 6fad6448b0d0771f0d9eeb66a0c891b9245bed3e2add63e2fd989320aed4dab7

See more details on using hashes here.

File details

Details for the file dbnomics_pptx_tools-0.2.18-py3-none-any.whl.

File metadata

File hashes

Hashes for dbnomics_pptx_tools-0.2.18-py3-none-any.whl
Algorithm Hash digest
SHA256 fa41ebdace1c2bf38138423404f0907e88853eee3f157ac19adec18bec995ad9
MD5 11edd1029c116b619f7572aae946da2e
BLAKE2b-256 e4b55796b2b231b92a81f1400690de0707522ca72555703013864e5cf61ac4a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page