Safely pass data to untrusted environments and back.
Project Links
Meta
Maintainer: Pallets
Requires Python: >=3.8
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: BSD License
Operating System
- OS Independent
Programming Language
- Python
Typing
- Typed
ItsDangerous
... 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.
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.
2.2.0
Apr 16, 2024
2.1.2
Mar 24, 2022
2.1.1
Mar 09, 2022
2.1.0
Feb 18, 2022
2.0.1
May 18, 2021
2.0.0
May 11, 2021
2.0.0rc2
Apr 16, 2021
2.0.0rc1
Feb 15, 2021
2.0.0a1
May 28, 2020
1.1.0
Oct 27, 2018
0.24
Mar 28, 2014
0.23
Aug 08, 2013
0.22
Jul 03, 2013
0.21
May 26, 2013
0.20
May 23, 2013
0.19
May 22, 2013
0.18
May 15, 2013
0.17
Aug 11, 2012
0.16
Jul 11, 2012
0.15
Jul 11, 2012
0.14
Jun 29, 2012
0.13
Jun 10, 2012
0.12
Feb 22, 2012
0.11
Jul 07, 2011
0.10
Jun 29, 2011
0.9.1
Jun 26, 2011
0.9
Jun 24, 2011
Wheel compatibility matrix
Files in release
No dependencies