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 librarygoogle-auth-oauthlib- OAuth2 authenticationpydantic- Data validation and serializationmarko- Markdown processingprotobuf- 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gslides_api-0.1.29.tar.gz.
File metadata
- Download URL: gslides_api-0.1.29.tar.gz
- Upload date:
- Size: 57.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e51af0b947d48d013f264a32696520e02a13a98cc6d52fc2198fce52dab809d8
|
|
| MD5 |
0eb871341f6548c093473932674d1990
|
|
| BLAKE2b-256 |
38a8ca517d1b2cb2e346a53bd12055d5fc020498d64b1e73ed0044f8ae27666f
|
File details
Details for the file gslides_api-0.1.29-py3-none-any.whl.
File metadata
- Download URL: gslides_api-0.1.29-py3-none-any.whl
- Upload date:
- Size: 72.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71ff046219afa4817a3b379a4fa3817af04bba275f8fa4b42e0e269ca27c0ac1
|
|
| MD5 |
2512a15ccd28f0f18f8a9bb18accf27c
|
|
| BLAKE2b-256 |
8e8dc367be627c3d43a0c435a592c2fdb5dec07923a2850f5398f50ad084079b
|