Skip to main content

Semantic Web and RDF library for Python

Project description

Quick Start

>>> from pymantic.rdf import *
>>> from pymantic.parsers import turtle_parser
>>> import requests
>>> Resource.prefixes['foaf'] = Prefix('http://xmlns.com/foaf/0.1/')
>>> graph = turtle_parser.parse(requests.get('https://raw.github.com/norcalrdf/pymantic/master/examples/foaf-bond.ttl').text)
>>> bond_james = Resource(graph, 'http://example.org/stuff/Bond')
>>> print("%s knows:" % (bond_james.get_scalar('foaf:name'),))
>>> for person in bond_james['foaf:knows']:
        print(person.get_scalar('foaf:name'))

Requirements

pymantic requires Python 3.6 or higher. lark is used for the Turtle and NTriples parser. The requests library is used for HTTP requests and the SPARQL client. lxml and rdflib are required by the SPARQL client as well.

Install

$ pip install pymantic

This will install pymantic and all its dependencies.

Documentation

Generating a local copy of the documentation requires Sphinx:

$ pip install Sphinx

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

pymantic-0.3.0.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

pymantic-0.3.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file pymantic-0.3.0.tar.gz.

File metadata

  • Download URL: pymantic-0.3.0.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for pymantic-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e5ba3ad4b5560dfe5355727003d51b90028bc2034f9b837dccf08f9dd2027051
MD5 6ff72de104c4c3a9c2e139738dd19617
BLAKE2b-256 0b68cc0803366f62829fc1e96746978add03c1d50850e4139668349c735542c4

See more details on using hashes here.

File details

Details for the file pymantic-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pymantic-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for pymantic-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01902bd7c938a40c50a2f16b995220407f6319ce6fe9e4400ed77ed8439ead5f
MD5 5607c2db967326f13543a87b8f0d837c
BLAKE2b-256 83b07e34e6594627aca26be03e67991a05c721178498a88ed0c189e22c87f769

See more details on using hashes here.

Supported by

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