Skip to main content

A package to convert between markup language documents and a forest data structure for efficient processing.

Project description

media/image.png

delorean

A library to convert markup documents into tree data structures and vice versa. There is greater functionality available to modify, prune, add and delete parts of documents when there are in the MarkdownTree structure.

The full list of features can be found under Features

Install

Install via pip

pip install markdown-tree

You can find the library page here here

Quick Usage Guide

delorean offers only one function treeify, which generates a Python object from markup text. This object is a navigable, “Tree of Contents” abstraction for the markdown file.

Take, for example, the following markdown file.

[[ chikin.md ]]

# Chikin Tales

Once there was a chikin.

## Chapter 1 : Chikin Fly

Chickens don't fly. They do only the following:

- waddle
- plop


### Waddling

A waddle is what these birds do.

## Chapter 2 : Chikin Scream

### Plopping

Plopping involves three steps:

1. squawk
2. plop
3. repeat, unless ordered to squat

Akin to a navigation bar, the TreeOfContents object allows you to expand a markdown file one level at a time. Running md2py on the above markdown file will generate a tree, abstracting the below structure.

        Chikin Tales
       /     \       \
      /       \       \
(Once th..)    |       \
               |        \
           Chapter 1     \
           /     |     Chapter 2
          /      |         |
(Chickens do..)  |       Plopping
                 |         |
              Waddling   (Plopping...)
                 |
             (A waddle...)

For the full usage guide, access the SAMPLES.md file.

Features

Some of the features of this library are:

  1. Converts a markdown file to a manipulatable, light Python data structure.

  2. Converts the Python data structure back into a Markdown file.

  3. Traverse and edit the Python data structure.

License

This project is licensed under the Apache 2.0 License. A copy of the license can be found in the LICENSE file.

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

pydelorean-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

pydelorean-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pydelorean-0.1.0.tar.gz.

File metadata

  • Download URL: pydelorean-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for pydelorean-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ef10c79f1712ab3ebdef35832f4e8af216876355aeac4ef15f6349afb634cdc
MD5 0e74c08ab1a602354244012b5626c665
BLAKE2b-256 5a69a1f461265d95ff1cc8c416e04d76232ac4e60791e7876a9a5ae38d4c9ba8

See more details on using hashes here.

File details

Details for the file pydelorean-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydelorean-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for pydelorean-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed1c99e28d701c187e59cb6554d206e67afcd2bccc92313c86ca5262438ae41f
MD5 75a5c2dc09f7fcb0c5b95a9b67467945
BLAKE2b-256 de43dbdc1292e8862b0e570e42152e9ab0f49041695395978d769cbeaa75b91a

See more details on using hashes here.

Supported by

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