Skip to main content

velocitous markup language to JSON parser

Project description

vml

velocitous markup language

(Totally not related with VML-SVG)
This is a JSON parser for a markup language, if you want to call it like that, that i found myself using while jolting notes in the fastest most velocitous, and laziest way that i could think of... It goes pretty much like this:

element 1
	things
		dog
		[x] snacks
			[ ] apple
			pear
		house
	names
		james
		alfred

[ ] element 2
	foo
	bar
	baz

That translates to this bulky JSON. You see, it makes JSON look bulky!!!

[
  {
    "element 1": [
      {
        "things": [
          "dog",
          {
            "snacks": [
              {
                "apple": [],
                "checked": false
              },
              "pear"
            ],
            "checked": true
          },
          "house"
        ]
      },
      {
        "names": [
          "james",
          "alfred"
        ]
      }
    ]
  },
  {
    "element 2": [
      "foo",
      "bar",
      "baz"
    ],
    "checked": false
  }
]

vml uses tabs to differentiate the hierarchical level of the current line... i think you got what i mean. Plus, you can also add checkboxes to every line with "[ ]", and you can check it with "[x]", and all this translates to a "checked" property in the JSON representation. It's easy to write vml with vi, for example you might check an empty checkbox with rx and move around tabulations efficiently with >> or <<. In fact, this should really have been called tml, as in tab markup language, but unfortunately, that resembled too much TOML, dammit you Tom!!
Install this with pip3 install vml-parser
Import it with from vml_parser import vml, so you that you can access the vml.parse(s : list[str]) -> list[Element] method. With that you can easily json.loads(str(vml.parse(s : list[str]))) -> object. You now can also dump your python objects to a vml-formatted string with vml.dump(obj: object) -> str, and maybe save it to a file for later use!
You will also get the vml command line script for free! you can pipe it to stdout or you can pass it any number of filenames for it to read.

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

vml-parser-0.0.6.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

vml_parser-0.0.6-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file vml-parser-0.0.6.tar.gz.

File metadata

  • Download URL: vml-parser-0.0.6.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for vml-parser-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a21fdaf18de0b140e8e2ed461bdd007aef9711c077db7782a4bfd785fe70c357
MD5 2c82ef698f9560ebd6e631164b6805b7
BLAKE2b-256 ef2bbe2420beae231b7162e6b08053caf53a59a51e75b90d6379b5785cff4985

See more details on using hashes here.

File details

Details for the file vml_parser-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: vml_parser-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for vml_parser-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 74e856f4583216a2a4c2fff2061cda05490462f31954f7727a131a30f7304f33
MD5 3f71846fb38146d567b0fcc1165886d6
BLAKE2b-256 38b18fa93df963676ad12c762fb3d86d61159395bdbd74270a9c79db4c5612cc

See more details on using hashes here.

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