Pent

Latest version: v0.2

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

Scan your dependencies

0.2

Fixed

- Optional-line flag behavior now fixed and ~thoroughly tested.
Required a change to the accepted behavior, such that an optional pattern
matches (1) the line specified, (2) a blank line, or (3) no line.

Changed

- The semantics of the 'decimal' and 'float' number tokens have been swapped.
'Decimal' tokens will only match non-scientific-notation decimal values, while
'float' values match either 'decimal' or 'scinot' formatted values.

0.2.0rc1

Added

- "Misc" token type, '&', matching arbitrary non-whitespace content
- Optional whitespace can now be specified after number, literal, and misc
tokens, in addition to 'required whitespace after' and
'no whitespace after'
- New helper function `column_stack_2d`
- Needs performance improvements for large arrays
- New 'optional line' token type
- Works irregularly, perhaps due to quirks in managing optional
groups/capture groups within the Python regex engine?
- New property flags on `Token` to indicate the new features added
('misc' token type, optional-whitespace-after, etc.)

Changed

- Switched certain lists within the `Parser.capture_struct` return
dict structure to a type that automatically passes through a dict key to the
single element of those lists, if they are length-one. This
simplifies the syntax of a number of use cases by eliminating explicit `[0]`
indexing.
- `Parser` instances now syntax-check their `head`/`body`/`tail` patterns
at instantiation, instead of at the first capture attempt.

0.1.0

Features

- Three token types implemented to date: numeric, string-literal, "any"
- Parsing of multiple levels of recursive nested data; tested only
to two leves of nesting to date.
- Each nested level of structure can have head/body/tail
- Captured tokens can be easily retrieved from head/tail at the top level
parser; no good head or tail capture yet from within nested structures

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.