Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A Python module for extracting values out of a string using a simple pattern instead of a regular expression.
A Python module for extracting values out of a string using a simple pattern instead of a regular expression by defining groups of named characters using a pair of opening and closing delimiters.
Examples:
from extract_values import extract_values
>>> extract_values('/2012/08/12/test.html', '/{year}/{month}/{day}/{title}.html')
{ 'year': '2012', 'month': '08', 'day': '12', 'title': 'test' }
>>> extract_values('John Doe <john@example.com> (http://example.com)', '{name} <{email}> ({url})')
{'name': 'John Doe', 'email': 'john@example.com', 'url': 'http://example.com' }
>>> extract_values('from 4th October to 10th October', 'from `from` to `to`', strip_values=True, whitespace=1, delimiters=['`', '`'])
{'from': '4th October', 'to': '10th October' }
>>> extract_values('Convert 1500 Grams to Kilograms', 'convert {quantity} {from_unit} to {to_unit}', lowercase=True)
{'quantity': '1500', 'from_unit': 'grams', 'to_unit': 'kilograms' }]
>>> extract_values('The time is 4:35pm here at Lima, Peru', 'The time is :time here at :city', delimiters=[':', ''])
{'time': '4:35pm', 'city': 'Lima, Peru'}
Optional parameters:
In order to install this package from PyPi you can run any of these commands:
easy_install extract-values
or
pip install extract-values
This library can also be installed directly from Github with the following command:
pip install git+ssh://git@github.com/gnrfan/extract-values.git
This little project was inspired by a similar Node.js module created by sri-lankan developer Lakshan Perera available here.
(c) 2012 - Antonio Ognio antonio@ognio.com - Distributed under the BSD license - Made in Peru.
FAQs
A Python module for extracting values out of a string using a simple pattern instead of a regular expression.
We found that extract-values 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.