pymantic
Semantic Web and RDF library for Python
Decision gist · record as of 2026-08-14
Yes, if you need RDF parsing and querying in Python. The library has low install friction, permissive licensing, and no known vulnerabilities. However, maintenance is aging (316 days since last release), so evaluate whether the project's pace suits your stability requirements. For active semantic web projects, verify that its SPARQL support and format coverage meet your specific needs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or higher.
- Low install friction; pure Python wheel with six runtime dependencies (requests, lxml, rdflib, lark, pytz, pyld).
- Maintenance status is aging—last release was 316 days ago and the repository shows 19 stars, though it remains unarchived and the last commit is recent.
License · maintenance · safety
BSD (permissive) — BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects that can accommodate attribution.
last release 2025-10-02 (316 days) · last repo commit 2025-10-02 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 130,882 downloads/mo, #11,621 on PyPI
Alternatives
Verify before relying
from pymantic.rdf import Resource, Prefix
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://example.org/data.ttl').text)
resource = Resource(graph, 'http://example.org/item')
name = resource.get_scalar('foaf:name')- Whether the aging maintenance status (316 days since last release) affects stability or security for production use.
- Performance characteristics when working with large RDF graphs or high-volume SPARQL queries.
- Completeness of SPARQL 1.1 support and any known limitations in query dialect coverage.
What it is and what it does
Pymantic is a Python library for working with RDF (Resource Description Framework) and semantic web data. It provides parsers for Turtle, N-Triples, and N3 formats, allowing you to load RDF graphs from files or HTTP sources and query them using a Python API. It also includes a SPARQL client for querying remote RDF endpoints.
The library is built on top of rdflib and uses lark for parsing, requests for HTTP access, and pyld for linked-data operations. It's intended for developers working with linked data, knowledge graphs, or semantic web applications who need to parse, manipulate, and query RDF data programmatically in Python.
Use it for
- Parse Turtle or N-Triples files and query the resulting RDF graph using Python objects and methods.
- Fetch and process RDF data from remote HTTP sources or SPARQL endpoints.
- Build knowledge graph applications that need to work with linked data and semantic relationships.
- Extract scalar values and relationships from RDF resources using prefix-qualified property names.
- Integrate RDF data processing into Python applications without writing raw SPARQL queries.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need RDF parsing and querying in Python.
The library has low install friction, permissive licensing, and no known vulnerabilities. However, maintenance is aging (316 days since last release), so evaluate whether the project's pace suits your stability requirements. For active semantic web projects, verify that its SPARQL support and format coverage meet your specific needs.
Install
pymantic on PyPI
Before you install
Low install friction; pure Python wheel with six runtime dependencies (requests, lxml, rdflib, lark, pytz, pyld). Maintenance status is aging—last release was 316 days ago and the repository shows 19 stars, though it remains unarchived and the last commit is recent.
Requires Python 3.9 or higher.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects that can accommodate attribution.
Quickstart
from pymantic.rdf import Resource, Prefix
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://example.org/data.ttl').text)
resource = Resource(graph, 'http://example.org/item')
name = resource.get_scalar('foaf:name')
Verify before relying
- Whether the aging maintenance status (316 days since last release) affects stability or security for production use.
- Performance characteristics when working with large RDF graphs or high-volume SPARQL queries.
- Completeness of SPARQL 1.1 support and any known limitations in query dialect coverage.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesrequestslxmlpytzrdfliblarkpyld |
| Maintenance | Aging 316 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 130,882 / month, #11,621 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Scientific/Engineering :: Information AnalysisTopic :: Text Processing :: Markup |
Evidence: pymantic-1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “RDF parsing and querying”
- pymanticPymantic parses and queries RDF and semantic web data formats…
- rdflibRDFLib is a Python library for parsing, querying, and serializing RDF…
- sparqlslurperTranslates rdflib Graph.triples() calls into SPARQL queries and…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also pystardog · rdflib · pyoxigraph · SPARQLWrapper · sparqlslurper · PyShEx · pyshacl · CFGraph · owlready2 · semanticscholar