--- id: pymantic version: "1.0.1" license: BSD license_treatment: permissive maintenance: aging --- # pymantic — Semantic Web and RDF library for Python License: permissive · Maintenance: aging · Downloads: 130.9K/mo ## 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 above — verify before relying. Pymantic parses and queries RDF and semantic web data formats (Turtle, N-Triples, N3) and provides a Python API to work with RDF graphs and SPARQL endpoints. 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 pip install pymantic uv add pymantic poetry add pymantic ## Installing pymantic 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. 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') Requires Python 3.9 or higher. 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: unspecified - Install friction: low - Maintenance: aging - Downloads: 130.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags RDF parsing and querying, semantic web library, turtle parser python, SPARQL client, RDF graph manipulation, linked data processing, N-Triples parser, rdf-semantic-web, linked-data, sparql [View on SkillFed](https://skillfed.io/packages/pymantic) · [View on PyPI](https://pypi.org/project/pymantic/)