Metadata-Version: 2.1
Name: FastIIIFimageAPI
Version: 0.0.1
Summary: iiif ImageAPI for FastAPI
Home-page: https://github.com/WilhelmWeber/IIIFimageAPIforFastAPI
Download-URL: https://github.com/WilhelmWeber/IIIFimageAPIforFastAPI
Author: Yuto_Takizawa
Author-email: mokoda5243@gmail.com
License: MIT
Keywords: iiif fastapi
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pillow >=10.2.0
Requires-Dist: fastapi >=0.104.1

## 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
