Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reverb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reverb

re module wrapper for writing regular expressions in functional style

  • 2.0.1
  • PyPI
  • Socket score

Maintainers
1

Introduction

This is the revival of a small Python module which lived once on the now abandoned Vaults of Parnassus when I entered Python programming about a decade ago. It was originally written and published by JasonHarper <http://nixietube.info/>_ in 1998 on a "free for any use" license. Since then it has slowly faded from the net which I find a bit sad.

What is reverb?


``reverb.py`` is a tiny wrapper around Pythons ``re`` module which maps regular
expressions
onto Python expressions for the sake of readability. The module name can be read
as "re-verb(ose)". reverb
follows the Python tradition of keeping the amount of punctuation small and
avoid punctuation collisions.

In reverb one writes ::

	Optional(Digit)+"."+Required(Digit)

instead of ::

	\d*\.\d+

to denote a pattern that matches a floating point number. The reverb reads much
like a meta-language explanation
of the dense and compact regexp.

From a reverb object one can fetch the regexp using the ``text`` attribute ::

	>>> (Optional(Digit)+"."+Required(Digit)).text
	'\\d*\\.\\d+'

Each reverb object translates to a regexp and it is finally the regexp which is
compiled and matched
against strings.

Reverb in context

I think about reverb any time I encounter a regexp learning tool <http://kodos.sourceforge.net/>_ but also pyparsing <http://pyparsing.wikispaces.com/>_ which has grown in popularity within the Python community and I suspect it did this for reasons not dissimilar to those intended by reverb: "avoiding line noise when writing regular expressions" in the words of Jason Harper. So I do think it fits a real need.

The only significant change I made to reverb is capitalization of names. reverb 1.0 was published when Python 1.5 came out and used identifiers like any and set which have now counterparts as builtins in Pythons standard library.

Documentation


The complete module documentation can be found `here
<http://www.fiber-space.de/reverb2/reverb-doc/index.html>`_

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc