==============
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:
```python
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:
* **lowercase** - When True is passed the string is lowercased first
* **whitespace** - Minimal number of extra whitespace to remove
* **strip_values** - When True calls strip() for each value removing whitespace
* **delimiters** - A sequence with only the opening and closing delimiters
In order to install this package from [PyPi](http://pypi.python.org) 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](http://nodejs.org/) module created by sri-lankan developer [Lakshan Perera](http://laktek.com/) available [here](https://github.com/laktek/extract-values).
(c) 2012 - Antonio Ognio <antonio@ognio.com> - Distributed under the BSD license - Made in Peru.
Metadata
Release files for extract-values 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| extract-values-1.0.tar.gz | 3.6 kB | Without provenance | Details for extract-values-1.0.tar.gz |
Release files / extract-values-1.0.tar.gz
| Download URL | extract-values-1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cddd31a0f20c42a6baa37aa6ebb1a875dcea2a744893eca572665db48b1ccec
|
|
BLAKE2b-256 checksum How to use checksums |
77730971bbe115f4a22b854d3af7ad941ae044d13b8529d812c7dc0e887c85f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for extract-values 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.