Skip to main content

A Python implementation of [JSON Web Token draft 01](http://self-issued.info/docs/draft-jones-json-web-token-01.html).

Installing

sudo easy_install PyJWT

Usage

import jwt jwt.encode({“some”: “payload”}, “secret”)

Note the resulting JWT will not be encrypted, but verifiable with a secret key.

jwt.decode(“someJWTstring”, “secret”)

If the secret is wrong, it will raise a jwt.DecodeError telling you as such. You can still get at the payload by setting the verify argument to false.

jwt.decode(“someJWTstring”, verify=False)

Algorithms

The JWT spec supports several algorithms for cryptographic signing. This library currently supports:

  • HS256 - HMAC using SHA-256 hash algorithm (default)

  • HS384 - HMAC using SHA-384 hash algorithm

  • HS512 - HMAC using SHA-512 hash algorithm

Change the algorithm with by setting it in encode:

jwt.encode({“some”: “payload”}, “secret”, “HS512”)

Tests

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

python tests/test_jwt.py

License

MIT

Metadata

Release files for PyJWT 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyJWT 0.1.3
File Size Uploaded Provenance Actions
PyJWT-0.1.3.tar.gz 3.2 kB Without provenance Details for PyJWT-0.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for PyJWT 0.1.3
File Interpreter ABI Platform Actions
PyJWT-0.1.3-py2.7.egg Legacy Egg format - - Details for PyJWT-0.1.3-py2.7.egg
PyJWT-0.1.3-py2.6.egg Legacy Egg format - - Details for PyJWT-0.1.3-py2.6.egg
PyJWT-0.1.3-py2.5.egg Legacy Egg format - - Details for PyJWT-0.1.3-py2.5.egg

Total release size: 22.5 kB

Release files / PyJWT-0.1.3.tar.gz

Download URL PyJWT-0.1.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
28b03b546803383fc26509273f357ef2986011f6c03975574d7f67004028f343
BLAKE2b-256 checksum
How to use checksums
19812e665ff384dff79c5530dfa862d8c76bb747db2bebb1e585da2ab79487cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyJWT-0.1.3-py2.7.egg

Download URL PyJWT-0.1.3-py2.7.egg
Size 6.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
96b88a4b07be0eccb4bd4945c06802c4dc3be605f374a792eaaf7d40b61afc72
BLAKE2b-256 checksum
How to use checksums
9a0587c4847ed23c9b45ab526c07d2b3a80424fe8b5705bc4b3b57eb6cef450f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyJWT-0.1.3-py2.6.egg

Download URL PyJWT-0.1.3-py2.6.egg
Size 6.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
f18f442a524b68cbcf40d944826ae7ed7d9a764e1d781f979f278e94e38c0d37
BLAKE2b-256 checksum
How to use checksums
98b39b01ec4a9a9fe97266ef8959d0c8dfb149bda0061390fa8990a5bf56eb54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyJWT-0.1.3-py2.5.egg

Download URL PyJWT-0.1.3-py2.5.egg
Size 6.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
f07afb3e39340030bb22ab407aec1ba080b7c9b46b12a0e1ddaf42be4bcadfbf
BLAKE2b-256 checksum
How to use checksums
92f86c4db50db1c828a4fb00527628f776892042e08d08ee3d7c6221795a4ca3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for PyJWT 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

4 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page