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

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

Built distribution (wheel)

Table of built distributions (wheels) for k3fnmatch 0.1.3
File Interpreter ABI Platform
k3fnmatch-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / k3fnmatch-0.1.3.tar.gz

Download URL k3fnmatch-0.1.3.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f48b322da74eac415889e11dd02ec982cfb858800740eb45a82695fdc6172f4e
BLAKE2b-256 checksum
How to use checksums
000e9f2a55e1ecd448759c3a2b811d642860884e8d2a582ba890a9a20df4a07a
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.3-py3-none-any.whl

Download URL k3fnmatch-0.1.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48c89b782aad0d94e9d1c4b0c09f565028ec218033089c81045e946b3d33b145
BLAKE2b-256 checksum
How to use checksums
e9419791d80f2989ecb02355f41c811e3259534023f79f7b5e945d2929201c1c
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

0.1.4

2 release files

This release

0.1.3 This release

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