Skip to content
master
Switch branches/tags
Code

Latest commit

updates:
- [github.com/psf/black: 21.10b0 → 21.11b1](psf/black@21.10b0...21.11b1)
- [github.com/asottile/blacken-docs: v1.11.0 → v1.12.0](asottile/blacken-docs@v1.11.0...v1.12.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
f3b95a0

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
jwt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PyJWT

https://readthedocs.org/projects/pyjwt/badge/?version=stable

A Python implementation of RFC 7519. Original implementation was written by @progrium.

Sponsor

auth0-logo If you want to quickly add secure token-based authentication to Python projects, feel free to check Auth0's Python SDK and free plan at auth0.com/developers.

Installing

Install with pip:

$ pip install PyJWT

Usage

>>> import jwt
>>> encoded = jwt.encode({"some": "payload"}, "secret", algorithm="HS256")
>>> print(encoded)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzb21lIjoicGF5bG9hZCJ9.Joh1R2dYzkRvDkqv3sygm5YyK8Gi4ShZqbhK2gxcs2U
>>> jwt.decode(encoded, "secret", algorithms=["HS256"])
{'some': 'payload'}

Documentation

View the full docs online at https://pyjwt.readthedocs.io/en/stable/

Tests

You can run tests from the project root after cloning with:

$ tox