Skip to main content

No project description provided

Project description

GravitasML

GravitasML is a lightweight Python library for parsing custom markup languages. It provides a simple and intuitive API to convert markup into Python objects or dictionaries.

Features

  • Easy-to-use parser for custom markup languages.
  • Convert markup directly to Python dictionaries.
  • Handles nested and multiple root tags.
  • Customizable tag names with automatic whitespace conversion.
  • Syntax error detection for unmatched or improperly nested tags.

Installation

To install GravitasML, use pip as follows:

pip install gravitasml

Quick Start

Here's a quick example to get you started:

from gravitasml.token import tokenize
from gravitasml.parser import Parser

markup = "<tag1><tag2>content</tag2></tag1>"
tokens = tokenize(markup)
parser = Parser(tokens)
obj = parser.parse()

print(obj)  # Output: {'tag1': {'tag2': 'content'}}

Limitations

GravitasML is designed to be simple and intuitive, but there are some limitations to be aware of:

  • It does not support XML namespaces or schema validation.
  • It does not handle processing instructions or CDATA sections found in XML.
  • Currently, there is no support for attributes within tags; only tag names and content are parsed.
  • It does not provide functionality to write or generate markup, only to parse it.
  • GravitasML is not optimized for extremely large documents or streaming parsing.

Documentation

For detailed usage and documentation, please refer to the docs directory in this repository.

Tests

GravitasML comes with a comprehensive test suite. To run the tests, execute the following command:

python -m unittest discover -v

Contributing

We welcome contributions from the community. If you'd like to contribute, please fork the repository and submit a pull request.

License

GravitasML is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gravitasml-0.1.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gravitasml-0.1.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file gravitasml-0.1.2.tar.gz.

File metadata

  • Download URL: gravitasml-0.1.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gravitasml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bbb651a9d5be669d47cc5bd7fbf19d55ce277b3dd9966cc37d2ec0ae042aab25
MD5 c6285f9fae85a9f1e8e3463582468b6e
BLAKE2b-256 d28e2bfa506fa988a7efc6eef8051d7c4fd03cbb5ab05aa38571523ff574bbc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gravitasml-0.1.2.tar.gz:

Publisher: cicd.yml on Significant-Gravitas/gravitasml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gravitasml-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gravitasml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gravitasml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eafa5a65a6f952f0d23c54762f5fcb654b3f000ede389519a7dc3c3179801121
MD5 78d260e09b05adf23cf00fdaeac6bf19
BLAKE2b-256 275ee95a5120603cf2b251b67c1163a050068d290e93928047c2b6044c2c0d29

See more details on using hashes here.

Provenance

The following attestation bundles were made for gravitasml-0.1.2-py3-none-any.whl:

Publisher: cicd.yml on Significant-Gravitas/gravitasml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page