Skip to main content

PPTXER: A fast high-level Presentations Scraper for Python and Command Line

This project is made to make it as easy as possible to scrape presentations (pptx files) from the internet and extract their text (body and notes). It can be used in Python or command line.

Installation

pip install pptxer

Verify installation by running

pptxer --version

Downloader

This mode scrapes presentations that contains a specific keywords from search engines, and downloads them to a directory. The texts within these files will be extracted automatically unless otherwise specified.

  • To download pptx files that contain "COVID-19 Safety" and "Contagious diseases" to directory test_dir
    • Python
    from pptxer.presentations_downloader import scrape_presentations_to_dir
    
    search_keywords = ["COVID-19 Safety", "Contagious diseases"]
    # If download_dir_path is skipped, then a directory with search keywords splitted by "_" will be created
    paths_to_files = scrape_presentations_to_dir(search_keywords, download_dir_path="test_dir")
    # For this example, a directory with name "test_dir" will be created, and files will be written to it
    
    • Command line
      # This will download presentations to test_dir and extract their texts to a json file
      pptxer download "COVID-19 Safety" "Contagious diseases" --dst test_dir
      # To only download
      pptxer download "COVID-19 Safety" "Contagious diseases" --dst test_dir --no-extract-text
    

Extractor

This mode extracts texts from pptx files and outputs a dict with each slide body and note texts. If command line is used then a json file will be outputted.

  • To extract text from presentation files (pptx) or loop through presentation files within a directory
    • Python
    # Single file
    texts = extract_presentations_texts(["directory/test.pptx"])
    
    # Directory. Will scan the directory for pptx file, extract their texts and return them
    texts = extract_presentations_texts(["directory/"])
    
    # Combined file and directory
    texts = extract_presentations_texts(["directory/", "directory2/test.pptx"])
    
    • Command line
    # Single file
    pptxer extract directory/test.pptx
    # Directory
    pptxer extract directory/
    # File and directory
    pptxer extract directory1 directory2/test.pptx
    
    The output will be similar to the following:
[{
'path': 'test.pptx', 
'slides': [
            {'noteText': 'Note Line 1\nNote Line 2', 'bodyText': 'Label Test 1Body Line 1\nBody Line 2'}, 
            {'noteText': 'Note Line 1\nNote Line2', 'bodyText': ''}], 
            'bodyTextLengthStats': {'totalLength': 35, 'avgLength': 17.5, 'minLength': 0, 'maxLength': 35, 'medianLength': 17.5}, 
            'noteTextLengthStats': {'totalLength': 45, 'avgLength': 22.5, 'minLength': 22, 'maxLength': 23, 'medianLength': 22.5}
}]

Rate Limit

As of now, we're using third-party search engines to look up files, and almost all search engines throttle or soft ban if they detected automated queries coming from your IP. The soft ban usually lasts about a day, and you will not be able to use pptxer in meanwhile, but you can use any search engines on your browser normally.

Issues

Feel free to open an issue if you have any problems.

Metadata

Release files for pptxer 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pptxer 0.1
File Size Uploaded Provenance Actions
pptxer-0.1.tar.gz 9.4 kB Without provenance Details for pptxer-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pptxer 0.1
File Interpreter ABI Platform Actions
pptxer-0.1-py3-none-any.whl Python 3 none any Details for pptxer-0.1-py3-none-any.whl

Total release size: 19.1 kB

Release files / pptxer-0.1.tar.gz

Download URL pptxer-0.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
92915301d664508b26478d3617bc14182cb676af8af36c1d947187614c36eb78
BLAKE2b-256 checksum
How to use checksums
cbbc5c791eed13d9725ccd0efabab5a1253c81dc588742c886b68faa761a3a37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Release files / pptxer-0.1-py3-none-any.whl

Download URL pptxer-0.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dccc077a762054b42ba0bcd0fcac2040c963cb0eaa06bbbc9ba847e9914363a0
BLAKE2b-256 checksum
How to use checksums
9dd5aa26e48a7fb9a65cc01434133e2afcf3e33176fdec9182e166dc0bb49d2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Security for pptxer 0.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.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page