Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

… so better sign this

Various helpers to pass data to untrusted environments and to get it back safe and sound. Data is cryptographically signed to ensure that a token has not been tampered with.

It’s possible to customize how data is serialized. Data is compressed as needed. A timestamp can be added and verified automatically while loading a token.

Installing

Install and update using pip:

pip install -U itsdangerous

A Simple Example

Here’s how you could generate a token for transmitting a user’s id and name between web requests.

from itsdangerous import URLSafeSerializer
auth_s = URLSafeSerializer("secret key", "auth")
token = auth_s.dumps({"id": 5, "name": "itsdangerous"})

print(token)
# eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg

data = auth_s.loads(token)
print(data["name"])
# itsdangerous

Donate

The Pallets organization develops and supports ItsDangerous and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Download files

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

Source Distribution

itsdangerous-2.0.0a1.tar.gz (57.3 kB view details)

Uploaded Source

Built Distribution

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

itsdangerous-2.0.0a1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file itsdangerous-2.0.0a1.tar.gz.

File metadata

  • Download URL: itsdangerous-2.0.0a1.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3

File hashes

Hashes for itsdangerous-2.0.0a1.tar.gz
Algorithm Hash digest
SHA256 1f08ac48fe58cb99a1f58add0c90924b4267398bbd1640268d26a29f6a03eaa4
MD5 4dff6d260bff16c14d6ea896824ff234
BLAKE2b-256 b91d761dff1a3196140089c395e9702bbee8fde56d58be05a69639243d9981fe

See more details on using hashes here.

File details

Details for the file itsdangerous-2.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: itsdangerous-2.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3

File hashes

Hashes for itsdangerous-2.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 26ba8fb99157bbd5a1016f9d9dc5ed5ff1325f6f6f2c10b18107199470676b4d
MD5 7f1460510cd367164b2f1957bc5b0066
BLAKE2b-256 9395e61aeeaeb9b343373bb1d9e160551a33babb30c4a2a12ef0a29be77284b0

See more details on using hashes here.

Supported by

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