Skip to content
Nat Lee

Keyboard shortcuts

Turn these off if they get in the way of a screen reader or voice control. The setting is saved in this browser.

1
Home
2
Work
3
Projects
4
About
5
Experience
/
Search projects
?
Show this panel

API/SDK

EagleWrapper

Eagle’s local APIs, in Python

Script Eagle’s V1 and V2 APIs to import, search and tag files. Also read a library from disk when the desktop app is closed.

Role
Creator & Maintainer
Period
2022 – 2026.11
Status
Completed
Categories
Libraries & tools
Stack
  • Python
  • HTTP API
  • Eagle V1 / V2
EagleWrapper, screenshot 1

Overview

A Python wrapper for both generations of Eagle’s local HTTP API. It supports file import, search, tags and folders, plus reading a library directly from disk. The updated client makes remote authentication and API errors explicit.

What it's good for

Scripts written for the 2023 release run unchanged, so upgrading costs nothing, and the README maps the V1 calls to their V2 counterparts for when you move. Big libraries can also be read straight from disk, faster than the API and with Eagle closed.

How it fits together

Simplified on purpose. The real thing has more arrows and at least one config file nobody understands.

It read the API docs so you don't have to.

  1. Your script
    • Downloader or tagger
    • yande-and-konachan-to-eagle
    → Python calls
  2. This oneEagleWrapper
    • Eagle() V1 methods
    • Eagle().v2 Web API
    • Library folder reader
    → HTTP or disk
  3. Eagle library

    Eagle app
    • port 41595
    Library folder
    • metadata.json on disk

Point at a box to see what it connects to.

What one add_from_url call leaves in Eagle: the image, its name, tags, note and source URL
What one add_from_url call leaves in Eagle: the image, its name, tags, note and source URL

Features

  • Clients for Eagle V1 and V2 APIs
  • File import, search, tags and folder operations
  • Direct library reads without the desktop app
  • Explicit API errors and authentication support

What I learned

  • add_from_path returns Eagle's whole reply as a dict, and a dict is always truthy, so if eagle.add_from_path(...) passes even when Eagle refused the file.
  • 1.1.1 treated a single string filter as one prefix per character; since 1.2.0 it is one prefix, as anyone would have guessed.
  • Version numbers now follow Eagle's API generation, so major 2 means Web API V2; 2.0.0 is the 1.2.0 code with that rule written down.
  • V1 and V2 clients talk to Eagle over HTTP, or it reads the library folder from disk
    V1 and V2 clients talk to Eagle over HTTP, or it reads the library folder from disk
  • Spin-off · Infortrend
    Libraries & toolsVision & imaging7070 stars on GitHub

    Blur Generator

    Makes perfectly good images worse on purpose: motion, lens, Gaussian and depth-aware blur, for training models that have to cope with bad photos.

    2021Completed
  • Libraries & toolsVision & imaging2626 stars on GitHub

    HEIC2PNG

    Turns iPhone HEIC photos into PNG from the CLI, a shell pipe or Python. A small tool for a small, recurring annoyance.

    2022Completed
  • Spin-off · Infortrend
    Libraries & toolsVision & imaging7676 stars on GitHub

    Batch Crop Images

    Draw a crop box once and it is applied to a whole folder of similar images. Written because I refused to crop them one by one, and apparently other people refused too.

    2019Completed