{"library":"propelauth-py","title":"PropelAuth Python SDK","description":"PropelAuth is a Python library for managing authentication and authorization in B2B/multi-tenant applications. It provides features like user login, signup, organization management, roles, permissions, and API key authentication. The library simplifies backend authorization with hosted UIs and a developer-friendly SDK. It maintains an active release cadence with frequent updates for new features and improvements. Current version is 4.3.2.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install propelauth-py"],"cli":null},"imports":["from propelauth_py import init_base_auth","from propelauth_py import init_base_async_auth","from propelauth_py.errors import UnauthorizedException","from propelauth_py import User"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom propelauth_py import init_base_auth, UnauthorizedException\n\n# Your PropelAuth Auth URL and API Key from your PropelAuth dashboard\nAUTH_URL = os.environ.get('PROPELAUTH_AUTH_URL', 'YOUR_AUTH_URL')\nAPI_KEY = os.environ.get('PROPELAUTH_API_KEY', 'YOUR_API_KEY')\n\nif not AUTH_URL or AUTH_URL == 'YOUR_AUTH_URL' or not API_KEY or API_KEY == 'YOUR_API_KEY':\n    print(\"Please set PROPELAUTH_AUTH_URL and PROPELAUTH_API_KEY environment variables\")\n    exit(1)\n\ntry:\n    auth = init_base_auth(AUTH_URL, API_KEY)\n    \n    # Simulate an Authorization header from an incoming request\n    # In a real application, this would come from a client request\n    mock_auth_header = \"Bearer a_mock_jwt_token\"\n    \n    # Validate the access token and get user information\n    user = auth.validate_access_token_and_get_user(mock_auth_header)\n    \n    print(f\"Successfully authenticated user: {user.user_id}\")\n    print(f\"User email: {user.email}\")\n    if user.orgs:\n        print(\"User belongs to organizations:\")\n        for org_member_info in user.orgs:\n            print(f\"  - Org ID: {org_member_info.org_id}, Name: {org_member_info.org_name}, Roles: {org_member_info.roles}\")\n            \n    # Example of calling a backend API to create a magic link\n    # Note: This requires appropriate permissions on your API key\n    # magic_link_response = auth.create_magic_link(\"test@example.com\")\n    # print(f\"Magic link URL: {magic_link_link.url}\")\n\nexcept UnauthorizedException:\n    print(\"Authentication failed: Invalid access token or configuration.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the PropelAuth client and validate an access token. It uses environment variables for secure configuration. Upon successful validation, it prints user and organization details. It also includes commented-out code for an example backend API call (e.g., creating a magic link).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"4.4.0","pypi_latest":"4.4.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.6,"avg_import_s":0.95,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.81,"mem_mb":14.9,"disk_size":"41.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.8,"import_time_s":0.56,"mem_mb":14.9,"disk_size":"42M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.13,"mem_mb":17,"disk_size":"44.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.6,"import_time_s":0.97,"mem_mb":17,"disk_size":"45M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.2,"mem_mb":16.9,"disk_size":"36.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.1,"import_time_s":1.14,"mem_mb":16.9,"disk_size":"37M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.14,"mem_mb":17.8,"disk_size":"35.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3,"import_time_s":1.09,"mem_mb":17.8,"disk_size":"36M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.74,"mem_mb":15.1,"disk_size":"41.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"propelauth-py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.5,"import_time_s":0.76,"mem_mb":15.1,"disk_size":"42M"}]}}