Skip to main content

A Python library and tools for the Knora-API

Project description

PyPI version

knora-py

knora-py is a python package containing a command line tool for data model (ontology) creation, a library allowing creation of single resources and mass upload using the bulk import of data into the Knora framework.

The package consists of:

  • Knora Python modules for accessing Knora using the API (ontology creation, data import/export etc.)
  • knora-create-ontology A command line program to create an ontology out of a simple JSON description
  • knora-reset-triplestore A command line program to reset the content of the ontology. Does not require a restart of the Knora-Stack.

Go to Full Documentation

Install

To install the latest published version from PyPI, run:

$ pip3 install knora

To upgrade to the latest published version, run:

$ pip3 install --upgrade knora

Local Development Environment

Please consult the https://docs.dasch.swiss/developers documentation on how to install these prerequisites.

Makefile for repository management tasks

The project contains a Makefile defining management tasks. Please use make help to see what is available.

To install from source, i.e., this repository, run:

$ make install

Testing

$ make test

Publishing to PyPi

Generate distribution package. Make sure you have the latest versions of setuptools and wheel installed:

$ make upgrade
$ make dist

You can install the package locally from the dist:

$ python3 -m pip ./dist/some_name.whl

Upload package with twine,

first create ~/.pypirc:

[distutils] 
index-servers=pypi
[pypi] 
repository = https://upload.pypi.org/legacy/ 
username =your_username_on_pypi

then upload:

$ make upload

For local development:

$ python3 setup.py --editable .

Requirements

To install the requirements:

$ pip3 install -r requirements.txt

To generate a "requirements" file (usually requirements.txt), that you commit with your project, do:

$ pip3 freeze > requirements.txt

Running tests with Bazel

Run all tests:

$ bazel test //...

Run single test:

$ bazel test //test:test_knora

Project details


Download files

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

Files for knora, version 1.2.3
Filename, size File type Python version Upload date Hashes
Filename, size knora-1.2.3-py3-none-any.whl (47.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size knora-1.2.3.tar.gz (34.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page