Py-predicate

Latest version: v0.9

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

Scan your dependencies

Page 1 of 2

0.9

- new match_p predicate to apply regex-like matches on iterables
- the has_length_p now accepts a predicate as parameter instead of a fixed length
- the fn_p predicates can have true and false generators
- many minor fixes and cleanup

0.8

- Improved boolean generator
- Improved random complex numbers generator
- New optimisations for all_p/any_p combinations
- Add a generator that generates predicates
- Several bug-fixes
- Test coverage to 1000+ unit tests

0.7

- New predicate to test if a function/callable has a specific signature
- New predicate to test is a value is a lambda function
- New has_path_p predicate to check if dict contains a specific path
- Several bugfixes to true/false generators
- Implemented 'implies' predicate
- Many smaller tweaks and code improvements

0.6

- Many improvements to False/True generators
- Implemented dict_of_p predicate
- Add explain functionality to show reason why a predicate evaluated to False

0.5

- Super and sub predicates on sets
- Predicates for IP addresses and networks
- Several improvements for the generator
- Additions to 'implies' method to simplify optimisations
- Wrapped string booleans functions in predicates

0.4

- Added tee_p, to capture side effects (for example printing) in complex predicates
- Added a few more predicates to handle dictionaries
- Added ge_le_p, ge_lt_p, gt_le_p and gt_lt_p to capture ranges like 2 < x < 5.
- Added optimisation for above predicates
- Added methods to create values, given a predicate, make it either False or True (WIP)
- Documentation updates
- Added 2 tutorials

Page 1 of 2

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.