Skip to main content

iiif ImageAPI for FastAPI

Project description

IIIF imageAPI for FastAPI

繝サInstall

pip install FastIIIFimageAPI

繝サInstantiation

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

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

@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

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

FastIIIFimageAPI-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FastIIIFimageAPI-0.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file FastIIIFimageAPI-0.0.1.tar.gz.

File metadata

  • Download URL: FastIIIFimageAPI-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for FastIIIFimageAPI-0.0.1.tar.gz
Algorithm Hash digest
SHA256 62a22084a74c4a81d8a6161ebdb28c63409dd841b3167b8bbdab7d464e8dbcb1
MD5 5f483bcd1eb9a579f7f66d9174d447d5
BLAKE2b-256 7dd9ad5f9235d4d5ccf612fd36872cf8a0300a4c3de78f45f37171c8060ada45

See more details on using hashes here.

File details

Details for the file FastIIIFimageAPI-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for FastIIIFimageAPI-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da967e3804e7c77cfc53d6941609dd7b34ba72d1f2c0bafd812029b61595cf58
MD5 585696ec74f4db9e9ec9e8ba7498eec5
BLAKE2b-256 3d4c68a509c598404af51336f0f01c089fcc1be98a82db6c5ebc01569c59fa5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page