{"id":23881,"library":"imia","title":"imia","description":"Full stack authentication library for ASGI frameworks. Version 0.5.3, requires Python >=3.8.0. Active development with regular minor releases.","status":"active","version":"0.5.3","language":"python","source_language":"en","source_url":"https://github.com/alex-oleshkevich/imia","tags":["authentication","asgi","starlette","fastapi","security"],"install":[{"cmd":"pip install imia","lang":"bash","label":"Default install"},{"cmd":"pip install imia[sqlalchemy]","lang":"bash","label":"With SQLAlchemy support"}],"dependencies":[{"reason":"Optional, for SQLAlchemy user provider","package":"sqlalchemy","optional":true},{"reason":"Optional, required when using SQLAlchemy with aiosqlite","package":"aiosqlite","optional":true}],"imports":[{"wrong":"from imia import AuthenticationMiddleware","symbol":"AuthenticationMiddleware","correct":"from imia import AuthenticationMiddleware"}],"quickstart":{"code":"from imia import AuthenticationMiddleware, LoginManager\nfrom imia.providers import InMemoryUserProvider\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse\nfrom starlette.routing import Route\nimport os\n\n# Define a user provider (must implement find_by_id with connection arg)\nclass MyUserProvider(InMemoryUserProvider):\n    async def find_by_id(self, connection, user_id):\n        # InMemoryUserProvider already does this, but override for custom logic\n        return await super().find_by_id(connection, user_id)\n\nprovider = MyUserProvider({\n    '1': {'id': '1', 'name': 'Alice'},\n    '2': {'id': '2', 'name': 'Bob'},\n})\n\nlogin_manager = LoginManager(provider)\n\nasync def homepage(request):\n    user = request['user']\n    return JSONResponse({'user': user['name'] if user else None})\n\napp = Starlette(routes=[Route('/', homepage)])\napp.add_middleware(AuthenticationMiddleware, login_manager=login_manager)","lang":"python","description":"Minimal ASGI app with imia authentication middleware using in-memory user storage."},"warnings":[{"fix":"Update all UserProvider method signatures to include connection: HTTPConnection as first parameter.","message":"In v0.5.1, UserProvider methods (e.g., find_by_id, find_by_login) now require an HTTPConnection instance as the first argument. Old custom providers will fail with TypeError.","severity":"breaking","affected_versions":">=0.5.1"},{"fix":"Install with pip install imia[sqlalchemy] if using SQLAlchemy support.","message":"In v0.5.3, sqlalchemy and aiosqlite are no longer core dependencies; they are optional extras. Installing imia without extras will not include these libraries.","severity":"deprecated","affected_versions":">=0.5.3"},{"fix":"Use 'from imia.authentication import authenticate'.","message":"The authenticate function (added in v0.5.1) is in imia.authentication module, not at package root. Importing from imia.authenticate will fail.","severity":"gotcha","affected_versions":">=0.5.1"}],"env_vars":null,"search_vec":"'0.5.3':10 '3.8.0':13 'activ':14 'asgi':7,21 'authent':4,20 'develop':15 'fastapi':23 'framework':8 'full':2 'imia':1 'librari':5 'minor':18 'python':12 'regular':17 'releas':19 'requir':11 'secur':24 'stack':3 'starlett':22 'version':9","created_at":"2026-05-01T08:10:07.114476+00:00","updated_at":"2026-05-01T08:10:07.114476+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp5rui1b_o/venv/lib/python3.12/site-packages/imia/__init__.py\", line 1, in <module>\n    from .authentication import *  # noqa\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/tmp/tmp5rui1b_o/venv/lib/python3.12/site-pa"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.5.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/alex-oleshkevich/imia","docs":"https://github.com/alex-oleshkevich/imia","changelog":null,"pypi":"https://pypi.org/project/imia/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}