Skip to main content

Auto-formatter for RDF Turtle

Project description

TurtleFmt

turtlefmt is an auto formatter for RDF Turtle under Apache 2 license.

Installation

It is currently distributed on:

  • Crates.io: cargo install turtlefmt
  • Pypi: pipx install turtlefmt

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

Usage

To use it:

turtlefmt MY_TURTLE_FILE.ttl

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

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):

turtlefmt MY_DIR

Format

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

Example:

@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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

turtlefmt-0.1.2-py3-none-win_amd64.whl (410.3 kB view details)

Uploaded Python 3Windows x86-64

turtlefmt-0.1.2-py3-none-musllinux_1_2_x86_64.whl (637.4 kB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

turtlefmt-0.1.2-py3-none-manylinux_2_28_x86_64.whl (586.2 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

turtlefmt-0.1.2-py3-none-manylinux_2_28_aarch64.whl (573.0 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

turtlefmt-0.1.2-py3-none-macosx_11_0_arm64.whl (526.5 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

turtlefmt-0.1.2-py3-none-macosx_10_12_x86_64.whl (548.7 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file turtlefmt-0.1.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: turtlefmt-0.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 410.3 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for turtlefmt-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d7dce0b5bfd65f6f0c88181fb93495fb88f6925b64faffe5624b056203a964c9
MD5 1b43288bcad487b0a6ff6f96c3f18014
BLAKE2b-256 b0bb757cf2b71d4d7f483bc3b78ff118925dac609f1c5181e64e6f324fe01986

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-win_amd64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turtlefmt-0.1.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for turtlefmt-0.1.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8831390a8ba76805bf4e90b90519aede193fbc15967ca391809bead3355f1acd
MD5 104d8df40efd516214aa7bdb1fd96071
BLAKE2b-256 b2b27c53877a4bf94c2a514dcf12d33b61e896268864a000f3a14d64a3ded650

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-musllinux_1_2_x86_64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turtlefmt-0.1.2-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for turtlefmt-0.1.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b18fac19ae0d4286b6e47ee5749c0af48ed3d2e292b05102887cdf27ec7eb2d
MD5 d101eb11ebb7d866b06d258d57a51acf
BLAKE2b-256 9cc85570c7f0d3f1ebc5f11bf1f50f3065f962ea5ab50ed66061668932ba345e

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-manylinux_2_28_x86_64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turtlefmt-0.1.2-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for turtlefmt-0.1.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a7789bafe9442190547ccd95b2e166575e5b366be0cb9d6e5a044d4c07f153c1
MD5 313f771f147915629377ed7d501dc86a
BLAKE2b-256 53174633b52ea1a267c07f8c7561f04cf8b7ca2e6d66d2c045e401ff80a84eea

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-manylinux_2_28_aarch64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turtlefmt-0.1.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for turtlefmt-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f42f0961587058fc7969e6d415c33f2b1a5be6597cb254c0db455b28655484b6
MD5 c24c12e02d308a3217b9697e59ea2c36
BLAKE2b-256 58d527a9d782c688168f8c5406869c365849cb41807387cfd542f159b303adbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turtlefmt-0.1.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for turtlefmt-0.1.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 81b7741736422e3c49bfbbf3d0412822269659bb2310d7b1f49ee3b97d15bb37
MD5 05a54ae321e611a125487957e558e6c3
BLAKE2b-256 695dc4db5230fb407fd31521e434e554f3ad5060712ac18d2109d9e90d334d3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for turtlefmt-0.1.2-py3-none-macosx_10_12_x86_64.whl:

Publisher: build.yml on helsing-ai/turtlefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page