Metadata-Version: 2.4
Name: pyrudof
Version: 0.3.22
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Requires-Dist: pyrudof[test,docs] ; extra == 'dev'
Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
Requires-Dist: sphinx~=8.0 ; extra == 'docs'
Requires-Dist: sphinxawesome-theme ; extra == 'docs'
Requires-Dist: sphinx-lint ; extra == 'docs'
Requires-Dist: tomli ; python_full_version < '3.11' and extra == 'docs'
Requires-Dist: pytest~=8.0 ; extra == 'test'
Requires-Dist: mypy~=1.0 ; extra == 'test'
Requires-Dist: tomli ; python_full_version < '3.11' and extra == 'test'
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: test
Summary: Semantic-less tool for the Semantic Web
Keywords: RDF,Semantic Web,Knowledge Graphs,Data Models,Data Validation,ShEx,SHACL,SPARQL,DCTAP,Property Graphs,PGSchema
Home-Page: https://rudof-project.github.io/rudof
Author: Jose Emilio Labra Gayo <labra@uniovi.es>, Samuel Bustamante Larriet <bustamantesamuel@uniovi.es>, Álvaro García Fernández <garciafalvaro@uniovi.es>, Ángel Iglesias Préstamo <angel.iglesias.prestamo@gmail.com>, Marc-Antoine Arnaud <marc-antoine.arnaud@luminvent.com>
Author-email: Jose Emilio Labra Gayo <labra@uniovi.es>, Samuel Bustamante Larriet <bustamantesamuel@uniovi.es>, Álvaro García Fernández <garciafalvaro@uniovi.es>, Ángel Iglesias Préstamo <angel.iglesias.prestamo@gmail.com>, Marc-Antoine Arnaud <marc-antoine.arnaud@luminvent.com>
License: MIT OR Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/rudof-project/rudof/blob/master/CHANGELOG.md
Project-URL: Documentation, https://rudof.readthedocs.io
Project-URL: Homepage, https://rudof-project.github.io/rudof
Project-URL: Repository, https://github.com/rudof-project/rudof

# pyrudof

`pyrudof` provides Python bindings for [rudof](https://rudof-project.github.io/rudof), a
Rust toolkit for the Semantic Web. It is a thin binding: every piece of Semantic Web logic
lives in the `rudof_lib` and `rudof_generate` crates, and this package's job is to move
values across the language boundary, turn Rust errors into Python exceptions, and present
the result as an API that feels like Python.

- [User documentation](https://pyrudof.readthedocs.io) - start here to *use* the library:
  API reference, guides and runnable examples.
- [Internals](https://rudof-project.github.io/rudof/internals/crates/python.html) -
  package layout and how the examples manifest drives both the
  tests and the documentation.

## Installation

Wheels are published on [PyPI](https://pypi.org/project/pyrudof/) and the package requires
Python 3.10 or newer:

```sh
pip install pyrudof
```

The wheels are `abi3-py310`, so a single wheel per platform serves every supported Python
version. The package has no Python runtime dependencies.

## Development

All commands below are run from `bindings/python/`. They are the same ones CI runs, in
`.github/workflows/python.yml`.

### Setting up

```sh
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\Activate.ps1

pip install -e '.[dev]'
```

`pip install -e` builds the extension through maturin, so the first run compiles the Rust
workspace and takes a while. Afterwards, rebuild just the extension with:

```sh
maturin develop                    # debug build, fast to compile
maturin develop --release          # optimised, what you want for benchmarks
```

### Testing

```sh
pytest                             # the whole suite
pytest -k shex                     # just the ShEx examples
pytest -x -q                       # stop at the first failure

mypy                               # strict type-check of python/, examples/ and tests/
```

### Regenerating what is generated

```sh
# 1. Type stubs, from the Rust annotations
cargo run --bin stub_gen --features stub-gen

# 2. The documentation's examples page, from examples.toml
python docs/generate_examples_doc.py --update
python docs/generate_examples_doc.py --check       # non-zero if stale
python docs/generate_examples_doc.py --dry-run     # preview without writing

# 3. The HTML documentation
python -m sphinx -b html docs docs/_build/html
```

`-W` to turn warnings into errors, and `-E` to force a full rebuild rather than an
incremental one:

```sh
python -m sphinx -b html -E -W docs docs/_build/html
python -m sphinxlint docs/*.rst
```

Then open `docs/_build/html/index.html`.

### Building wheels

```sh
maturin build --release            # wheel into target/wheels/
maturin sdist                      # source distribution
pip install --force-reinstall target/wheels/pyrudof-*.whl
```

