Skip to content

Commit

Permalink
Update some documentation related to recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Sep 26, 2024
1 parent 2c5b30b commit 0be4cfb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ is found where Wildcard Match seems to deviate in an illogical way, we'd love to

A quick overview of Wildcard Match's Features:

- Provides an interface comparable to Python's builtin in `fnmatch`, `glob`, and `pathlib`.
- Allows for a much more configurable experience when matching or globbing with many more features.
- Adds support for `**` in glob.
- Adds support for escaping characters with `\`.
- Add support for POSIX style character classes inside sequences: `[[:alnum:]]`, etc. The `C` locale is used.
- Adds support for brace expansion: `a{b,{c,d}}` --> `ab ac ad`.
- Adds support for expanding `~` or `~username` to the appropriate user path.
- Adds support for extended match patterns: `@(...)`, `+(...)`, `*(...)`, `?(...)`, and `!(...)`.
- Adds ability to match path names via the path centric `globmatch`.
- Provides a `pathlib` variant that uses Wildcard Match's `glob` library instead of Python's default.
- Provides an alternative file crawler called `wcmatch`.
- And more...
- Provides an interface comparable to Python's builtin in `fnmatch`, `glob`, and `pathlib`.
- Allows for a much more configurable experience when matching or globbing with many more features.
- Adds support for `**` in glob.
- Adds support for Zsh style `***` recursive glob for symlinks.
- Adds support for escaping characters with `\`.
- Add support for POSIX style character classes inside sequences: `[[:alnum:]]`, etc. The `C` locale is used.
- Adds support for brace expansion: `a{b,{c,d}}` --> `ab ac ad`.
- Adds support for expanding `~` or `~username` to the appropriate user path.
- Adds support for extended match patterns: `@(...)`, `+(...)`, `*(...)`, `?(...)`, and `!(...)`.
- Adds ability to match path names via the path centric `globmatch`.
- Provides a `pathlib` variant that uses Wildcard Match's `glob` library instead of Python's default.
- Provides an alternative file crawler called `wcmatch`.
- And more...

## Installation

Expand Down
1 change: 1 addition & 0 deletions docs/src/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ A quick overview of Wildcard Match's Features:
[`pathlib`][pathlib].
- Allows for a much more configurable experience when matching or globbing with many more features.
- Adds support for `**` in glob.
- Adds support for Zsh style `***` recursive glob for symlinks.
- Adds support for escaping characters with `\`.
- Add support for POSIX style character classes inside sequences: `[[:alnum:]]`, etc. The `C` locale is used.
- Adds support for brace expansion: `a{b,{c,d}}` --> `ab ac ad`.
Expand Down
17 changes: 10 additions & 7 deletions docs/src/markdown/pathlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ matching:
- [`glob`](#glob), [`rglob`](#rglob), and [`match`](#match) do not enable [`GLOBSTAR`](#globstar)
or [`DOTGLOB`](#dotglob) by default. These flags must be passed in to take advantage of this functionality.

- A [`globmatch`](#globmatch) function has been added to `PurePath` classes (and `Path` classes which are
derived from `PurePath`) which is like [`match`](#match) except without the right to left behavior. See
[`match`](#match) and [`globmatch`](purepathglobmatch) for more information.
- A [`globmatch`](#globmatch) function has been added to `PurePath` classes (and `Path` classes which are derived from
`PurePath`) which is like [`match`](#match) except performs a "full" match. Python 3.13 added a similar
function called [`full_match`](#full_match) which came long after our [`globmatch`](#globmatch) support was added.
In recent versions we've also added [`full_match`](#full_match) as an alias to our [`globmatch`](#globmatch)
function. See [`match`](#match), [`globmatch`](#globmatch), and [`full_match`](#full_match) for more information.

- If file searching methods ([`glob`](#glob) and [`rglob`](#rglob)) are given multiple patterns, they will
ensure duplicate results are filtered out. This only occurs when more than one inclusive pattern is given, or a
Expand Down Expand Up @@ -109,7 +111,7 @@ matching:

- [`rglob`](#rglob) will exhibit the same *recursive* behavior.

- [`match`](#match) will exhibit the same right to left behavior.
- [`match`](#match) will match using the same *recursive* behavior as [`rglob`](#rglob).

## Classes

Expand Down Expand Up @@ -250,9 +252,10 @@ limit](#multi-pattern-limits). Exclusion patterns can be specified via the `excl
a list of patterns. It will return a boolean indicating whether the object's file path was matched by the
pattern(s).

`match` mimics Python's `pathlib` version of `match`. Python's `match` uses a right to left evaluation. Wildcard Match
emulates this behavior as well. What this means is that when provided with a path `some/path/name`, the patterns `name`,
`path/name` and `some/path/name` will all match. Essentially, it matches what [`rglob`](#rglob) returns.
`match` mimics Python's `pathlib` version of `match`. Python's `match` uses a right to left evaluation that behaves
like [`rglob`](#rglob) but as a matcher instead of a globbing function. Wildcard Match emulates this behavior as well.
What this means is that when provided with a path `some/path/name`, the patterns `name`, `path/name` and `some/path/name`
will all match. Essentially, it matches what [`rglob`](#rglob) returns.

`match` does not access the filesystem, but you can force the path to access the filesystem if you give it the
[`REALPATH`](#realpath) flag. We do not restrict this, but we do not enable it by default.
Expand Down

0 comments on commit 0be4cfb

Please sign in to comment.