Skip to content

[NEW] imgproxykit — typed imgproxy URLs with FastAPI integration - #377

Open
kondratevdev wants to merge 1 commit into
mjhea0:mainfrom
kondratevdev:main
Open

kondratevdev wants to merge 1 commit into
mjhea0:mainfrom
kondratevdev:main

Conversation

@kondratevdev

@kondratevdev kondratevdev commented Nov 16, 2026 •

Copy link
Copy Markdown

Project Information

  1. Project Name: Imgrpoxykit

  2. Project URL: https://github.com/wemake-services/imgproxykit

  3. Description:

    A typed Python toolkit for building imgproxy URLs with a dedicated FastAPI integration.

    • Typed, reusable image transformations.
    • Named image variants declared as mappings or dataclasses.
    • Signed URLs using imgproxy keys and salts.
    • FastAPI dependency injection.

Criteria

  1. Is the project new?

    • Yes
    • No
  2. How long has the project been maintained?

    Since October 2026, approximately one month. I recognize that this is below the suggested one-year maintenance history and that the project has fewer than 100 stars. I am submitting it for consideration as an early exception based on its concrete FastAPI integration and documented use case.

  3. How many releases has it had if it's a library or package?

    https://github.com/wemake-services/imgproxykit/releases

  4. Are you the author, or are you submitting the project on behalf of a company?

    • I am the author
    • I am submitting on behalf of a company
    • Other (please specify)
  5. What makes it awesome?

    imgproxykit lets FastAPI applications declare image variants as typed dataclass fields, inject a configured client with Depends, and return generated URLs through Pydantic response models:

    ...
    from imgproxykit import Client, Transform
    from imgproxykit.integrations.fastapi import add_imgproxy
    
    app = FastAPI()
    get_imgproxy = add_imgproxy(app, Client('https://imgproxy.server.com'))
    
    
    @dataclass(frozen=True, slots=True)
    class ImageVariants:
        thumbnail: Annotated[str, Transform(width=160, format='webp')]
        large: Annotated[str, Transform(width=1280, quality=85)]
    
    
    class ResponseBody(BaseModel):
        variants: ImageVariants
    
    
    @app.get('/image/')
    async def get_image(imgproxy: Annotated[Client, Depends(get_imgproxy)]) -> ResponseBody:
        source_img = 'https://media.example.com/image.jpg'
        variants = imgproxy.variants(source_img, variants=ImageVariants)
        return ResponseBody(variants=variants)

    One declaration defines both the transformations and the named response fields exposed in the OpenAPI schema. The same variant declaration can be reused across endpoints, and URL signing is configured once on the client.

    The FastAPI integration includes documentation, runnable examples, and unit and integration tests.


AI Disclosure

We love transparent contributions. Using AI is perfectly fine, just let us know.

  • Yes, this pull request was generated or assisted by AI.
  • No, this pull request was authored entirely by a human.

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant