$npx skillfedfor your agent

greenery

Greenery allows manipulation of regular expressions

With conditionsPyPI Text ProcessingReleased Jun 2024250.5K downloads / moMIT LicensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — greenery-4.2.2-py3-none-any.whl
v4.2.2 · released 2024-06-08

Yes, if you need to reason about regular expressions as formal languages—computing intersections, complements, or equivalences. The library is stable, has no dependencies, and carries a permissive license. However, it is aging (no release since 2024-06-08); install it for a specific regex-algebra task, but do not expect active maintenance or rapid updates.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with no runtime dependencies.
  • Maintenance status is aging—last commit was 2025-09-20 but the package has not had a release since 2024-06-08, suggesting the project is stable but not actively developed.

License · maintenance · safety

MIT License (permissive) — MIT License (permissive) means you can use, modify, and distribute greenery freely in commercial and private projects with minimal restrictions, provided you include the license notice.

last release 2024-06-08 (797 days) · last repo commit 2025-09-20 · 399 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 250,525 downloads/mo, #8,627 on PyPI

Verify before relying

pip install greenery

from greenery import parse

# Compute intersection of two regexes
result = parse("abc...") & parse("...def")
print(result)  # "abcdef"
  • Whether the package works with Python versions beyond 3.8, given the classifier lists only 3.8 and requires_python is unspecified.
  • Performance characteristics when working with complex or deeply nested regular expressions.
Same gist for agents: .md · .json

What it is and what it does

Greenery is a library for parsing and manipulating regular expressions at the language level—not for matching strings, but for reasoning about the patterns themselves. It converts regexes to finite state machines internally, allowing you to perform set operations like intersection, union, difference, and complement on regex patterns. The core use case is computing the intersection of two regular expressions: the set of strings that both patterns accept, returned as a new regex.

The library supports standard regex syntax (character classes, quantifiers, alternation, grouping) but intentionally omits anchors (^ and $), backreferences, and lookahead/lookbehind constructs, since these fall outside formal regular language theory. It provides a Pattern API with methods modeled on frozenset, plus regex-specific operations like reversal, derivation (Brzozowski derivative), and reduction (simplification heuristics). With no external dependencies and a permissive MIT license, it's lightweight and suitable for embedding in tools that need to reason about regex patterns.

Use it for

  • Find the common strings accepted by two regex patterns by computing their intersection.
  • Simplify complex regular expressions using the reduce() method to apply algebraic simplification heuristics.
  • Reverse a regex pattern to match reversed strings, useful in bidirectional text processing.
  • Test regex equivalence by comparing two patterns to verify they match exactly the same set of strings.
  • Generate all strings matched by a regex using the strings() generator, for validation or testing.
  • Compute the complement of a regex (everythingbut) to match all strings not accepted by the original pattern.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to reason about regular expressions as formal languages—computing intersections, complements, or equivalences.

The library is stable, has no dependencies, and carries a permissive license. However, it is aging (no release since 2024-06-08); install it for a specific regex-algebra task, but do not expect active maintenance or rapid updates.

Install

greenery on PyPI

Before you install

Low install friction with no runtime dependencies. Maintenance status is aging—last commit was 2025-09-20 but the package has not had a release since 2024-06-08, suggesting the project is stable but not actively developed.

License in practice

MIT License (permissive) means you can use, modify, and distribute greenery freely in commercial and private projects with minimal restrictions, provided you include the license notice.

Quickstart

pip install greenery

from greenery import parse

# Compute intersection of two regexes
result = parse("abc...") & parse("...def")
print(result)  # "abcdef"

Verify before relying

  • Whether the package works with Python versions beyond 3.8, given the classifier lists only 3.8 and requires_python is unspecified.
  • Performance characteristics when working with complex or deeply nested regular expressions.

Package facts

LicenseMIT License permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAging 797 days since the last release
Last repo commit
First released
Downloads250,525 / month, #8,627 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.8

Evidence: greenery-4.2.2-py3-none-any.whl

Tags

Capabilities
regex intersection computationregular expression manipulationfinite state machine regexparse and combine regexesregex set operationspattern analysis toolsregex simplification
Topics
regex-algebraformal-languagesfinite-state-machines
PyPI keywords
reregexregexpregularexpressiondeterministicfinitestatemachineautomatonfsmdfsmfsadfsagreenery

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “regex intersection computation”

  • greeneryParses and manipulates regular expressions by converting them to…
  • interegularInteregular checks whether pairs of Python regular expressions can…
  • cmeel-qhullProvides precompiled qhull binaries (convex hull, Delaunay…

Give your agent the search over MCP, or paste the wish link into any chat.

More Text Processing packages

regex Worth it
PyPI · Python Modules · released Jul 2026

A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.

Apache-2.0 AND CNRI-Pythoncompiled wheel · 3.10+
437.7Mdownloads / mo
pyparsing Worth it
PyPI · Text Processing · released Jan 2026

pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.

Install it if you need to parse text or define grammars programmatically.

MITpure Python · 3.9+
412.7Mdownloads / mo
fonttools Worth it
PyPI · Text Processing · released May 2026

fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.

Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.

permissive licensepure Python · 3.10+
235.9Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
RapidFuzz Worth it
PyPI · Text Processing · released Apr 2026

RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.

Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.

MITcompiled wheel · 3.10+
184.2Mdownloads / mo
tinycss2 Worth it
PyPI · Text Processing · released Nov 2025

tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.

Install it if your project requires CSS tokenization or syntax manipulation.

BSD-3-Clausepure Python · 3.10+
113.2Mdownloads / mo

See also interegular · regexploit · repath · exrex · iregexp-check · retrie · suffix-trees · flpc · tag-expressions