{"library":"rauth","title":"Rauth","description":"Rauth is a Python library that provides consumer support for OAuth 1.0/a, OAuth 2.0, and Ofly, built on top of the popular Requests library. Its last release, version 0.7.3, was in January 2017, indicating it is no longer actively maintained.","language":"python","status":"abandoned","last_verified":"Sat May 16","install":{"commands":["pip install rauth"],"cli":null},"imports":["from rauth import OAuth1Service","from rauth import OAuth2Service","from rauth import OflyService"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport webbrowser\nfrom rauth import OAuth2Service\n\n# --- Configuration (Replace with your actual app details and environment variables) ---\nCLIENT_ID = os.environ.get('RAUTH_CLIENT_ID', 'your_client_id')\nCLIENT_SECRET = os.environ.get('RAUTH_CLIENT_SECRET', 'your_client_secret')\nREDIRECT_URI = 'http://localhost:8000/callback'\n\n# Example for a hypothetical OAuth 2.0 provider\nservice = OAuth2Service(\n    client_id=CLIENT_ID,\n    client_secret=CLIENT_SECRET,\n    name='example_provider',\n    authorize_url='https://example.com/oauth/authorize',\n    access_token_url='https://example.com/oauth/token',\n    base_url='https://example.com/api/'\n)\n\nprint('--- Starting OAuth 2.0 Flow ---')\n\n# Step 1: Get the authorization URL and redirect the user\nparams = {\n    'redirect_uri': REDIRECT_URI,\n    'response_type': 'code',\n    'scope': 'read_profile'\n}\nauthorize_url = service.get_authorize_url(**params)\n\nprint(f\"Please visit this URL in your browser:\\n{authorize_url}\")\nwebbrowser.open(authorize_url)\n\n# In a real web application, this 'code' would come from the redirect_uri callback\n# For this example, we simulate getting the code from user input after manual authorization.\nauthorization_code = input('Enter the authorization code from the redirect URL: ')\n\n# Step 2: Exchange the authorization code for an access token\ndata = {\n    'code': authorization_code,\n    'grant_type': 'authorization_code',\n    'redirect_uri': REDIRECT_URI\n}\nsession = service.get_auth_session(data=data, decoder=lambda x: x.json())\n\n# Step 3: Make an authenticated request\ntry:\n    response = session.get('user/profile') # Example API endpoint\n    response.raise_for_status() # Raise an exception for HTTP errors\n    user_profile = response.json()\n    print(f\"Successfully fetched user profile: {user_profile}\")\nexcept Exception as e:\n    print(f\"Error during API request: {e}\")\n    if hasattr(e, 'response') and e.response is not None:\n        print(f\"Response content: {e.response.text}\")\n\nprint('--- OAuth 2.0 Flow Complete ---')","lang":"python","description":"This quickstart demonstrates a basic OAuth 2.0 authorization code flow using Rauth. It simulates a web application by prompting the user to manually visit an authorization URL and then input the received authorization code to obtain an access token and make an authenticated API call. Remember to replace placeholder URLs and credentials with actual values for your OAuth provider.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.7.3","pypi_latest":"0.7.3","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.9,"avg_import_s":0.68,"wheel_type":"sdist"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.63,"mem_mb":9.9,"disk_size":"22.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.46,"mem_mb":9.9,"disk_size":"23M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.8,"mem_mb":10.9,"disk_size":"25.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.7,"mem_mb":10.9,"disk_size":"26M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.76,"mem_mb":11.4,"disk_size":"15.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":3.4,"import_time_s":0.76,"mem_mb":11.4,"disk_size":"16M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.75,"mem_mb":11.8,"disk_size":"14.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":3.1,"import_time_s":0.73,"mem_mb":11.8,"disk_size":"15M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.64,"mem_mb":9.5,"disk_size":"22.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"rauth","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":2.9,"import_time_s":0.6,"mem_mb":9.5,"disk_size":"23M"}]}}