
Product
Introducing Repository Labels and Security Policies
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
This library is a fork of fnmatch (https://docs.python.org/2/library/fnmatch.html) to implement **
|PypiDownloads|
All documentation is identical to fnmatch except *
, *
is now
**
and *
only affects the particular directory
https://docs.python.org/2/library/fnmatch.html
.. code:: bash
pip install pywildcard
Link pypi: https://pypi.python.org/pypi/pywildcard
.. code:: python
import pywildcard
dirs = ['hello/world.py', 'hello/world.pyc', 'hello/world/other/folder/example.py']
pywildcard.filter(dirs, 'hello/*')
# ['hello/world.py', 'hello/world.pyc']
pywildcard.filter(dirs, 'hello/*.py')
# ['hello/world.py']
pywildcard.filter(dirs, 'hello/**')
# ['hello/world.py', 'hello/world.pyc', 'hello/world/other/folder/example.py']
pywildcard.filter(dirs, 'hello/**.py')
# ['hello/world.py', 'hello/world/other/folder/example.py']
fnmatch
.. code:: python
import re
import fnmatch
urls = ['example/l1/l2/test3-1.py',
'example/l1/test2-1.py',
'example/l1/test2-2.py',
'example/l1/l2/l3/test4-1.py']
regex = fnmatch.translate('example/*')
# 'example\\/.*\\Z(?ms)'
re.findall(regex, "\n".join(urls))
# return ['example/l1/l2/test3-1.py\nexample/l1/test2-1.py\nexample/l1/test2-2.py\nexample/l1/l2/l3/test4-1.py']
pywildcard
.. code:: python
import re
import pywildcard
urls = ['example/l1/l2/test3-1.py',
'example/l1/test2-1.py',
'example/l1/test2-2.py',
'example/l1/l2/l3/test4-1.py']
regex = pywildcard.translate('example/**')
# 'example/.*?$(?ms)'
re.findall(regex, "\n".join(urls))
# return ['example/l1/l2/test3-1.py',
# 'example/l1/test2-1.py',
# 'example/l1/test2-2.py',
# 'example/l1/l2/l3/test4-1.py']
```bash # Check out the git repository. git clone git@github.com:agalera/python-wildcard.git # Enter the directory. cd python-wildcard # Install pytest if you have not done already. pip install pytest # Run the tests pytest
.. |PypiDownloads| image:: https://img.shields.io/pypi/dm/pywildcard.svg :target: https://pypi.python.org/pypi/pywildcard
FAQs
A fork of fnmatch to implement **
We found that pywildcard demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.
Product
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.