git404hub

what is gravitasml fr?

significant-gravitas/gravitasml — explained in plain English

Analysis updated 2026-05-18

37PythonAudience · developerComplexity · 2/5LicenseSetup · easy

tl;dr

A tiny, secure Python parser that turns simple tag-based markup, especially LLM output, into Python dictionaries without any risky XML features.

vibe map

mindmap
  root((GravitasML))
    What it does
      Parse tags to dicts
      Nested and repeated tags
      Optional raw text blocks
    Tech stack
      Python
      Pydantic
    Use cases
      Parse LLM output
      Safe config formats
      Structured data extraction
    Audience
      AI app developers
      Python developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Parse tag-based text generated by an AI model into a Python dictionary safely.

VIBE 2

Convert nested markup directly into a validated Pydantic model.

VIBE 3

Extract structured data from a controlled, simple markup format without a full XML library.

VIBE 4

Preserve a block of raw content untouched using the no_parse filter while parsing the rest.

what's the stack?

PythonPydantic

how it stacks up fr

significant-gravitas/gravitasmlhao0321/video-autopilot-kitharahan/rtdmd
Stars373737
LanguagePythonPythonPython
Setup difficultyeasymoderatehard
Complexity2/53/55/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

in plain english

GravitasML is a small Python library for parsing simple tag-based markup into Python dictionaries. It was built by the AutoGPT team to handle structured text that AI language models produce, where the output uses XML-style tags to organize data but does not need the full complexity or security risks of a proper XML parser. The main reason to use it instead of a standard XML library is security. Full XML parsers support features like entity expansion and external document references that can be exploited to crash a program or extract data from a server. GravitasML deliberately omits all of those features, so it is safe to run on untrusted output from an AI model or any other source you do not fully control. The library works in two steps: it first breaks the markup text into tokens, then assembles those tokens into a tree and converts the tree to a plain Python dictionary. Nested tags become nested dictionaries. Repeated tags at the same level become a list automatically. Tag names with spaces are normalized to use underscores and lowercase letters. If a section of markup should be kept as a raw string rather than parsed further, you can add a filter marker to the opening tag to suppress parsing for that block. You can also tell the library to convert the parsed result directly into a Pydantic model, which adds field validation on top of the basic parsing. The library does not support tag attributes, self-closing tags, XML namespaces, or generating markup. It is intentionally limited to keep the codebase small and focused on the one task it is designed for.

prompts (copy fr)

prompt 1
Show me how to install gravitasml and parse a simple tag string into a Python dictionary.
prompt 2
Help me convert nested markup from an LLM response into a Pydantic model using gravitasml.
prompt 3
Explain how gravitasml handles repeated tags and turns them into lists.
prompt 4
How do I use the no_parse filter in gravitasml to keep a block of HTML as a raw string?

Frequently asked questions

what is gravitasml fr?

A tiny, secure Python parser that turns simple tag-based markup, especially LLM output, into Python dictionaries without any risky XML features.

What language is gravitasml written in?

Mainly Python. The stack also includes Python, Pydantic.

What license does gravitasml use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is gravitasml to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gravitasml for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.