{"id":15297474,"url":"https://github.com/gehirninc/python-jwt","last_synced_at":"2025-04-13T02:16:41.230Z","repository":{"id":15926553,"uuid":"18668411","full_name":"GehirnInc/python-jwt","owner":"GehirnInc","description":"JSON Web Token library for Python","archived":false,"fork":false,"pushed_at":"2023-07-13T06:21:16.000Z","size":128,"stargazers_count":151,"open_issues_count":7,"forks_count":30,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-13T02:16:34.592Z","etag":null,"topics":["jose","jwa","jwk","jws","jwt","python","python-3"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/jwt","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GehirnInc.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-04-11T09:00:53.000Z","updated_at":"2025-04-08T19:48:18.000Z","dependencies_parsed_at":"2024-01-13T19:18:05.008Z","dependency_job_id":"d45737f6-a28f-49b3-a8e7-1e95df97f168","html_url":"https://github.com/GehirnInc/python-jwt","commit_stats":{"total_commits":128,"total_committers":13,"mean_commits":9.846153846153847,"dds":0.25,"last_synced_commit":"068db420c9ae957925daf0f5a2baa9319ac20c82"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GehirnInc%2Fpython-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GehirnInc%2Fpython-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GehirnInc%2Fpython-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GehirnInc%2Fpython-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GehirnInc","download_url":"https://codeload.github.com/GehirnInc/python-jwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654104,"owners_count":21140237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jose","jwa","jwk","jws","jwt","python","python-3"],"created_at":"2024-09-30T19:17:46.633Z","updated_at":"2025-04-13T02:16:41.199Z","avatar_url":"https://github.com/GehirnInc.png","language":"Python","readme":".. image:: https://travis-ci.org/GehirnInc/python-jwt.svg?branch=master\n    :target: https://travis-ci.org/GehirnInc/python-jwt\n.. image:: https://coveralls.io/repos/GehirnInc/python-jwt/badge.png?branch=master\n    :target:  https://coveralls.io/r/GehirnInc/python-jwt?branch=master\n.. image:: https://badge.fury.io/py/jwt.svg?dummy\n    :target: http://badge.fury.io/py/jwt\n\npython-jwt\n==========\n\n*python-jwt* is a JSON Web Token (JWT) implementation in Python developed by `Gehirn Inc`_.\n\n\nExamples\n--------\n\n.. code-block:: python\n\n   import json\n   from datetime import datetime, timedelta, timezone\n\n   from jwt import (\n       JWT,\n       jwk_from_dict,\n       jwk_from_pem,\n   )\n   from jwt.utils import get_int_from_datetime\n\n\n   instance = JWT()\n\n   message = {\n       'iss': 'https://example.com/',\n       'sub': 'yosida95',\n       'iat': get_int_from_datetime(datetime.now(timezone.utc)),\n       'exp': get_int_from_datetime(\n           datetime.now(timezone.utc) + timedelta(hours=1)),\n   }\n\n   \"\"\"\n   Encode the message to JWT(JWS).\n   \"\"\"\n\n   # Load a RSA key from a JWK dict.\n   signing_key = jwk_from_dict({\n       'kty': 'RSA',\n       'e': 'AQAB',\n       'n': '...',\n       'd': '...'})\n   # Or load a RSA key from a PEM file.\n   with open('rsa_private_key.pem', 'rb') as fh:\n       signing_key = jwk_from_pem(fh.read())\n   # You can also load an octet key in the same manner as the RSA.\n   # signing_key = jwk_from_dict({'kty': 'oct', 'k': '...'})\n\n   compact_jws = instance.encode(message, signing_key, alg='RS256')\n\n   \"\"\"\n   Decode the JWT with verifying the signature.\n   \"\"\"\n\n   # Load a public key from PEM file corresponding to the signing private key.\n   with open('rsa_public_key.json', 'r') as fh:\n       verifying_key = jwk_from_dict(json.load(fh))\n\n   message_received = instance.decode(\n       compact_jws, verifying_key, do_time_check=True)\n\n   \"\"\"\n   Successfuly retrieved the `message` from the `compact_jws`\n   \"\"\"\n   assert message == message_received\n\n\nInstallation\n------------\n\nYou can install python-jwt with pip.\n\n.. code-block:: shell\n\n   $ pip install jwt\n\n\nImplementation Details\n-------------------------\n\nSupported Algorithms\n~~~~~~~~~~~~~~~~~~~~\n\n- Unsecured\n\n  - none (disabled by default for security)\n\n- Symmetric\n\n  - HS256\n  - HS384\n  - HS512\n\n- Asymmetric\n\n  - PS256\n  - PS384\n  - PS512\n  - RS256\n  - RS384\n  - RS512\n\nSupported Python Versions\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Python 3.6+\n\n\nLicense\n-------\npython-jwt is licensed under the Apache License version 2.  See ./LICENSE.rst.\n\n\n.. _Gehirn Inc: http://www.gehirn.co.jp/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgehirninc%2Fpython-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgehirninc%2Fpython-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgehirninc%2Fpython-jwt/lists"}