k3fnmatch
Enhanced fnmatch with grouping regex and path transformation
k3fnmatch is a component of pykit3 project: a python3 toolkit set.
Enhanced fnmatch with grouping regex and path transformation.
Provides:
- translate(): Enhanced fnmatch.translate() with grouping and ** support
- fnmap(): Transform paths using source and destination patterns
Examples: >>> import re >>> pattern = translate("**/*.md") >>> m = re.match(pattern, "foo/bar/doc.md") >>> len(m.groups()) >= 3 True
>>> fnmap("foo/bar.md", "**/*.md", "**/*-cn.md")
'foo/bar-cn.md'
Install
pip install k3fnmatch
Synopsis
>>> import re
>>> pattern = translate("**/*.md")
>>> m = re.match(pattern, "foo/bar/doc.md")
>>> len(m.groups()) >= 3
True
>>> fnmap("foo/bar.md", "**/*.md", "**/*-cn.md")
'foo/bar-cn.md'
Author
Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Copyright and License
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Metadata
Release files for k3fnmatch 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| k3fnmatch-0.1.5.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3fnmatch-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.9 kB
Release files / k3fnmatch-0.1.5.tar.gz
| Download URL | k3fnmatch-0.1.5.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fd1615ffd828b524786f29e7b9246878e7f9183c2a8642814fd325d87eb6f0a
|
|
BLAKE2b-256 checksum How to use checksums |
6b97b073947f3f1162ebf938e35416f2e74ad0170a821da12ba7d74eb178ba27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / k3fnmatch-0.1.5-py3-none-any.whl
| Download URL | k3fnmatch-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a18243bfec93d24eba27efd7950577a3796de1784728b95064a1b1eeca2bd7c2
|
|
BLAKE2b-256 checksum How to use checksums |
3ae1e259f06b414f3c83efe4e68078804c45761b601946c0be3b4988c9e6b3de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|