2.0 KiB
2.0 KiB
pyPhotoAlbum Examples
This directory contains working examples demonstrating various features of pyPhotoAlbum.
Available Examples
basic_usage.py
Demonstrates the fundamentals of creating a photo album project:
- Creating a project
- Adding pages with images
- Working with text boxes
- Saving and loading projects
- Asset management
Run:
python basic_usage.py
template_example.py
Shows how to work with the template system:
- Creating custom templates
- Applying templates to pages
- Using built-in templates
- Template scaling modes
Run:
python template_example.py
generate_screenshots.py
Script to generate documentation screenshots programmatically:
- Creates example projects
- Captures screenshots for documentation
- Demonstrates various layouts
Run:
python generate_screenshots.py
This creates screenshots in examples/screenshots/ directory.
Requirements
Make sure you have pyPhotoAlbum installed:
# From the project root
pip install -e .
Sample Images
The examples use placeholder images. To use your own:
- Create an
images/directory in the examples folder - Add your sample images
- Update the image paths in the example scripts
Output
Examples will create:
examples/output/- Generated project files (.ppz)examples/screenshots/- Documentation screenshotsexamples/pdfs/- Exported PDFs
These directories are created automatically when you run the examples.
Notes
- The examples use realistic page sizes (A4, square formats)
- DPI settings match typical print requirements (300 DPI)
- All examples include error handling and cleanup
- Examples demonstrate both programmatic and template-based workflows
Regenerating Documentation Screenshots
To update screenshots for the documentation:
- Run
python generate_screenshots.py - Review generated images in
screenshots/ - Copy needed screenshots to documentation
The script generates:
- UI screenshots
- Layout examples
- Template demonstrations
- Feature showcases