turtlefmt


Nameturtlefmt JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryAuto-formatter for RDF Turtle
upload_time2024-01-11 14:20:39
maintainer
docs_urlNone
authorTpt <thomas@pellissier-tanon.fr>
requires_python
licenseApache-2.0
keywords turtle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TurtleFmt

`turtlefmt` is an auto formatter for [RDF Turtle](https://www.w3.org/TR/turtle/) under Apache 2 license.


## Installation

It is currently distributed on:
- [Crates.io](https://crates.io/crates/turtlefmt): `cargo install turtlefmt`
- [Pypi](https://pypi.org/project/turtlefmt): `pipx install turtlefmt`

Build from source requires NodeJS 6.0+ to be available in your `PATH`.


## Usage

To use it:

```sh
turtlefmt MY_TURTLE_FILE.ttl
```

It is also possible to check if formatting of a given file is valid according to the formatter using:

```sh
turtlefmt --check MY_TURTLE_FILE.ttl
```

If the formatting is not valid, a patch to properly format the file is written to the standard output.

It is also possible to check a complete directory (and its subdirectories):

```sh
turtlefmt MY_DIR
```

## Format

`turtlefmt` is in development and its output format is not stable yet.

Example:
```turtle
@prefix ex: <http://example.com/> . # Prefix
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# Some facts

<s> a ex:Foo ;
    <p> "foo"@en , ( +01 +1.0 1.0e0 ) . # Foo

# An anonymous blank node
[ ex:p ex:o , ex:o2 ; ex:p2 ex:o3 ] ex:p3 true . # Bar
```

For now, it:
* Validates that the file is valid.
* Maintains consistent indentation and line jumps.
* Normalises string and IRI escapes to reduce their number as much as possible.
* Enforces the use of `"` instead of `'` in literals.
* Uses literals short notation for booleans, integers, decimals and doubles when it keeps the lexical representation unchanged.
* Uses `a` for `rdf:type` where possible.


## License

Copyright 2022 Helsing GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "turtlefmt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Turtle",
    "author": "Tpt <thomas@pellissier-tanon.fr>",
    "author_email": "Tpt <thomas@pellissier-tanon.fr>",
    "download_url": "https://files.pythonhosted.org/packages/14/ab/b306aa6ed9ecd6fa37416a4a72a30460190384cf4929e0634c6a3c5159ee/turtlefmt-0.1.1.tar.gz",
    "platform": null,
    "description": "# TurtleFmt\n\n`turtlefmt` is an auto formatter for [RDF Turtle](https://www.w3.org/TR/turtle/) under Apache 2 license.\n\n\n## Installation\n\nIt is currently distributed on:\n- [Crates.io](https://crates.io/crates/turtlefmt): `cargo install turtlefmt`\n- [Pypi](https://pypi.org/project/turtlefmt): `pipx install turtlefmt`\n\nBuild from source requires NodeJS 6.0+ to be available in your `PATH`.\n\n\n## Usage\n\nTo use it:\n\n```sh\nturtlefmt MY_TURTLE_FILE.ttl\n```\n\nIt is also possible to check if formatting of a given file is valid according to the formatter using:\n\n```sh\nturtlefmt --check MY_TURTLE_FILE.ttl\n```\n\nIf the formatting is not valid, a patch to properly format the file is written to the standard output.\n\nIt is also possible to check a complete directory (and its subdirectories):\n\n```sh\nturtlefmt MY_DIR\n```\n\n## Format\n\n`turtlefmt` is in development and its output format is not stable yet.\n\nExample:\n```turtle\n@prefix ex: <http://example.com/> . # Prefix\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n# Some facts\n\n<s> a ex:Foo ;\n    <p> \"foo\"@en , ( +01 +1.0 1.0e0 ) . # Foo\n\n# An anonymous blank node\n[ ex:p ex:o , ex:o2 ; ex:p2 ex:o3 ] ex:p3 true . # Bar\n```\n\nFor now, it:\n* Validates that the file is valid.\n* Maintains consistent indentation and line jumps.\n* Normalises string and IRI escapes to reduce their number as much as possible.\n* Enforces the use of `\"` instead of `'` in literals.\n* Uses literals short notation for booleans, integers, decimals and doubles when it keeps the lexical representation unchanged.\n* Uses `a` for `rdf:type` where possible.\n\n\n## License\n\nCopyright 2022 Helsing GmbH\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.\nYou may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and limitations under the License.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Auto-formatter for RDF Turtle",
    "version": "0.1.1",
    "project_urls": {
        "Source": "https://github.com/helsing-ai/turtlefmt",
        "Tracker": "https://github.com/helsing-ai/turtlefmt/issues"
    },
    "split_keywords": [
        "turtle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b1bddf4e04820eb1d7b4727441702296a0c8aeb58f653db67c08d41fd22b59a",
                "md5": "5a1bd25dd16c7b8cb18776732ad0a8fb",
                "sha256": "a840e1a584075c0d98b29c3e9e5ab03a5c9cbc17e04e58822924df68b6991125"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5a1bd25dd16c7b8cb18776732ad0a8fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 579036,
            "upload_time": "2024-01-11T14:20:29",
            "upload_time_iso_8601": "2024-01-11T14:20:29.395022Z",
            "url": "https://files.pythonhosted.org/packages/2b/1b/ddf4e04820eb1d7b4727441702296a0c8aeb58f653db67c08d41fd22b59a/turtlefmt-0.1.1-py3-none-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4d99b80c66b245e29df3fde1e083aa27bd331c9ef9dc52c4695f5dcf6f4cbd1",
                "md5": "36bb31418c4c15f04417ad3daae02fde",
                "sha256": "85c82cec7029447f2f4aa7f3acf719ea7126d46395996d42760ce0758edc212b"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "36bb31418c4c15f04417ad3daae02fde",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 567463,
            "upload_time": "2024-01-11T14:20:30",
            "upload_time_iso_8601": "2024-01-11T14:20:30.749539Z",
            "url": "https://files.pythonhosted.org/packages/a4/d9/9b80c66b245e29df3fde1e083aa27bd331c9ef9dc52c4695f5dcf6f4cbd1/turtlefmt-0.1.1-py3-none-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "869b81a193c05ad2ff16e9bd186f7a50ab946d2090d792f127e001b0c1f756df",
                "md5": "f6899091146ab1fa89f64b07376170f6",
                "sha256": "96e783f9a62b8c0beea99df14c89a72ea16a17681b3d341b806bc83d99fdae91"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "f6899091146ab1fa89f64b07376170f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1400275,
            "upload_time": "2024-01-11T14:20:32",
            "upload_time_iso_8601": "2024-01-11T14:20:32.107470Z",
            "url": "https://files.pythonhosted.org/packages/86/9b/81a193c05ad2ff16e9bd186f7a50ab946d2090d792f127e001b0c1f756df/turtlefmt-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfe87b9218a208dae8595308b35e2f0da77f8e91c1ae07f90934b5535609910a",
                "md5": "e2043fde98ca00cc91cac7450632b78b",
                "sha256": "666dde740d2f695b94f356ac852f9e3c505dd5d59caf46bf7f701319ce14f58e"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "e2043fde98ca00cc91cac7450632b78b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1413897,
            "upload_time": "2024-01-11T14:20:34",
            "upload_time_iso_8601": "2024-01-11T14:20:34.171846Z",
            "url": "https://files.pythonhosted.org/packages/bf/e8/7b9218a208dae8595308b35e2f0da77f8e91c1ae07f90934b5535609910a/turtlefmt-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60561f27e5411eca00c7512503f990e3ceec2356e440b7566f56d709196f044c",
                "md5": "eea9ee8447deed6463fcbb217e995f47",
                "sha256": "26ad0385fd04d6a2aa54989f9bfa6aec42d51e71d56b52d1b570ff4476c2c63b"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "eea9ee8447deed6463fcbb217e995f47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1500292,
            "upload_time": "2024-01-11T14:20:36",
            "upload_time_iso_8601": "2024-01-11T14:20:36.415405Z",
            "url": "https://files.pythonhosted.org/packages/60/56/1f27e5411eca00c7512503f990e3ceec2356e440b7566f56d709196f044c/turtlefmt-0.1.1-py3-none-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64beb1be72f3d1f19d26285dac2dfa9011ced87295a994be9bd1952991b395eb",
                "md5": "64381fa7c314cd7292e505fc1fe21aba",
                "sha256": "c92baf412b5871331a227769bc20ae1185a2165561f90c574e4876c464e9b3ec"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "64381fa7c314cd7292e505fc1fe21aba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 408531,
            "upload_time": "2024-01-11T14:20:38",
            "upload_time_iso_8601": "2024-01-11T14:20:38.281506Z",
            "url": "https://files.pythonhosted.org/packages/64/be/b1be72f3d1f19d26285dac2dfa9011ced87295a994be9bd1952991b395eb/turtlefmt-0.1.1-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14abb306aa6ed9ecd6fa37416a4a72a30460190384cf4929e0634c6a3c5159ee",
                "md5": "66f64d39c619df77c02bc3ee17cf4bb3",
                "sha256": "8d674ec6653f9cb352d8ab02c9438e548fc75bf863c89547d4fe966810c90272"
            },
            "downloads": -1,
            "filename": "turtlefmt-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "66f64d39c619df77c02bc3ee17cf4bb3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35141,
            "upload_time": "2024-01-11T14:20:39",
            "upload_time_iso_8601": "2024-01-11T14:20:39.309403Z",
            "url": "https://files.pythonhosted.org/packages/14/ab/b306aa6ed9ecd6fa37416a4a72a30460190384cf4929e0634c6a3c5159ee/turtlefmt-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 14:20:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "helsing-ai",
    "github_project": "turtlefmt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "turtlefmt"
}
        
Elapsed time: 0.16593s