Skip to main content

Python-based linked data notification libraries

Project description

Version Build Status Coverage Status

This is an implementation of a python3-based Linked Data Notification sender and consumer.

Installing

pip install py-ldnlib

Adding an LDN sender to your code

A simple LDN Sender could be written as:

import ldnlib

sender = ldnlib.Sender()

inbox = sender.discover(target_resource)

if inbox is not None:
    sender.send(inbox, data)

The data value may be a string, a dictionary, a list or an rdflib-based Graph.

Adding an LDN consumer to your code

A simple LDN Consumer could be written as:

import ldnlib

consumer = ldnlib.Consumer()

inbox = consumer.discover(target_resource)

if inbox is not None:
    for iri in consumer.notifications(inbox):
        // fetch the notification as a Python dictionary
        notification = consumer.notification(iri)

Authentication

If the target-resource or inbox-resource requires authentication, an auth tuple may be supplied:

import ldnlib

sender = ldnlib.Sender()

inbox = sender.discover(target_resource, auth=(username, password))

if inbox is not None:
    sender.send(inbox, data, auth=(username, password))

Maintainer

Aaron Coburn

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 py-ldnlib, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size py_ldnlib-0.1.3-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size py-ldnlib-0.1.3.tar.gz (3.6 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