Cantok

Latest version: v0.0.31

Safety actively analyzes 701442 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 5

0.0.6

Optional minor update.

- Added type hints. Strict mode is enabled for mypy.
- Simplified the sample code in the documentation.
- Added some tests.
- The logo has been slightly changed.

0.0.5

Important update!

- More compact output when using the `repr` function in relation to tokens.
- Added the ability to cast to the `bool` type. The result of `bool(token)` is equivalent to `token.keep_on()`. This allows you to make the code of cycles and conditions using tokens more compact and more beautiful.
- The counter inside the `CounterToken` continues to decrease even if it was canceled by calling the `cancel()` method or the cancellation status was inherited from another token that was canceled. This is important because it depends on which exception will be raised when using the `check()` method.
- The code has become simpler in places, and new test cases for old functionality have also been added.

0.0.4

Important update!

- There is a new method - `check()`, which raises an exception if the token is canceled.
- Several exceptions have been added, one for each token class separately.
- An internal reporting mechanism has been added to find out which of the tokens in the hierarchy has been canceled.

0.0.3

Minor edits in the documentation.

0.0.2

Minor correction of documentation.

0.0.1

The first version of the library. Includes `AbstractToken` and 4 derived tokens: `SimpleToken`, `ConditionToken`, `TimeoutToken` and `CounterToken`.

Page 5 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.