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.9 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-1.0.0.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

pymantic-1.0.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymantic-1.0.0.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pymantic-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7d3fe378859fd869cf6fe40e7efee664e1e1075a6f009dfecfe70d25867f6e8a
MD5 45c9c5172a22959c04081be3add89df6
BLAKE2b-256 5381d4c6b98f1808f962861325a73f78914d572d82a9a11a965ed161a0e63633

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymantic-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pymantic-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a736f1c027ac76fbb39d4725ad9e96e961ea6e80b1af5d52a79584e863964bf2
MD5 760f201e63b45fec9fc7c486f6ba7f7a
BLAKE2b-256 afc90aedaf06024a69507b1a47deb73104dc6c12de8bda8bac8427fbe8be178c

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