Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
docs/ | H | 18-May-2021 | - | 640 | 444 | |
requirements/ | H | 03-May-2022 | - | |||
src/ | H | 18-May-2021 | - | 1,439 | 1,065 | |
tests/test_itsdangerous/ | H | 18-May-2021 | - | 624 | 463 | |
CHANGES.rst | H A D | 18-May-2021 | 6.4 KiB | 234 | 156 | |
LICENSE.rst | H A D | 15-Apr-2020 | 1.4 KiB | 29 | 23 | |
MANIFEST.in | H A D | 24-Feb-2021 | 159 | 9 | 8 | |
PKG-INFO | H A D | 18-May-2021 | 3.4 KiB | 95 | 70 | |
README.rst | H A D | 24-Feb-2021 | 1.8 KiB | 69 | 45 | |
setup.cfg | H A D | 18-May-2021 | 2 KiB | 89 | 78 | |
setup.py | H A D | 15-Apr-2020 | 57 | 4 | 2 | |
tox.ini | H A D | 08-Feb-2021 | 525 | 25 | 20 |
README.rst
1ItsDangerous 2============ 3 4... so better sign this 5 6Various helpers to pass data to untrusted environments and to get it 7back safe and sound. Data is cryptographically signed to ensure that a 8token has not been tampered with. 9 10It's possible to customize how data is serialized. Data is compressed as 11needed. A timestamp can be added and verified automatically while 12loading a token. 13 14 15Installing 16---------- 17 18Install and update using `pip`_: 19 20.. code-block:: text 21 22 pip install -U itsdangerous 23 24.. _pip: https://pip.pypa.io/en/stable/quickstart/ 25 26 27A Simple Example 28---------------- 29 30Here's how you could generate a token for transmitting a user's id and 31name between web requests. 32 33.. code-block:: python 34 35 from itsdangerous import URLSafeSerializer 36 auth_s = URLSafeSerializer("secret key", "auth") 37 token = auth_s.dumps({"id": 5, "name": "itsdangerous"}) 38 39 print(token) 40 # eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg 41 42 data = auth_s.loads(token) 43 print(data["name"]) 44 # itsdangerous 45 46 47Donate 48------ 49 50The Pallets organization develops and supports ItsDangerous and other 51popular packages. In order to grow the community of contributors and 52users, and allow the maintainers to devote more time to the projects, 53`please donate today`_. 54 55.. _please donate today: https://palletsprojects.com/donate 56 57 58Links 59----- 60 61- Documentation: https://itsdangerous.palletsprojects.com/ 62- Changes: https://itsdangerous.palletsprojects.com/changes/ 63- PyPI Releases: https://pypi.org/project/ItsDangerous/ 64- Source Code: https://github.com/pallets/itsdangerous/ 65- Issue Tracker: https://github.com/pallets/itsdnagerous/issues/ 66- Website: https://palletsprojects.com/p/itsdangerous/ 67- Twitter: https://twitter.com/PalletsTeam 68- Chat: https://discord.gg/pallets 69