Skip to main content

A parser for Datalang.

Project description

Datalang

Datalang it's an easy to use language with a similar syntax to YAML.
It has a fast parser!

How-to Install

You will need GIT or PIP

pip install datalang
# Or
git clone https://github.com/zsendokame/datalang; cd datalang; python setup.py

How-to Use

import datalang

datalangCode = """
str string: Value
int integer: 1
arr array: [Value 1, Value 2]

dictionary:
- Variable1: Value2
- Variable2: Value3
"""

print(datalang.load(datalangCode))

""" Output
{
    'string': 'Value',
    'integer': 1,
    'array': [
        'Value 1', 'Value 2'
    ],
    'dictionary': {
        'Variable1': 'Value2',
        'Variable2': 'Value3'
    }
}
"""

datalangDict = {
    'stringVariable': 'Value',
    'integerVariable': 1,
    'arrarVariable': ['value1', 'value2']

    'dictionaryValue': {
        'variable1': 'value2',
        'variable2': 'value3'
    }
}

print(datalang.dump(datalangDict))

"""
str stringVariable: Value
int integerVariable: 1
arr arrarVariable: [value1, value2]

dictionaryValue:
- variable1: value2
- variable2: value3
"""

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

datalang-1.0.2.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file datalang-1.0.2.tar.gz.

File metadata

  • Download URL: datalang-1.0.2.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for datalang-1.0.2.tar.gz
Algorithm Hash digest
SHA256 099cfbee01506c484e4ddb0ec6782cab068a479d6f13d67db911d406027fe59a
MD5 be021086405bf2a3e21cc7ce80b42822
BLAKE2b-256 e733e3a76ea57d9987ba5f67c71928756a25ecf2fcc9e8d4f586763e659c2935

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