PyJWT
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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PyJWT-0.1.4.tar.gz | 4.5 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PyJWT-0.1.4-py2.7.egg | Legacy Egg format | - | - | Details |
| PyJWT-0.1.4-py2.6.egg | Legacy Egg format | - | - | Details |
| PyJWT-0.1.4-py2.5.egg | Legacy Egg format | - | - | Details |
Total release size: 28.5 kB
Release files / PyJWT-0.1.4.tar.gz
| Download URL | PyJWT-0.1.4.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d861c07a27aba8449b55fd219629e4bef0c89c95df346f2b446460bd9dc1fbd
|
|
BLAKE2b-256 checksum How to use checksums |
339153303e612e0d98d0485c27eb941d3db87b65dae0dcc0ffbd85c56ba3718a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.4-py2.7.egg
| Download URL | PyJWT-0.1.4-py2.7.egg |
|---|---|
| Size | 8.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
41134fba741dc358ea65e25c67203bfa7b426489a70364b649b843fcea4d7f04
|
|
BLAKE2b-256 checksum How to use checksums |
3c147b09ff51a36b23c5fbc8ac9ff5e5d76b641d3b397c22f661d9d471eb5f03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.4-py2.6.egg
| Download URL | PyJWT-0.1.4-py2.6.egg |
|---|---|
| Size | 8.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
f5577d5a0909b836bb98ac430dc8033185830415a13dfe2366359e9021aa1493
|
|
BLAKE2b-256 checksum How to use checksums |
82b4cfcd677ab6f027816e5b8ac195e039d9f04fe087d6c98a8bb537bbc5efd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.4-py2.5.egg
| Download URL | PyJWT-0.1.4-py2.5.egg |
|---|---|
| Size | 8.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
439d22e2ac717777925aa7b217383c1b8e09003358b21c940168cffe263747de
|
|
BLAKE2b-256 checksum How to use checksums |
875ad8b3a0cb334a873471b65e6dde320c01aabdcbf717352a05403d4f4bee66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |