Marcel

Latest version: v0.30.7

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

Scan your dependencies

Page 7 of 8

0.10.17

Bug fixes, no new features.

0.10.15

Tab completion wasn't working inside a nested pipeline, e.g. ls -dr ... | args [d: ls ...

Overhauled parser's tracking of context for use by tab completion.

0.10.11

Marcel now has an operator, `args`, that works like Linux's `xargs`.
For example, suppose you have a directory containing log files, and you want to
delete logs that are more than 100 days old. Locating
such files is easy:

shell script
ls -f | select (f: now() - f.mtime > days(100))


What you would like to do is to take each `File` in the resulting stream, and
delete it. The `args` operator takes items arriving on the input
stream, and makes them available to operators. So to do the file removal:

shell script
ls -f | select (f: now() - f.mtime > days(100)) | args [f: rm (f)]


- `ls ... | select ...` produces a stream of `File`s.
- These `File`s flow into the `args` input stream.
- `args` has a pipeline with parameter `f`. Each arriving `File` is bound to `f`, and
the pipeline is executed.
- `rm (f)` removes `File` `f`.

You can also pass all of the qualifying `File`s at once:

shell script
ls -f | select (f: now() - f.mtime > days(100)) | args --all [files: rm (quote_files(files))]


Now, all of the qualifying `File`s are bound to the pipelines `files` parameter.
Because the args pipeline relies on the host OSs `rm` command, carefully quoting
filenames is necessary. `quote_files` takes `files`, a `list` of `File`s, and returns
a string containing all the `File`s names, separated by spaces, and each quoted, (e.g.
to properly handle a filename such as `this filename has four spaces`.)

Actually, you can do the same cleanup by relying on the fact that `File`s implement
the `pathlib.Path` interface, which has an `unlink` method. So this works too:

shell script
ls -f | select (f: now() - f.mtime > days(100)) | map (f: f.unlink())

0.10.6

0.10.6 is a bugfix release, fixing issues raised by issue 1. See the discussion there for more details.

0.9.20

Reworked the grammar again for the > and >> symbols. Added testing through every path of Parser.pipeline().

0.9.19

Syntactic sugar has been sprinkled on top of the `store` and `load`
operators.

A stream carries tuples from one operator to another. `Store`
accumulates these tuples into a `list`, and `load` turns them back
into a stream. So, for example, you can store recently updated
files as follows:

shell script
ls -fr | select (f: now() - f.mtime < days(1)) | store recent


And then do further processing as follows:

shell script
load recent | select (f: f.suffix == '.py')


You can still use this syntax. Using the newly added syntax, these commands
can be written as:

shell script
ls -fr | select (f: now() - f.mtime < days(1)) > recent
recent > select (f: f.suffix == '.py')

Page 7 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.