## IIIF imageAPI for FastAPI
繝サInstall
```python
pip install FastIIIFimageAPI
```
繝サInstantiation
```python
from iafa import imageapi
processor = imageapi.imageAPI(
version=2,
pathPrefix='https://example.com/api/v1/image',
opt = {
"maxwidth"=10000
"maxheight"=10000
}
)
```
version(int): The version of imageAPI (2 or 3)
pathPrefix(str): The prefix of your API's URI
opt(Option?):
maxwidth(int): Maximum image width your API can provide
maxheight(int): Maximum image height your API can provide
繝サImage Requests
```python
from fastapi import FastAPI
app = FastAPI()
@app.get('/api/v1/image/{imageIdentifier}/{req_path:path}')
async def returnImage(imageIdentifier: str, req_path: str):
imagePath = IDtoPath(imageIdentifier) #arbitary function to find imagepath by imageIdentifier
return processor.returnImage(imagePath, req_path)
```
繝サInfomation Requests
```python
@app.get('/api/v1/image/{imageIdentifier}/info.json')
async def returnInfo(imageIdentifier: str):
imagePath = IDtoPath(imageIdentifier) #arbitary function to find imagepath by imageIdentifier
return processor.returnInfo(imagePath, imageIdentifier)
```
Warning:
Always define Information Requests **before** Image Requests
Raw data
{
"_id": null,
"home_page": "https://github.com/WilhelmWeber/IIIFimageAPIforFastAPI",
"name": "FastIIIFimageAPI",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "iiif fastapi",
"author": "Yuto_Takizawa",
"author_email": "mokoda5243@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7d/d9/ad5f9235d4d5ccf612fd36872cf8a0300a4c3de78f45f37171c8060ada45/FastIIIFimageAPI-0.0.1.tar.gz",
"platform": null,
"description": "## IIIF imageAPI for FastAPI\r\n\u7e5d\uff7bInstall\r\n```python\r\npip install FastIIIFimageAPI\r\n```\r\n\u7e5d\uff7bInstantiation\r\n```python\r\nfrom iafa import imageapi\r\nprocessor = imageapi.imageAPI(\r\n version=2,\r\n pathPrefix='https://example.com/api/v1/image',\r\n opt = {\r\n \"maxwidth\"=10000\r\n \"maxheight\"=10000\r\n }\r\n)\r\n```\r\nversion(int): The version of imageAPI (2 or 3)\r\npathPrefix(str): The prefix of your API's URI\r\nopt(Option?): \r\n maxwidth(int): Maximum image width your API can provide\r\n maxheight(int): Maximum image height your API can provide\r\n \r\n\u7e5d\uff7bImage Requests\r\n```python\r\nfrom fastapi import FastAPI\r\n\r\napp = FastAPI()\r\n\r\n@app.get('/api/v1/image/{imageIdentifier}/{req_path:path}')\r\nasync def returnImage(imageIdentifier: str, req_path: str):\r\n imagePath = IDtoPath(imageIdentifier) #arbitary function to find imagepath by imageIdentifier\r\n return processor.returnImage(imagePath, req_path)\r\n```\r\n\u7e5d\uff7bInfomation Requests\r\n```python\r\n@app.get('/api/v1/image/{imageIdentifier}/info.json')\r\nasync def returnInfo(imageIdentifier: str):\r\n imagePath = IDtoPath(imageIdentifier) #arbitary function to find imagepath by imageIdentifier\r\n return processor.returnInfo(imagePath, imageIdentifier)\r\n```\r\nWarning:\r\nAlways define Information Requests **before** Image Requests\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "iiif ImageAPI for FastAPI",
"version": "0.0.1",
"project_urls": {
"Download": "https://github.com/WilhelmWeber/IIIFimageAPIforFastAPI",
"Homepage": "https://github.com/WilhelmWeber/IIIFimageAPIforFastAPI"
},
"split_keywords": [
"iiif",
"fastapi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3d4c68a509c598404af51336f0f01c089fcc1be98a82db6c5ebc01569c59fa5a",
"md5": "585696ec74f4db9e9ec9e8ba7498eec5",
"sha256": "da967e3804e7c77cfc53d6941609dd7b34ba72d1f2c0bafd812029b61595cf58"
},
"downloads": -1,
"filename": "FastIIIFimageAPI-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "585696ec74f4db9e9ec9e8ba7498eec5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5099,
"upload_time": "2024-02-18T08:57:16",
"upload_time_iso_8601": "2024-02-18T08:57:16.185455Z",
"url": "https://files.pythonhosted.org/packages/3d/4c/68a509c598404af51336f0f01c089fcc1be98a82db6c5ebc01569c59fa5a/FastIIIFimageAPI-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7dd9ad5f9235d4d5ccf612fd36872cf8a0300a4c3de78f45f37171c8060ada45",
"md5": "5f483bcd1eb9a579f7f66d9174d447d5",
"sha256": "62a22084a74c4a81d8a6161ebdb28c63409dd841b3167b8bbdab7d464e8dbcb1"
},
"downloads": -1,
"filename": "FastIIIFimageAPI-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "5f483bcd1eb9a579f7f66d9174d447d5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4745,
"upload_time": "2024-02-18T08:57:18",
"upload_time_iso_8601": "2024-02-18T08:57:18.043974Z",
"url": "https://files.pythonhosted.org/packages/7d/d9/ad5f9235d4d5ccf612fd36872cf8a0300a4c3de78f45f37171c8060ada45/FastIIIFimageAPI-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-18 08:57:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "WilhelmWeber",
"github_project": "IIIFimageAPIforFastAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "fastiiifimageapi"
}