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.3.tar.gz (2.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: datalang-1.0.3.tar.gz
  • Upload date:
  • Size: 2.3 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.3.tar.gz
Algorithm Hash digest
SHA256 e52cfe07a2ba7a0fa864dd8f66668b84206d4e4e243fb522ae2919d22b3cd2be
MD5 d9850f051d17eb1eec2fbd6d34538296
BLAKE2b-256 0f575354037668fd028243540b3f96ec1585a713b5b22fc63f54104db1d3746a

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