About Anaconda Help Download Anaconda

JSON Web Token library for Python 3.

Installers

  • linux-64 v0.5.2
  • osx-64 v0.5.2

conda install

To install this package run one of the following:
conda install carta::jwt

Description

.. image:: https://travis-ci.org/GehirnInc/python-jwt.svg?branch=master :target: https://travis-ci.org/GehirnInc/python-jwt .. image:: https://coveralls.io/repos/GehirnInc/python-jwt/badge.png?branch=master :target: https://coveralls.io/r/GehirnInc/python-jwt?branch=master .. image:: https://badge.fury.io/py/jwt.svg?dummy :target: http://badge.fury.io/py/jwt

python-jwt

python-jwt is a JSON Web Token (JWT) implementation in Python developed by Gehirn Inc_.

Examples

.. code-block:: python

import json

from jwt import ( JWT, jwkfromdict, jwkfrompem, )

message = { 'iss': 'https://example.com/', 'sub': 'yosida95', 'iat': 1485969205, 'exp': 1485972805, }

with open('rsaprivatekey.pem', 'rb') as fh: signingkey = jwkfrom_pem(fh.read())

jwt = JWT() compactjws = jwt.encode(message, signingkey, 'RS256')

with open('rsapublickey.json', 'r') as fh: verifyingkey = jwkfrom_dict(json.load(fh))

messagereceived = jwt.decode(compactjws, verifying_key)

assert message == message_received

Installation

You can install python-jwt with pip.

.. code-block:: shell

$ pip install jwt

Implementation Details

Supported Algorithms ~~~~~~~~~~~~~~~~~~~~

  • Unsecured

    • none
  • Symmetric

    • HS256

    • HS384

    • HS512

  • Asymmetric

    • RS256

    • RS384

    • RS512

Supported Python Versions ~~~~~~~~~~~~~~~~~~~~~~~~~

  • Python 3.4

  • Python 3.5

  • Python 3.6

License

python-jwt is licensed under the Apache License version 2. See ./LICENSE.rst.

.. _Gehirn Inc: http://www.gehirn.co.jp/


© 2025 Anaconda, Inc. All Rights Reserved. (v4.0.7) Legal | Privacy Policy