Skip to main content

Semantic Web and RDF library for Python

Project description

Quick Start

>>> from __future__ import print_function
>>> 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 2.7 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.2.3.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

pymantic-0.2.3-py2.py3-none-any.whl (59.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pymantic-0.2.3.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for pymantic-0.2.3.tar.gz
Algorithm Hash digest
SHA256 e5304782f3dc5cdb5f32d9e525322ce2ff70d8ea1960f0d4408eaf4000430463
MD5 aedc3e62d8739882b7b228d6c22d7748
BLAKE2b-256 94d606c48f0f36a9da1abf4ae61e10c6e914320ff57d31ad4709e5858b8abd60

See more details on using hashes here.

File details

Details for the file pymantic-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pymantic-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 59.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for pymantic-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3afa9ab65cfff55375f060e3611727dcbcddbe42d018b7b319ad52d48e6b3b6e
MD5 17fe48d61346accfbc9d137e343d8375
BLAKE2b-256 5e8ac33cc26077ebe48aa651ca7ca959ae27d29014abaee066819e923f3e445e

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