pallets/itsdangerous ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python library that lets me safely turn trusted data into a token I can send to untrusted places, then later read it back and know it has not been changed.

I want it to support signing data with a secret key, loading the data back, and raising a clear error if the token was tampered with or the secret is wrong. It should work nicely for simple things like user ids and names, and it should let me choose how the data is serialized. If the payload gets large, compress it automatically when that helps. I also want an option to add a timestamp so tokens can expire after a while and be checked when they are loaded.

Please make it feel clean and easy to use, with a simple example in the README and good tests for the main cases, like valid tokens, invalid tokens, expired tokens, and custom serialization. If you need to look up current Python packaging or docs patterns, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab