Skip to main content

A Python library for working with Google Slides API using Pydantic domain objects

Project description

gslides-api

A Python library for working with Google Slides API using Pydantic domain objects.

Overview

This library provides a Pythonic interface to the Google Slides API with:

  • Pydantic domain objects that match the JSON structure returned by the Google Slides API
  • Type-safe operations with full type hints support
  • Easy-to-use methods for creating, reading, and manipulating Google Slides presentations
  • Comprehensive coverage of Google Slides API features

Installation

pip install gslides-api

Quick Start

Authentication

First, set up your Google API credentials. See CREDENTIALS.md for detailed instructions.

from gslides_api import initialize_credentials

# Initialize with your credentials directory
initialize_credentials("/path/to/your/credentials/")

Basic Usage

from gslides_api import Presentation

# Load an existing presentation
presentation = Presentation.from_id("your-presentation-id")

# Create a new blank presentation
new_presentation = Presentation.create_blank("My New Presentation")

# Access slides
for slide in presentation.slides:
    print(f"Slide ID: {slide.objectId}")
    
# Create a new slide
new_slide = presentation.add_slide()

Features

  • Domain Objects: Complete Pydantic models for all Google Slides API objects
  • Presentations: Create, load, copy, and manipulate presentations
  • Slides: Add, remove, duplicate, and reorder slides
  • Elements: Work with text boxes, shapes, images, and other slide elements
  • Layouts: Access and use slide layouts and masters
  • Requests: Type-safe request builders for batch operations
  • Markdown Support: Convert between Markdown and Google Slides content

API Coverage

The library covers most Google Slides API functionality including:

  • Presentations and slides management
  • Text elements and formatting
  • Shapes and images
  • Tables and charts
  • Page layouts and masters
  • Batch update operations

Requirements

  • Python 3.8+
  • Google API credentials (OAuth2 or Service Account)

Dependencies

  • google-api-python-client - Google API client library
  • google-auth-oauthlib - OAuth2 authentication
  • pydantic - Data validation and serialization
  • marko - Markdown processing
  • protobuf - Protocol buffer support

Development

Running Tests

pip install -e ".[test]"
pytest

Code Formatting

pip install -e ".[dev]"
black gslides_api/
isort gslides_api/

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

  • md2googleslides - TypeScript library for creating slides from Markdown
  • gslides - Python library focused on charts and tables
  • gslides-maker - Generate slides from Wikipedia content

Acknowledgments

This library is built on top of the excellent Google API Python client and leverages the power of Pydantic for type-safe data handling.

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

gslides_api-0.2.12.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gslides_api-0.2.12-py3-none-any.whl (102.8 kB view details)

Uploaded Python 3

File details

Details for the file gslides_api-0.2.12.tar.gz.

File metadata

  • Download URL: gslides_api-0.2.12.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Linux/5.15.0-139-generic

File hashes

Hashes for gslides_api-0.2.12.tar.gz
Algorithm Hash digest
SHA256 f5ce801ff9f1413b27b38f1c5d378686b6b2d1a7428a82a2b1b5e6bba763c1d8
MD5 ab5b6e36d0308d63402df8ae4469ce40
BLAKE2b-256 eddc340d28998390cb38fe10eb58d209061a333559824b8b2521e3987be6a45a

See more details on using hashes here.

File details

Details for the file gslides_api-0.2.12-py3-none-any.whl.

File metadata

  • Download URL: gslides_api-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 102.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Linux/5.15.0-139-generic

File hashes

Hashes for gslides_api-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e91b680fc6b58c2beac81b886b362921c24ca676668c385c26424774ed01e4dc
MD5 3794fc05fd35d464c3a6be292ca80272
BLAKE2b-256 66161fc2268faeb55a5cb01f1f3a1757ff73f77e0b7ba8e5974deb8885948665

See more details on using hashes here.

Supported by

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