Skip to main content

dsp-metadata-conversion

Python CLI for converting project metadata from JSON to RDF

Installation

Install the converter using pip.

pip install dsp-metadata-conversion

Usage

CLI

After installing using pip, a command line entrypoint is installed in your local python environment.

If using a virtual environment, the entry point will only be available when the environment is activated.

The entry point can be called with the command convert-metadata. This takes a required positional argument for the path of the file/directory to be converted. An optional flag -d marks the path as a directory which will be used for bulk conversion.

The script will read one or many JSON files, as specified in the path passed as the first argument, and convert it to three files: JSON-LD, Turtle and RDF-XML. These will be saved in the same directory as the JSON file is located. If the files already exist, they will be overwritten.

Help

Calling convert-metadata -h will show the program's help menu.

Example

To convert a single file, call

convert-metadata data/rosetta.json

To bulk convert all JSON files in a directory, call

convert-metadata data/ -d

In python scripts

After installing via pip, the package can be imported as converter.

Example usage:

# import the converter
from converter import converter

# read a JSON file
with open('data/rosetta.json', mode='r', encoding='utf-8') as f:
    json_data = f.read()

# convert JSON to a rdflib.Graph
graph = converter.convert_string(json_data, 'nope')

# print all subjects, predicates and objects in the graph
print("Graph:")
for s, p, o in graph:
    print(s, p, o)

Metadata

Release files for dsp-metadata-conversion 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dsp-metadata-conversion 1.0.3
File Size Uploaded Provenance Actions
dsp-metadata-conversion-1.0.3.tar.gz 10.2 kB Without provenance Details for dsp-metadata-conversion-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dsp-metadata-conversion 1.0.3
File Interpreter ABI Platform Actions
dsp_metadata_conversion-1.0.3-py3-none-any.whl Python 3 none any Details for dsp_metadata_conversion-1.0.3-py3-none-any.whl

Total release size: 21.1 kB

Release files / dsp-metadata-conversion-1.0.3.tar.gz

Download URL dsp-metadata-conversion-1.0.3.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a693ec6f59fc1369ed59f36e3c19fa2ee3621ce6f12d118e4eeb7a9dc370aa33
BLAKE2b-256 checksum
How to use checksums
9afa0ce67357264937e938115ca64b7a063338d935008f9dc0e2c4f02173eed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / dsp_metadata_conversion-1.0.3-py3-none-any.whl

Download URL dsp_metadata_conversion-1.0.3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c69970306fca295208dec62a35a7387678094cb900a12d4a8db0cdf359516c4c
BLAKE2b-256 checksum
How to use checksums
b438c6caba32564c26a10273bd1b7a45c3b1ff06410b653a78fceb47ceb030b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for dsp-metadata-conversion 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page