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.4

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.4
File Size Uploaded
k3fnmatch-0.1.4.tar.gz 8.8 kB Details

Built distribution (wheel)

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

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

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