Metadata-Version: 2.1
Name: EagleWrapper
Version: 1.0.0
Summary: A wrapper for an image management tool named Eagle.
Home-page: https://github.com/NatLee/eagle-wrapper
Author: Nat Lee
Author-email: natlee.work@gmail.com
Project-URL: Documentation, https://github.com/NatLee/eagle-wrapper
Project-URL: Bug Reports, https://github.com/NatLee/eagle-wrapper/issues
Project-URL: Source Code, https://github.com/NatLee/eagle-wrapper
Project-URL: Official API Documentation, https://api.eagle.cool/
Keywords: eagle,image management,wrapper
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# Eagle Wrapper

This is a python wrapper for a image and design management software named Eagle.

Its official website is https://eagle.cool/.


## API Reference

This wrapper is reference from [Eagle Official API documentation](https://api.eagle.cool/)

Some APIs are not available in this wrapper because they are not implemented.

## Usage

```bash
pip install EagleWrapper
```

> Notice: You need open Eagle when using this wrapper or it cannot find your host of Eagle.

## Method

- get_img_info_from_lib_path

> This is a method of searching file `metadata.json` of images from directly library folder, so it will fast than using `get_img_list_info`.

```python
eagle = Eagle()
source_path = '/my/lib/path/example/測試.library' # your library path
name_start_filters = ['example', 'ぼ'] # your filters with the image name
image_info = eagle.get_img_info_from_lib_path(source_path, name_start_filters)
```

- add_from_url

```python
url = 'https://s.yimg.com/ny/api/res/1.2/1ui_Mvv4s2Gtmr4uZdP.mA--/YXBwaWQ9aGlnaGxhbmRlcjt3PTk2MDtoPTY4NDtjZj13ZWJw/https://s.yimg.com/os/creatr-uploaded-images/2022-11/1f7132d0-5e6a-11ed-b7bd-ba3b4a3aed4f'
name = 'ぼっち・ざ・ろっく！'
tags = ['ぼっち', 'ろっく']
website = 'https://tw.news.yahoo.com/bocchi-the-rock-071607480.html'
annotation = 'This is an example ;)'
eagle.add_from_url(url, name, tags, website, annotation)
```

This output will show in Eagle:

![add-from-url](./doc/add-from-url.png)

- get_img_list_info

List image INFO which name starting with `ぼ` in limit 10.

```python
from eagle_wrapper import Eagle
eagle = Eagle()
max_image_number = 10 # maximum number of images for searching
name_start_filter = 'ぼ' # search filters
image_list_info = eagle.get_img_list_info(max_image_number, name_start_filter)
```

The output is:

```json
[{
    "id": "LG3YCGZW5QH1B",
    "name": "ぼっち・ざ・ろっく！",
    "size": 219336,
    "btime": 1680715050765,
    "mtime": 1680715050880,
    "ext": "jpg",
    "tags": ["ぼっち", "ろっく"],
    "folders": [],
    "isDeleted": false,
    "url": "https://tw.news.yahoo.com/bocchi-the-rock-071607480.html",
    "annotation": "This is an example ;)",
    "modificationTime": 1680715050761,
    "height": 684,
    "width": 960,
    "noThumbnail": true,
    "palettes": [
        {
            "color": [196, 172, 154],
            "ratio": 33,
            "$$hashKey": "object:1775"
        },
        {
            "color": [48, 43, 43],
            "ratio": 26,
            "$$hashKey": "object:1776"
        },
        ...
        {
            "color": [225, 204, 205],
            "ratio": 2.66,
            "$$hashKey": "object:1783"
        }
    ]
}]
```

## Contributor

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center"><a href="https://github.com/NatLee"><img src="https://avatars.githubusercontent.com/u/10178964?v=3?s=100" width="100px;" alt="Nat Lee"/><br /><sub><b>Nat Lee</b></sub></a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## License

[MIT](LICENSE)








