Python library for bridging Eagle js environment
Project description
Eagle Cooler 🦅❄️
A modern Python wrapper for the Eagle.cool HTTP API. Works independently with Eagle's web API or seamlessly integrates with the Power Eagle plugin system for enhanced functionality.
✨ Features
- 🚀 Complete API Coverage - Full implementation of Eagle's HTTP API
- 🔐 Flexible Authentication - Works standalone with manual token setup or automatically with Power Eagle
- 📝 Type Hints - Better development experience with full type annotations
- 🎯 Easy-to-use Interface - Clean, class-based API design
- ⚡ Modern Python - Built for Python 3.13+ with modern best practices
- 🔌 Plugin Ready - Enhanced integration with Power Eagle plugin ecosystem
- 🏠 Standalone Ready - Can work independently with just Eagle's web API
📦 Installation
Install the latest stable version from PyPI:
# Using uv (recommended)
uv add eagle-cooler
# Using pip
pip install eagle-cooler
# For development
git clone https://github.com/ZackaryW/py-eagle-cooler.git
cd py-eagle-cooler
uv sync --dev
🚀 Quick Start
Standalone Usage (Web API Only)
For basic functionality using Eagle's HTTP API directly:
from eagle_cooler import EagleWebApi
# Get application info
app_info = EagleWebApi.application.info()
print(f"Eagle version: {app_info['version']}")
# List folders
folders = EagleWebApi.folder.list()
print(f"Found {len(folders)} folders")
# Create a new folder
new_folder = EagleWebApi.folder.create("My New Folder")
print(f"Created: {new_folder['name']}")
# List items with filters
items = EagleWebApi.item.list(limit=10, ext="jpg")
print(f"Found {len(items)} JPG images")
# Add item from URL
result = EagleWebApi.item.add_from_url(
url="https://example.com/image.jpg",
name="Example Image",
tags=["example", "test"]
)
# Add item from local file
local_item = EagleWebApi.item.add_from_path(
path="/path/to/image.jpg",
name="Local Image",
tags=["local"]
)
Power Eagle Integration (Enhanced Features)
When running in a Power Eagle context, access to enhanced features:
# In a Power Eagle Python script
from eagle_cooler import eagleContext, EagleCallback
# Get selected items and folders from Power Eagle context
selected_items = eagleContext.get_selected_items()
selected_folders = eagleContext.get_selected_folders()
# Get just the IDs if needed
selected_item_ids = eagleContext.get_selected_item_ids()
selected_folder_ids = eagleContext.get_selected_folder_ids()
# Use callback system for advanced plugin operations
# (extensive callback API available for plugin development)
📚 API Reference
🏢 Application
EagleWebApi.application.info()- Get application information
📁 Folders
EagleWebApi.folder.create(name, parent_id=None)- Create folderEagleWebApi.folder.rename(folder_id, new_name)- Rename folderEagleWebApi.folder.update(folder_id, new_name=None, new_description=None, new_color=None)- Update folder propertiesEagleWebApi.folder.list()- List all foldersEagleWebApi.folder.list_recent()- List recent folders
📚 Library
EagleWebApi.library.info()- Get library informationEagleWebApi.library.history()- Get library historyEagleWebApi.library.switch(library_path)- Switch to different libraryEagleWebApi.library.icon(library_path)- Get library icon
🖼️ Items
EagleWebApi.item.list(limit=None, offset=None, order_by=None, keyword=None, ext=None, tags=None, folders=None)- List items with filtersEagleWebApi.item.get_info(item_id)- Get item detailsEagleWebApi.item.get_thumbnail(item_id)- Get item thumbnailEagleWebApi.item.update(item_id, tags=None, annotation=None, url=None, star=None)- Update item propertiesEagleWebApi.item.add_from_url(url, name, website=None, tags=None, star=None, annotation=None, modification_time=None, folder_id=None, headers=None)- Add item from URLEagleWebApi.item.add_from_path(path, name, website=None, annotation=None, tags=None, folder_id=None)- Add item from file pathEagleWebApi.item.add_from_urls(items, folder_id=None)- Add multiple items from URLsEagleWebApi.item.add_bookmark(url, name, base64=None, tags=None, modification_time=None, folder_id=None)- Add bookmarkEagleWebApi.item.move_to_trash(item_ids)- Move items to trashEagleWebApi.item.refresh_thumbnail(item_id)- Refresh thumbnailEagleWebApi.item.refresh_palette(item_id)- Refresh color palette
🔧 Context (Power Eagle Mode)
eagleContext.get_selected_item_ids()- Get selected item IDs from Power Eagle contexteagleContext.get_selected_folder_ids()- Get selected folder IDs from Power Eagle contexteagleContext.get_selected_items(throw=False)- Get selected items as typed ItemModel objectseagleContext.get_selected_folders()- Get selected folders as typed FolderModel objects
📞 Callbacks (Power Eagle Plugins)
EagleCallback- Callback system for Power Eagle plugin integration (extensive API available)
🔌 Usage Modes
Eagle Cooler supports two usage modes:
🏠 Standalone Mode (Web API)
- Limited Capacity: Basic API operations through Eagle's HTTP interface
- Manual Setup: Requires Eagle application running with HTTP API enabled
- Authentication: Uses direct API calls (no token management)
- Features: Core operations like listing, creating folders, basic item management
🚀 Power Eagle Mode (Enhanced)
- Full Capacity: Complete feature set with enhanced functionality
- Automatic Setup: Token and context management handled automatically
- Authentication: Seamless integration with Power Eagle's security context
- Features: All core operations plus callbacks, advanced file operations, and plugin ecosystem integration
# Standalone mode example
from eagle_cooler import EagleWebApi
# Basic operations available
folders = EagleWebApi.folder.list()
# Power Eagle mode example (when POWEREAGLE_CONTEXT is available)
from eagle_cooler import EagleWebApi, eagleContext, EagleCallback
# Enhanced operations available:
# 1. Automatic token management
folders = EagleWebApi.folder.list()
# 2. Access to Power Eagle context with typed models
selected_items = eagleContext.get_selected_items() # Returns list[ItemModel]
selected_folders = eagleContext.get_selected_folders() # Returns list[FolderModel]
# 3. Callback system for advanced plugin operations
if selected_items:
for item in selected_items:
print(f"Selected item: {item['name']} ({item['ext']})")
# Use callback system to interact with Power Eagle host
# (extensive callback API available - see METHODS_WITH_RETURN_VALUES)
⚙️ Requirements
- Python: >= 3.13
- Eagle.cool: Application running with API access enabled
- Dependencies:
requests >= 2.25.0 - For Power Eagle:
POWEREAGLE_CONTEXTenvironment variable set
Setup Eagle API Access
- Open Eagle.cool application
- Go to Preferences → Plugin
- Enable HTTP API
- Note the API port (default: 41595)
🤝 Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/py-eagle-cooler.git cd py-eagle-cooler
- Install development dependencies:
uv sync --dev
- Make your changes
- Run tests (when available):
uv run pytest
- Submit a pull request
Development Setup
# Clone the repository
git clone https://github.com/ZackaryW/py-eagle-cooler.git
cd py-eagle-cooler
# Install with development dependencies
uv sync --dev
# Run the package in development mode
uv run python -m eagle_cooler
📜 License
This project is licensed under the same terms as Power Eagle.
Built with ❤️ for the Eagle.cool community
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 eagle_cooler-0.1.0.tar.gz.
File metadata
- Download URL: eagle_cooler-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65df66c5efba787a5bc3e664880f04317d7ab0b46caeafd48b0d484f588a6e7b
|
|
| MD5 |
d59765e3debc1cd3dc2192f4ab06ed29
|
|
| BLAKE2b-256 |
dae6c4de097905e033eb07a688f2f31f9307226a825213a56c91332acf6e7ca7
|
Provenance
The following attestation bundles were made for eagle_cooler-0.1.0.tar.gz:
Publisher:
publish.yml on eagle-cooler/py-eagle-cooler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eagle_cooler-0.1.0.tar.gz -
Subject digest:
65df66c5efba787a5bc3e664880f04317d7ab0b46caeafd48b0d484f588a6e7b - Sigstore transparency entry: 529715875
- Sigstore integration time:
-
Permalink:
eagle-cooler/py-eagle-cooler@04a7ac8db7e60f1a56841b09d0ff66869dda4b32 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/eagle-cooler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04a7ac8db7e60f1a56841b09d0ff66869dda4b32 -
Trigger Event:
release
-
Statement type:
File details
Details for the file eagle_cooler-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eagle_cooler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9109f345d14b02c75d8fee7c552b6397cdf78920a4d44b6eb18230b65a1f8840
|
|
| MD5 |
3ec83a1e1e036dd5fbd56c4e37dfa2e7
|
|
| BLAKE2b-256 |
7b21264c6ae01ede5bd13f735eb9ae19c4662c39fd0b55e46eeac1a5204a137c
|
Provenance
The following attestation bundles were made for eagle_cooler-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on eagle-cooler/py-eagle-cooler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eagle_cooler-0.1.0-py3-none-any.whl -
Subject digest:
9109f345d14b02c75d8fee7c552b6397cdf78920a4d44b6eb18230b65a1f8840 - Sigstore transparency entry: 529715886
- Sigstore integration time:
-
Permalink:
eagle-cooler/py-eagle-cooler@04a7ac8db7e60f1a56841b09d0ff66869dda4b32 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/eagle-cooler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04a7ac8db7e60f1a56841b09d0ff66869dda4b32 -
Trigger Event:
release
-
Statement type: