a very simple markup language.
Project description
vsml.py: a (v)ery (s)imple (m)arkup (l)anguage (python version)
“avoiding complexity reduces bugs.” - linus torvalds
table of contents
features
current features
- simple ini-like syntax
- lightning fast python functions
- comments
planned features
- toml-like subsections
- make initFile check for more possible issues
file syntax
# a comment before a section!
[ExampleSection]
ExampleKey1=ExampleValue1
ExampleKey2=ExampleValue2
# a comment between sections!
[ExampleSection2]
# a comment inside a section!
ExampleKey1=ExampleValue1
ExampleKey2=ExampleValue2
ExampleKey3=ExampleValue3
# a comment at the end of the file!
functions
initFile
the initFile function checks if the file exists, and can be written to.
if it is possible to write to the file, it will strip the file of unneeded whitespace so that the following functions will work properly.
in future versions, this function will attempt to fix files with syntax errors.
it is highly recommended to run this function before any others.
usage:
initFile("/path/to/file.vsml")
findSec
the findSec function returns the first line, and last line of a section, in the form of a list.
usage:
findSec("/path/to/file.vsml", "ExampleSection1") # returned: [ 0, 2 ]
findKey
the findKey function returns where a key is in a file.
usage:
findKey("/path/to/file.vsml", "ExampleKey1", "ExampleSection1") # returned: 1
readKeyValue
the readKeyValue function returns the value of a key.
usage:
readKeyValue("/path/to/file.vsml", "ExampleKey1", "ExampleSection1") # returned: "testValue1"
editKeyValue
the editKeyValue function changes the value of a key.
usage:
editKeyValue("/path/to/file.vsml", "ExampleKey1", "NotExampleValue1", "ExampleSection1")
rename
the rename function changes the name of a key, or a section.
usage (key):
rename("/path/to/file.vsml", "NotExampleKey1", "ExampleSection1", key="ExampleKey1")
usage (section):
rename("/path/to/file.vsml", "NotExampleSection1", "ExampleSection1")
add
the add function adds a key, or section.
usage (key, by section):
add("/path/to/file.vsml", section="ExampleSection1", key="ExampleKey2", value="ExampleValue2")
usage (key, by line number):
add("/path/to/file.vsml", lineNum=27, key="ExampleKey2", value="ExampleValue2")
usage (section, add to end of file):
add("/path/to/file.vsml", section="ExampleSection2")
usage (section, by line number):
add("/path/to/file.vsml", lineNum=26, section="ExampleSection2")
delete
the delete function deletes a key, or section.
usage (key):
delete("/path/to/file.vsml", section="ExampleSection1", key="ExampleKey1")
usage (section):
delete("/path/to/file.vsml", section="ExampleSection1")
usage (line number):
delete("/path/to/file.vsml", lineNum=27)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vsml.py-0.3.2.tar.gz.
File metadata
- Download URL: vsml.py-0.3.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ad20481a1ed18728153aa4b2196ad1801c6d59f277ad3b0598a54e243ee606b
|
|
| MD5 |
b920410926f8d5352614bb770c2818ff
|
|
| BLAKE2b-256 |
e841df3ed267ea92ed80dfb036dc2d7e5fa022f3ddfa94bb4551a598f01288d9
|
File details
Details for the file vsml.py-0.3.2-py3-none-any.whl.
File metadata
- Download URL: vsml.py-0.3.2-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3558b45c2da50687e4a80946b35c8a92fca69ee1c0b10262f2b9e2dfc5550ad
|
|
| MD5 |
1c6db6392ff17f0a214ab7b6308e1a92
|
|
| BLAKE2b-256 |
82dbf7e6cde1a1211daafdeb2d63a68a4c717bda99c4275b810bb64ccc08f294
|