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.2
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.2.tar.gz | 3.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PyJWT-0.1.2-py2.7.egg | Legacy Egg format | - | - | Details |
| PyJWT-0.1.2-py2.6.egg | Legacy Egg format | - | - | Details |
| PyJWT-0.1.2-py2.5.egg | Legacy Egg format | - | - | Details |
Total release size: 22.1 kB
Release files / PyJWT-0.1.2.tar.gz
| Download URL | PyJWT-0.1.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bf95198d08f91adf59185f3f37228c974394d7bbd1dbbba620a17428d75387d
|
|
BLAKE2b-256 checksum How to use checksums |
ee7ad693d3c40385d30a595a011151085abbfccaf38cbefa6f86143273d27fb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.2-py2.7.egg
| Download URL | PyJWT-0.1.2-py2.7.egg |
|---|---|
| Size | 6.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
2f8735e5ef24b4ebe20666b7eff302b0736f257e91b267c3ab0a02c7da5899e8
|
|
BLAKE2b-256 checksum How to use checksums |
cb15513a1b21515741cd6dd5893f54249588c2bb60a8f58891b090a1a511f75a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.2-py2.6.egg
| Download URL | PyJWT-0.1.2-py2.6.egg |
|---|---|
| Size | 6.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
8aaa1bc305fa00e7d6e977ce3171f94dcf87c958734adfd30690d4d0cadaf44e
|
|
BLAKE2b-256 checksum How to use checksums |
3e2960e88a96eb0c2d73ee4e8901b5b9c8c27cf30c0077acd6f077aa6511d9a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyJWT-0.1.2-py2.5.egg
| Download URL | PyJWT-0.1.2-py2.5.egg |
|---|---|
| Size | 6.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
6d9bfc8f2226c42e44da0513a9164c536ae652210d005cd308891f900a5d272c
|
|
BLAKE2b-256 checksum How to use checksums |
d7e31c7bea3963f34d282c7a2bd1b8b0b11393f8bbd5e80a55501dc7f639433d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |