Skip to main content

Library for string matching with glob patterns

Project description

Globber

Build Status codecov PyPI License

Globber is a Python library for matching file names against glob patterns. In contrast to other glob-matching libraries, it matches arbitrary strings and doesn't require the matched names to be existing files. In addition, it supports the globstar ** operator to match an arbitrary number of path components.

I have been working with Git repositories, specifically trying to process files classified as source. Picking the source files is much easier with globstar expressions, and since old files might no longer exist on the file system, the matching cannot be based on actual files. I couldn't find anything that had support for both, so I wrote this library.

Patterns

The syntax of a pattern is a sequence of components, separated by slashes /. Each component may include the following special characters:

Character Meaning
? Match any single character (not a path separator)
* Match any sequence of characters, possibly empty (except path separators)
** Must appear alone inside a component. Match any sequence of components, possibly empty
\ Match the following character literally. This is intended to escape the special characters

Contributing

I may occasionally keep working on this library if I have a need for new functionality, but for the moment it is good enough for my current needs. If you're using it, and find bugs or want some new functionality, you're welcome to open an issue. Pull requests are also appreciated but not necessary to get your concerns heard.

License

Globber is licensed under the Apache Software License, version 2.0. See the LICENSE file for precise license terms and conditions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

globber-0.2.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

globber-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file globber-0.2.1.tar.gz.

File metadata

  • Download URL: globber-0.2.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.5.6

File hashes

Hashes for globber-0.2.1.tar.gz
Algorithm Hash digest
SHA256 99720aab0939283d5919405b170f07990e47333c9481faa0a14926e62e56ef70
MD5 fa2e009c0bde70e6f574287b695d4f50
BLAKE2b-256 af5a283ad589a290ddd46a69cbb101989bd83bb152f204ccce83e89ac05d9caf

See more details on using hashes here.

File details

Details for the file globber-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: globber-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.5.6

File hashes

Hashes for globber-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d17220096bf50f34134eed81c068d343fe7bd96ed8306fb2a5ac6315070cbe9
MD5 a33c48b6632e7eca73ca86e38c349e13
BLAKE2b-256 6c743bb9839012ddfb814868f28c1ceb69d63d4c53bcc2df313d81769ec0e119

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page