Skip to main content

A Python package of RDF data manipulation functions that can be called from the command line or other software

Project description

Kurra

A Python package of RDF data manipulation and data management functions that can be called from the command line or other software.

This library uses the RDFLib under-the-hood to process RDF data. It supplies functions to:

  • manipulate local RDF files
  • send commands to RDF databases "triplestores"
  • SPARQL query files or databases

kurra is for convenience: the functions it provides are simple but kurra saves you having to reinvent wheels.

CLI app

kurra presents a Command Line Interface that can be used on Mac, Linux and Windows (WSL) command prompts.

The hierarchy of functions provided is:

  • db - run commands against RDF databases
    • list
    • create
    • upload
    • clear
    • delete
    • sparql
  • file - run commands on local RDF files
    • format
    • upload
    • quads
    • sparql
  • shacl
    • validate - SHACL validate a file
  • sparql - SPARQL query files or databases

Once you have installed kurra (see below), you can ask it to tell you what each command does and what inputs are needed by using the --help or just -h, command, e.g.:

kurra -h

which will return something like:

╭─ Options ─────────────────────────────────────────────────────────────────────────────────╮
│ --version             -v                                                                  │
│ --help                -h        Show this message and exit.                               │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────╮
│ db       RDF database commands                                                            │
│ file     RDF file commands                                                                │
│ shacl    SHACL commands                                                                   │
│ sparql   SPARQL queries to local RDF files or a database                                  │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

To find out more about the specific options within db, file, shacl & sparql, run the help command at the next level, like this:

kurra db -h

or

kurra file -h

etc. for shacl & sparql

To get further help for the particular commands. For db, you will see something like this:

 Usage: kurra db [OPTIONS] COMMAND [ARGS]...
                                
 RDF database commands. Currently only Fuseki is supported 
 
╭─ Options ─────────────────────────────────────────────────────────────────────────╮
│ --help  -h        Show this message and exit.                                     │
╰───────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────╮
│ list     Get the list of database repositories                                    │
│ create   Create a new database repository. Provide either the dataset name and... │
│ upload   Upload file(s) to a database repository                                  │
│ clear    Clear a database repository                                              │
│ delete   Delete a database repository                                             │
│ sparql   Query a database repository                                              │
╰───────────────────────────────────────────────────────────────────────────────────╯

Installation

CLI App

The recommended way to manage and run Python CLI apps is to use the Python package uv which you will need to install first, see the uv installation instructions. then:

uv tool install kurra

Now you can invoke kurra anywhere in your terminal as long as ~/.local/bin is in your PATH.

See the uv documentation on installing tools for more information.

Library

You can also install kurra as a Python library for used of its functions in other applications

pip install kurra

Use the relevant command to add dependencies to your project if you are using a tool like uv, poetry, or conda.

Then import it and use in your code, e.g. for the format functions:

from kurra.file import format_file, make_dataset, export_quads

Development

Install the Poetry project and its dependencies:

task install

Format code:

task code

To build a new release:

  1. format all code: task code
  2. test: task test
  3. update the version in pyproject.toml
  4. commit & push all changes
  5. git tag with the same version number
  6. push the tag - git push --tags
  7. build the release - uv build
  8. publish the release on PyPI - uv publish -u __token__ -p {TOKEN}, {TOKEN} is an actual token
  9. make the release on GitHub - https://github.com/Kurrawong/kurra/releases
  • don't forget to add the dist zips & wheels to it
  1. update version number in pyproject.toml to next alpha & push

License

BSD-3-Clause license. See LICENSE.

Contact & Support

kurra is maintained by:

KurrawongAI
http://kurrawong.ai
info@kurrawong.ai

Please contact them for all use & support issues.

You can also log issues at the kurra issue tracker:

Release Procedure

  • update version in pyproject.toml
  • commit all updates
  • tag with version
  • uv build
  • uv publish -u __token__ -p {TOKEN}

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

kurra-2.0.1.tar.gz (113.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kurra-2.0.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file kurra-2.0.1.tar.gz.

File metadata

  • Download URL: kurra-2.0.1.tar.gz
  • Upload date:
  • Size: 113.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.1

File hashes

Hashes for kurra-2.0.1.tar.gz
Algorithm Hash digest
SHA256 f2d3283e305357d1388c78bdbc20fe49e305398b1f5bfc28aaf14a56528401e5
MD5 1c3d687f42317f56d6538b5354cc5f92
BLAKE2b-256 c751320b6fea5fe3894631fc683e452a6ca4ee17df051a853558ee0e0ae8d41d

See more details on using hashes here.

File details

Details for the file kurra-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: kurra-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.1

File hashes

Hashes for kurra-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7543c157c1cd6ede428adb2c865ad6774a4830dda4da8c193e1eec343027c19e
MD5 80e6f5c83cbae457277ad4a9df7e627a
BLAKE2b-256 9b6f150d7b8ac50e66dc16f02d8294a142215393511c91973c31ef89a2009783

See more details on using hashes here.

Supported by

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