Skip to main content

JSON Web Token implementation in Python

Project description

https://github.com/jpadilla/pyjwt/workflows/CI/badge.svg https://img.shields.io/pypi/v/pyjwt.svg https://codecov.io/gh/jpadilla/pyjwt/branch/master/graph/badge.svg https://readthedocs.org/projects/pyjwt/badge/?version=stable

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

Installing

Install with pip:

$ pip install PyJWT

Usage

>>> import jwt
>>> encoded = jwt.encode({"some": "payload"}, "secret", algorithm="HS256")
>>> print(encoded)
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
>>> 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyjwt-2.12.1.tar.gz (102.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyjwt-2.12.1-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file pyjwt-2.12.1.tar.gz.

File metadata

  • Download URL: pyjwt-2.12.1.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyjwt-2.12.1.tar.gz
Algorithm Hash digest
SHA256 c74a7a2adf861c04d002db713dd85f84beb242228e671280bf709d765b03672b
MD5 12623a5898f60c4c86ad4ad8d92da216
BLAKE2b-256 c227a3b6e5bf6ff856d2509292e95c8f57f0df7017cf5394921fc4e4ef40308a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjwt-2.12.1.tar.gz:

Publisher: pypi-package.yml on jpadilla/pyjwt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyjwt-2.12.1-py3-none-any.whl.

File metadata

  • Download URL: pyjwt-2.12.1-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyjwt-2.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28ca37c070cad8ba8cd9790cd940535d40274d22f80ab87f3ac6a713e6e8454c
MD5 57ad6a13037c27e4b58d97747c3fea97
BLAKE2b-256 e57a8dd906bd22e79e47397a61742927f6747fe93242ef86645ee9092e610244

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjwt-2.12.1-py3-none-any.whl:

Publisher: pypi-package.yml on jpadilla/pyjwt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page