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.4
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.4.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3fnmatch-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / k3fnmatch-0.1.4.tar.gz
| Download URL | k3fnmatch-0.1.4.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f60710bc65c2b3542aaf9e82018a302776ae21e08ac4b6c3814feaec4d78c963
|
|
BLAKE2b-256 checksum How to use checksums |
5b7cf652a16833795beda077e48fe09465186fb06b3f09a5f09ec6cea93c1d3d
|
| 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.4-py3-none-any.whl
| Download URL | k3fnmatch-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18e735dba218d1f3185e267e1b4aa3df65b6cdf786fa0a73341f217adf29e36d
|
|
BLAKE2b-256 checksum How to use checksums |
8004d2137aad8158456a41f8d3ba93983096b2fc846a0adb7643090f04af4890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|