Topic: dl621: A Python module and CLI utility to download e621 images with embedded XMP tags and description

Posted under e621 Tools and Applications

Hey all, long-time user, first-time poster.

I've been working on adding embedded XMP metadata to my entire collection of almost 2000 saved images, about half are from e621.

To this end, I have written and published a few python modules that help with this! First I wrote imgtag to give a simple interface to manage XMP tags and metadata. I am now working on dl621, which uses the e621 API to download a full-resolution image with rich embedded XMP tags and metadata, using a single post ID. The CLI tool only allows downloading a single image, but you can import it into a python script to get access to tools that allow you to make more complex requests to the /posts.json API, which enables you to use this in batch downloader applications without abusing the API.

Supported metadata tags that gets embedded via XMP:

  • All tags in all tag groups

* General tags are just copied exactly
* Other groups have the group name before a colon prepended, e.x. artist: tyroo or meta: english_text

  • Parents and children get stored as tags: parent: ID, child: ID
  • The post's website is stored in the site: e621.net tag (never changes)
  • The post's ID is stored in the id: ID tag
  • The post's MD5 sum is stored in the md5: MD5_TEXT tag
  • The post's rating (s, q, e) is stored in the rating: RATING tag
  • The pools that the post are in are stored in the pool: POOL_ID tags
  • The source URLs are stored in the source: URL tags
  • The post's description is stored in the XMP file's Description field
  • The post's original e621 URL is stored in the XMP file's Title field

Here is the GitHub: https://github.com/nimaid/python-dl621
And the PyPI: https://pypi.org/project/dl621/

See the README.rst files there for more info! Let me know what you think!

  • 1