scuff


Namescuff JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://github.com/akyuute/scuff
SummaryA config file format and transpiler suite written in Python.
upload_time2024-01-02 00:36:07
maintainer
docs_urlNone
authorakyuute
requires_python>=3.12
licenseMIT
keywords parsing compilers api ast
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ######
Scuff
######

*A human-readable data serialization language written in Python.*


Introduction
=============

**Scuff** is a language for data serialization: a way to store and read data
between formats.

One likely use for **Scuff** is application configuration files.


Installation
=============

To install **Scuff** and its tools for Python from the Python Package Index,
run the following in the command line:

.. code:: shell

    $ python -m pip install scuff


Grammar
========

Assigning Variables
--------------------

Variables are assigned with a *key* and a *value*.
Key names must be valid identifiers, meaning they must contain no spaces or
symbols except underscore (``_``).
Values can be assigned to variables with or without an equals sign (``=``):

.. code:: py

    my_favorite_number = 42
    my_favorite_color "Magenta"
    is_but_a_flesh_wound yes

When left without a value, variables will evaluate to ``null``/``None``:

.. code:: py

    set_to_null =
    also_null
    but_this_has_a_value 15


Data Types
-----------

- Numbers
    Numbers can be positive integers or floats::

        1 1.2 1_000 0.123 .123_4

- Booleans
    The boolean values ``True`` and ``False`` are given using these variants::

        True true yes
        False false no

- Strings
    Single-line strings can be enclosed by single quotes (``'``), double
    quotes (``"``) or backticks (`````), and multiline strings are enclosed by
    three of any of those:

    .. code:: py

        foo "abc"
        bar 'def'
        baz '''Hi,
                did you know
                    you're cute?
                        '''


..
    Strings placed right next to each other are concatenated:

    .. code:: py
        
        first = "ABC"
        second = "DEF"
        first_plus_second = "ABC"  "DEF"
        concatenated = "ABCDEF"
                    
- Lists
    Lists are enclosed by square brackets (``[]``).
    Elements inside lists are separated by spaces, commas or line breaks:

    .. code:: py

        groceries [
            "bread",
            "milk" "eggs"
            "spam"
        ]

- Mappings
    Mappings are groups of key-value pairs enclosed by curly braces (``{}``).
    Values may be any expression, even other mappings:

    .. code:: py

        me {
            name "Samantha"
            age 24
            job "Developer"
            favorite_things {
                editor "Vim"
                languages ["Python", "Rust"]
            }
        }

    Mappings may also take the form of dotted attribute lookups:

    .. code:: py

        outer.middle.inner yes  # == {'outer': {'middle': {'inner': True}}}

- Comments
    Single-line comments are made using the ``#`` symbol:

    .. code:: py

        option = "The parser reads this."
        # But this is a comment.
            #And so is this.
        option2 = "# But not this; It's inside a string."
        # The parser ignores everything between ``#`` and the end of the line.
         #   ignore = "Comment out any lines of code you want to skip."


Usage
======
Once you install **Scuff**, you can then import ``scuff`` as a Python module
and use its tools:

.. code:: py

    >>> import scuff
    >>> scuff.convert_file('file.conf')
    ...




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/akyuute/scuff",
    "name": "scuff",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": "",
    "keywords": "parsing,compilers,api,ast",
    "author": "akyuute",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/61/e6/eb5823accdf34dad2c67cea38e364d21862d9044129935d0c12a5f93d4fe/scuff-0.3.tar.gz",
    "platform": "Platform Independent",
    "description": "######\nScuff\n######\n\n*A human-readable data serialization language written in Python.*\n\n\nIntroduction\n=============\n\n**Scuff** is a language for data serialization: a way to store and read data\nbetween formats.\n\nOne likely use for **Scuff** is application configuration files.\n\n\nInstallation\n=============\n\nTo install **Scuff** and its tools for Python from the Python Package Index,\nrun the following in the command line:\n\n.. code:: shell\n\n    $ python -m pip install scuff\n\n\nGrammar\n========\n\nAssigning Variables\n--------------------\n\nVariables are assigned with a *key* and a *value*.\nKey names must be valid identifiers, meaning they must contain no spaces or\nsymbols except underscore (``_``).\nValues can be assigned to variables with or without an equals sign (``=``):\n\n.. code:: py\n\n    my_favorite_number = 42\n    my_favorite_color \"Magenta\"\n    is_but_a_flesh_wound yes\n\nWhen left without a value, variables will evaluate to ``null``/``None``:\n\n.. code:: py\n\n    set_to_null =\n    also_null\n    but_this_has_a_value 15\n\n\nData Types\n-----------\n\n- Numbers\n    Numbers can be positive integers or floats::\n\n        1 1.2 1_000 0.123 .123_4\n\n- Booleans\n    The boolean values ``True`` and ``False`` are given using these variants::\n\n        True true yes\n        False false no\n\n- Strings\n    Single-line strings can be enclosed by single quotes (``'``), double\n    quotes (``\"``) or backticks (`````), and multiline strings are enclosed by\n    three of any of those:\n\n    .. code:: py\n\n        foo \"abc\"\n        bar 'def'\n        baz '''Hi,\n                did you know\n                    you're cute?\n                        '''\n\n\n..\n    Strings placed right next to each other are concatenated:\n\n    .. code:: py\n        \n        first = \"ABC\"\n        second = \"DEF\"\n        first_plus_second = \"ABC\"  \"DEF\"\n        concatenated = \"ABCDEF\"\n                    \n- Lists\n    Lists are enclosed by square brackets (``[]``).\n    Elements inside lists are separated by spaces, commas or line breaks:\n\n    .. code:: py\n\n        groceries [\n            \"bread\",\n            \"milk\" \"eggs\"\n            \"spam\"\n        ]\n\n- Mappings\n    Mappings are groups of key-value pairs enclosed by curly braces (``{}``).\n    Values may be any expression, even other mappings:\n\n    .. code:: py\n\n        me {\n            name \"Samantha\"\n            age 24\n            job \"Developer\"\n            favorite_things {\n                editor \"Vim\"\n                languages [\"Python\", \"Rust\"]\n            }\n        }\n\n    Mappings may also take the form of dotted attribute lookups:\n\n    .. code:: py\n\n        outer.middle.inner yes  # == {'outer': {'middle': {'inner': True}}}\n\n- Comments\n    Single-line comments are made using the ``#`` symbol:\n\n    .. code:: py\n\n        option = \"The parser reads this.\"\n        # But this is a comment.\n            #And so is this.\n        option2 = \"# But not this; It's inside a string.\"\n        # The parser ignores everything between ``#`` and the end of the line.\n         #   ignore = \"Comment out any lines of code you want to skip.\"\n\n\nUsage\n======\nOnce you install **Scuff**, you can then import ``scuff`` as a Python module\nand use its tools:\n\n.. code:: py\n\n    >>> import scuff\n    >>> scuff.convert_file('file.conf')\n    ...\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A config file format and transpiler suite written in Python.",
    "version": "0.3",
    "project_urls": {
        "GitHub: repo": "https://github.com/akyuute/scuff",
        "Homepage": "https://github.com/akyuute/scuff"
    },
    "split_keywords": [
        "parsing",
        "compilers",
        "api",
        "ast"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8365434cad44e44ae1f852937ae9599a606989d3ef426bb3037fc0b1b0f33f34",
                "md5": "3a337f45688fa6ad052a3175a3523f59",
                "sha256": "8c630b6904ea60b89be5cda23eea484fed96807089b0334da578581f76eeb617"
            },
            "downloads": -1,
            "filename": "scuff-0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a337f45688fa6ad052a3175a3523f59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 21646,
            "upload_time": "2024-01-02T00:36:05",
            "upload_time_iso_8601": "2024-01-02T00:36:05.952080Z",
            "url": "https://files.pythonhosted.org/packages/83/65/434cad44e44ae1f852937ae9599a606989d3ef426bb3037fc0b1b0f33f34/scuff-0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61e6eb5823accdf34dad2c67cea38e364d21862d9044129935d0c12a5f93d4fe",
                "md5": "2b57209e47ea86942424f18cb2c374b5",
                "sha256": "7816a6ab80b5833fea502193020c8a21b86e706a018a8a9eb3c89f4da1c9ac83"
            },
            "downloads": -1,
            "filename": "scuff-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2b57209e47ea86942424f18cb2c374b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 20558,
            "upload_time": "2024-01-02T00:36:07",
            "upload_time_iso_8601": "2024-01-02T00:36:07.577364Z",
            "url": "https://files.pythonhosted.org/packages/61/e6/eb5823accdf34dad2c67cea38e364d21862d9044129935d0c12a5f93d4fe/scuff-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-02 00:36:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "akyuute",
    "github_project": "scuff",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "scuff"
}
        
Elapsed time: 0.15666s