Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
1Metadata-Version: 2.12Name: itsdangerous3Version: 2.2.04Summary: Safely pass data to untrusted environments and back.5Maintainer-email: Pallets <contact@palletsprojects.com>6Requires-Python: >=3.87Description-Content-Type: text/markdown8Classifier: Development Status :: 5 - Production/Stable9Classifier: Intended Audience :: Developers10Classifier: License :: OSI Approved :: BSD License11Classifier: Operating System :: OS Independent12Classifier: Programming Language :: Python13Classifier: Typing :: Typed14Project-URL: Changes, https://itsdangerous.palletsprojects.com/changes/15Project-URL: Chat, https://discord.gg/pallets16Project-URL: Documentation, https://itsdangerous.palletsprojects.com/17Project-URL: Donate, https://palletsprojects.com/donate18Project-URL: Source, https://github.com/pallets/itsdangerous/19 20# ItsDangerous21 22... so better sign this23 24Various helpers to pass data to untrusted environments and to get it25back safe and sound. Data is cryptographically signed to ensure that a26token has not been tampered with.27 28It's possible to customize how data is serialized. Data is compressed as29needed. A timestamp can be added and verified automatically while30loading a token.31 32 33## A Simple Example34 35Here's how you could generate a token for transmitting a user's id and36name between web requests.37 38```python39from itsdangerous import URLSafeSerializer40auth_s = URLSafeSerializer("secret key", "auth")41token = auth_s.dumps({"id": 5, "name": "itsdangerous"})42 43print(token)44# eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg45 46data = auth_s.loads(token)47print(data["name"])48# itsdangerous49```50 51 52## Donate53 54The Pallets organization develops and supports ItsDangerous and other55popular packages. In order to grow the community of contributors and56users, and allow the maintainers to devote more time to the projects,57[please donate today][].58 59[please donate today]: https://palletsprojects.com/donate60 61 
codekingpro/portable-devtools · Team Ai