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.2
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.2.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3fnmatch-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / k3fnmatch-0.1.2.tar.gz
| Download URL | k3fnmatch-0.1.2.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c986530d4b22486b78667baf842dd80406868b8c585e954c3177c13e542329e
|
|
BLAKE2b-256 checksum How to use checksums |
9e1fec2b09adb2cb580316ba8163dcb403b0351dfa787109a13f74abe8c49e9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / k3fnmatch-0.1.2-py3-none-any.whl
| Download URL | k3fnmatch-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e72e973a20be626f63b96e7a3d35494f9a6623489608517ecf17edcf6a90d770
|
|
BLAKE2b-256 checksum How to use checksums |
eadaa4fe0051b660c353ba3d594a5bc2ac04d427692454142c930e44b4251550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|