skillfed

Penman

PENMAN notation for graphs (e.g., AMR)

penman v1.3.1 84.5K downloads/30d#13,990 on PyPI151
Permissive license Active released

What it is and what it does

Penman models graphs in PENMAN notation—a text format for representing semantic structures like Abstract Meaning Representation (AMR). It provides a parser to convert PENMAN strings into graph objects, inspection and manipulation methods for the underlying triples and edges, and a serializer to write graphs back to PENMAN format with customizable formatting. The library also includes an AMR model with role inventory and graph transformations (reification, canonicalization, etc.), plus a command-line tool for non-Python workflows.

You use it when you need to work with semantic graph data in PENMAN format: reading annotated AMR corpora, programmatically building or modifying semantic graphs, validating graphs against a model, or converting between different graph representations. It handles metadata in comments and surface alignments, and lets you restructure graphs before serialization—adjusting indentation, selecting different root nodes, or relabeling variables.

Use it for:

  • Parse AMR corpora or PENMAN-formatted semantic graphs for NLP research or downstream semantic tasks.
  • Build or programmatically modify semantic graphs and serialize them back to PENMAN notation for annotation pipelines.
  • Validate semantic graphs against the AMR model and apply graph transformations like reification or role canonicalization.
  • Convert between graph representations (triples, edges, tree structures) for analysis or integration with other semantic tools.
  • Use the command-line tool to inspect, reformat, or transform PENMAN files without writing Python code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Penman is a Python library for reading, writing, and manipulating graphs encoded in PENMAN notation, commonly used for Abstract Meaning Representation (AMR) and other semantic graph formats.

Yes. Penman is a stable, well-maintained library with no dependencies, permissive licensing, and active repository support. It fills a clear need for anyone working with PENMAN-formatted semantic graphs, especially in NLP and AMR research. The recent commit history confirms ongoing maintenance.

Install

penman on PyPI

pip

pip install penman

uv

uv add penman

poetry

poetry add penman

Installing Penman

Before you install

Low friction installation with no runtime dependencies. The package is actively maintained with recent commits and supports modern Python versions (3.8, 3.9, 3.10, 3.11, 3.12).

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.

Quickstart

pip install penman

import penman
g = penman.decode('(b / bark-01 :ARG0 (d / dog))')
print(penman.encode(g, indent=3))

Verify before relying

  • Whether the 737 days since last release reflects a stable, feature-complete state or potential staleness for active development.
  • Real-world performance characteristics when working with large or deeply nested PENMAN graphs.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 737 days since the last release
Last repo commit
First released
Downloads 84,523/month — #13,990 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: penman-1.3.1-py3-none-any.whl

Keywords: amr, nlp, semantics

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Information AnalysisTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: LinguisticTopic :: Utilities

Tags

PENMAN graph notation parserAMR abstract meaning representationsemantic graph manipulationNLP graph serializationPENMAN encode decodegraph triple representationlinguistic semantic graphs
amrsemantic-graphsnlp

More Python Modules packages