Skip to main content

k3fnmatch

Action-CI Documentation Status Package

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)

Source distribution for k3fnmatch 0.1.5
File Size Uploaded
k3fnmatch-0.1.5.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for k3fnmatch 0.1.5
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.1.6

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page