Asynchronous image probing library. Fetch only as much as you need!
Project description
imageprobe
Asynchronous library to get image dimensions by fetching as little data as possible.
It temporarily supports only GIF, PNG because development is still in a very early stage.
Usage
To install this library, run:
pip install imageprobe
The probe()
function returns metadata of an image from an URL, or throws an exception if an error occurred.
import asyncio
from imageprobe import probe
url = "https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png"
image_data = asyncio.run(probe(url))
print(image_data.width, image_data.height)
# 172 178
Under the hood, probe()
creates an aiohttp.ClientSession
, but you can pass a pre-existing session as an optional argument if you prefer.
Contributing
I won't accept pull requests until the first beta release.
Project details
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
File details
Details for the file imageprobe-0.3.0.tar.gz
.
File metadata
- Download URL: imageprobe-0.3.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d9301819253267b3e6638fa11b384640d4eabfaee7fe3b76ba2d2af249d6b71 |
|
MD5 | 8ecc800fdcfc3b87323af3bf33b43a0e |
|
BLAKE2b-256 | 6bbcf80ac75a93fcf9e230b49546e419c033f8f0d868c5f7ee66e1a01cd3b262 |
File details
Details for the file imageprobe-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: imageprobe-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703c94aec4214d9c70897e940889a35420334bcd02337c773fa52db0a74ae13a |
|
MD5 | 7a4b50595d4f628aed51849f2d1b3b45 |
|
BLAKE2b-256 | 16bc620b1a2adade467fb2913328638ba1b78b9b3b4075feaaec59acfcfad5e9 |