EagleWrapper


NameEagleWrapper JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/NatLee/eagle-wrapper
SummaryA wrapper for an image management tool named Eagle.
upload_time2023-04-05 21:02:13
maintainer
docs_urlNone
authorNat Lee
requires_python>=3.6
license
keywords eagle image management wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![repo-logo](https://raw.githubusercontent.com/NatLee/Eagle-Wrapper/main/doc/repo-logo.png)

# Eagle Wrapper

[![PyPI pyversions](https://img.shields.io/pypi/pyversions/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI implementation](https://img.shields.io/pypi/implementation/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)

[![Test](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/test.yml/badge.svg)](https://github.com/NatLee/Eagle-Wrappger/actions/workflows/test.yml)[![Release](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/release.yml/badge.svg)](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/release.yml)

[![PyPI status](https://img.shields.io/pypi/status/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI license](https://img.shields.io/pypi/l/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)

[![PyPI version fury.io](https://badge.fury.io/py/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)

[![PyPI download month](https://img.shields.io/pypi/dm/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI download week](https://img.shields.io/pypi/dw/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI download day](https://img.shields.io/pypi/dd/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)

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/)

List APIs are available in this wrapper.

### Applications

- [x] /api/application/info -> `get_application_info`

### Folder

- [x] /api/folder/create -> `create_folder`
- [x] /api/folder/rename -> `rename_folder`
- [x] /api/folder/update -> `update_folder`
- [x] /api/folder/list -> `list_folders`
- [x] /api/folder/listRecent -> `get_recent_folders`

### Item

- [x] /api/item/addFromURL -> `add_from_url`
- [x] /api/item/addFromURLs -> `add_from_urls`
- [x] /api/item/addFromPath -> `add_from_path`
- [x] /api/item/addFromPaths -> `add_from_paths`
- [x] /api/item/addBookmark -> `add_bookmark`
- [x] /api/item/info -> `get_item_info`
- [x] /api/item/thumbnail -> `get_thumbnail_path`
- [x] /api/item/list -> `list_items`
- [x] /api/item/moveToTrash -> `move_to_trash`
- [x] /api/item/refreshPalette -> `refresh_palette`
- [x] /api/item/refreshThumbnail -> `refresh_thumbnail`
- [x] /api/item/update -> `update_item`

### Library

- [x] /api/library/info -> `get_library_info`
- [x] /api/library/history -> `get_library_history`
- [x] /api/library/switch -> `switch_library`

## 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
from eaglewrapper import Eagle
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
from eaglewrapper import Eagle
eagle = Eagle()
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](https://raw.githubusercontent.com/NatLee/Eagle-Wrapper/main/doc/add-from-url.png)

- get_img_list_info

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

```python
from eaglewrapper 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)









            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NatLee/eagle-wrapper",
    "name": "EagleWrapper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "eagle,image management,wrapper",
    "author": "Nat Lee",
    "author_email": "natlee.work@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/73/82/6c5b99ae0d0b35aa0fdcbaef01bc33283b2adeeece3166f56e6800790f5a/EagleWrapper-1.1.1.tar.gz",
    "platform": null,
    "description": "![repo-logo](https://raw.githubusercontent.com/NatLee/Eagle-Wrapper/main/doc/repo-logo.png)\n\n# Eagle Wrapper\n\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI implementation](https://img.shields.io/pypi/implementation/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)\n\n[![Test](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/test.yml/badge.svg)](https://github.com/NatLee/Eagle-Wrappger/actions/workflows/test.yml)[![Release](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/release.yml/badge.svg)](https://github.com/NatLee/Eagle-Wrapper/actions/workflows/release.yml)\n\n[![PyPI status](https://img.shields.io/pypi/status/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI license](https://img.shields.io/pypi/l/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)\n\n[![PyPI version fury.io](https://badge.fury.io/py/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)\n\n[![PyPI download month](https://img.shields.io/pypi/dm/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI download week](https://img.shields.io/pypi/dw/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)[![PyPI download day](https://img.shields.io/pypi/dd/EagleWrapper.svg)](https://pypi.python.org/pypi/EagleWrapper/)\n\n[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)\n\nThis is a python wrapper for a image and design management software named Eagle.\n\nIts official website is https://eagle.cool/.\n\n\n## API Reference\n\nThis wrapper is reference from [Eagle Official API documentation](https://api.eagle.cool/)\n\nList APIs are available in this wrapper.\n\n### Applications\n\n- [x] /api/application/info -> `get_application_info`\n\n### Folder\n\n- [x] /api/folder/create -> `create_folder`\n- [x] /api/folder/rename -> `rename_folder`\n- [x] /api/folder/update -> `update_folder`\n- [x] /api/folder/list -> `list_folders`\n- [x] /api/folder/listRecent -> `get_recent_folders`\n\n### Item\n\n- [x] /api/item/addFromURL -> `add_from_url`\n- [x] /api/item/addFromURLs -> `add_from_urls`\n- [x] /api/item/addFromPath -> `add_from_path`\n- [x] /api/item/addFromPaths -> `add_from_paths`\n- [x] /api/item/addBookmark -> `add_bookmark`\n- [x] /api/item/info -> `get_item_info`\n- [x] /api/item/thumbnail -> `get_thumbnail_path`\n- [x] /api/item/list -> `list_items`\n- [x] /api/item/moveToTrash -> `move_to_trash`\n- [x] /api/item/refreshPalette -> `refresh_palette`\n- [x] /api/item/refreshThumbnail -> `refresh_thumbnail`\n- [x] /api/item/update -> `update_item`\n\n### Library\n\n- [x] /api/library/info -> `get_library_info`\n- [x] /api/library/history -> `get_library_history`\n- [x] /api/library/switch -> `switch_library`\n\n## Usage\n\n```bash\npip install EagleWrapper\n```\n\n> Notice: You need open Eagle when using this wrapper or it cannot find your host of Eagle.\n\n## Method\n\n- get_img_info_from_lib_path\n\n> 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`.\n\n```python\nfrom eaglewrapper import Eagle\neagle = Eagle()\nsource_path = '/my/lib/path/example/\u6e2c\u8a66.library' # your library path\nname_start_filters = ['example', '\u307c'] # your filters with the image name\nimage_info = eagle.get_img_info_from_lib_path(source_path, name_start_filters)\n```\n\n- add_from_url\n\n```python\nfrom eaglewrapper import Eagle\neagle = Eagle()\nurl = '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'\nname = '\u307c\u3063\u3061\u30fb\u3056\u30fb\u308d\u3063\u304f\uff01'\ntags = ['\u307c\u3063\u3061', '\u308d\u3063\u304f']\nwebsite = 'https://tw.news.yahoo.com/bocchi-the-rock-071607480.html'\nannotation = 'This is an example ;)'\neagle.add_from_url(url, name, tags, website, annotation)\n```\n\nThis output will show in Eagle:\n\n![add-from-url](https://raw.githubusercontent.com/NatLee/Eagle-Wrapper/main/doc/add-from-url.png)\n\n- get_img_list_info\n\nList image INFO which name starting with `\u307c` in limit 10.\n\n```python\nfrom eaglewrapper import Eagle\neagle = Eagle()\nmax_image_number = 10 # maximum number of images for searching\nname_start_filter = '\u307c' # search filters\nimage_list_info = eagle.get_img_list_info(max_image_number, name_start_filter)\n```\n\nThe output is:\n\n```json\n[{\n    \"id\": \"LG3YCGZW5QH1B\",\n    \"name\": \"\u307c\u3063\u3061\u30fb\u3056\u30fb\u308d\u3063\u304f\uff01\",\n    \"size\": 219336,\n    \"btime\": 1680715050765,\n    \"mtime\": 1680715050880,\n    \"ext\": \"jpg\",\n    \"tags\": [\"\u307c\u3063\u3061\", \"\u308d\u3063\u304f\"],\n    \"folders\": [],\n    \"isDeleted\": false,\n    \"url\": \"https://tw.news.yahoo.com/bocchi-the-rock-071607480.html\",\n    \"annotation\": \"This is an example ;)\",\n    \"modificationTime\": 1680715050761,\n    \"height\": 684,\n    \"width\": 960,\n    \"noThumbnail\": true,\n    \"palettes\": [\n        {\n            \"color\": [196, 172, 154],\n            \"ratio\": 33,\n            \"$$hashKey\": \"object:1775\"\n        },\n        {\n            \"color\": [48, 43, 43],\n            \"ratio\": 26,\n            \"$$hashKey\": \"object:1776\"\n        },\n        ...\n        {\n            \"color\": [225, 204, 205],\n            \"ratio\": 2.66,\n            \"$$hashKey\": \"object:1783\"\n        }\n    ]\n}]\n```\n\n## Contributor\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <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>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\n## License\n\n[MIT](LICENSE)\n\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A wrapper for an image management tool named Eagle.",
    "version": "1.1.1",
    "split_keywords": [
        "eagle",
        "image management",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "391bd692ff9d59995854f0f6ce143476967948d3d38ef8f8c6bf9dfc0fec33b7",
                "md5": "be0e19c46003681aba7192ad389ddfbd",
                "sha256": "258bac3454e397c2191145e3353ffceb2948642fd2ba595fad85d588d57ee168"
            },
            "downloads": -1,
            "filename": "EagleWrapper-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "be0e19c46003681aba7192ad389ddfbd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9784,
            "upload_time": "2023-04-05T21:02:11",
            "upload_time_iso_8601": "2023-04-05T21:02:11.493435Z",
            "url": "https://files.pythonhosted.org/packages/39/1b/d692ff9d59995854f0f6ce143476967948d3d38ef8f8c6bf9dfc0fec33b7/EagleWrapper-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73826c5b99ae0d0b35aa0fdcbaef01bc33283b2adeeece3166f56e6800790f5a",
                "md5": "58a469fdd13265ece9f1b23f40fb1404",
                "sha256": "bb070eda0f2239b5268d8ab4a7b9af450b1c16d595d9bccb3c50e5a63d3fe856"
            },
            "downloads": -1,
            "filename": "EagleWrapper-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "58a469fdd13265ece9f1b23f40fb1404",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 1163356,
            "upload_time": "2023-04-05T21:02:13",
            "upload_time_iso_8601": "2023-04-05T21:02:13.365658Z",
            "url": "https://files.pythonhosted.org/packages/73/82/6c5b99ae0d0b35aa0fdcbaef01bc33283b2adeeece3166f56e6800790f5a/EagleWrapper-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-05 21:02:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "NatLee",
    "github_project": "eagle-wrapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "eaglewrapper"
}
        
Elapsed time: 0.18261s