1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Source: python-parse
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Section: python
Priority: optional
Build-Depends: debhelper-compat (= 13),
dh-sequence-python3,
pybuild-plugin-pyproject,
python3-all,
python3-pytest <!nocheck>,
python3-pytest-cov <!nocheck>,
python3-setuptools
Standards-Version: 4.7.0
Homepage: https://github.com/r1chardj0n3s/parse
Vcs-Git: https://salsa.debian.org/python-team/packages/python-parse.git
Vcs-Browser: https://salsa.debian.org/python-team/packages/python-parse
Testsuite: autopkgtest-pkg-pybuild
Rules-Requires-Root: no
Package: python3-parse
Architecture: all
Depends: ${misc:Depends},
${python3:Depends}
Description: Provide the reverse function for format(), Python 3 package
Parse strings using a specification based on the Python format() syntax.
parse() is the opposite of format().
For example:
.
>>> parse("It's {}, I love it!", "It's spam, I love it!")
<Result ('spam',) {}>
>>> _[0]
'spam'
.
Or to search a string for some pattern:
.
>>> search('Age: {:d}\n', 'Name: Rufus\nAge: 42\nColor: red\n')
<Result (42,) {}>
|