SADI Python
SADI (Semantic Automated Discovery and Integration) is a framework for creating semantic web services that consume and produce RDF data. This is the Python implementation of SADI.
Features
- 🐍 Python 3.8-3.12 Support: Fully compatible with modern Python versions
- 🔧 Easy Service Creation: Simple decorators and classes for creating SADI services
- 📊 RDF Processing: Built-in support for RDF data serialization and deserialization
- 🌐 Multiple Formats: Support for Turtle, RDF/XML, JSON-LD, and RDFa
- ⚡ Asynchronous Support: Built-in support for async service operations
- 🧪 Comprehensive Testing: Full test suite covering all SADI functionality
Installation
From PyPI (recommended)
pip install sadi
From Source
git clone https://github.com/jpmccu/sadi.git
cd sadi/python/sadi.python
pip install -e .
Quick Start
Creating a Simple SADI Service
from sadi import sadi
@sadi.service(
name="ExampleService",
description="An example SADI service",
inputClass="http://example.org/Input",
outputClass="http://example.org/Output"
)
def example_service(input_graph, output_graph):
# Process RDF data
for subject in input_graph.subjects():
output_graph.add((subject, URIRef("http://example.org/processed"), Literal("true")))
return output_graph
if __name__ == '__main__':
sadi.run(example_service)
Using SADI Client
from sadi.client import SADIClient
client = SADIClient()
result = client.call_service("http://example.org/service", input_data)
Testing
This package includes a comprehensive test suite covering all SADI functionality:
# Run all tests
python run_tests.py
# Run compatibility tests only (no dependencies required)
python test_compatibility.py
# Run with make (if available)
make test
Development
Setting up Development Environment
# Clone the repository
git clone https://github.com/jpmccu/sadi.git
cd sadi/python/sadi.python
# Install in development mode
pip install -e .[dev]
# Run tests
make test
# Format code
make format
# Check code quality
make lint
Available Make Commands
make install- Install packagemake install-dev- Install with development dependenciesmake test- Run all testsmake lint- Run code lintingmake format- Format code with black and isortmake build- Build package distributionsmake clean- Clean build artifacts
Python 3.12 Compatibility
This package has been updated for full Python 3.12 compatibility. Key changes include:
- ✅ Removed deprecated
buffer()function calls - ✅ Eliminated Python 2/3 compatibility libraries
- ✅ Updated
basestringusage tostr - ✅ Comprehensive test coverage for compatibility
See PYTHON312_COMPATIBILITY.md for detailed information.
Testing Documentation
For comprehensive testing information, see TESTING.md.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests as needed
- Run the test suite:
make test - Submit a pull request
License
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Support
- Python Versions: 3.8, 3.9, 3.10, 3.11, 3.12
- Documentation: SADI Documentation
- Issues: GitHub Issues
Links
Metadata
Release files for sadi 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sadi-1.0.0.tar.gz | 36.3 kB | Without provenance | Details for sadi-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sadi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sadi-1.0.0-py3-none-any.whl |
Total release size: 54.5 kB
Release files / sadi-1.0.0.tar.gz
| Download URL | sadi-1.0.0.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0914613170a0b819be89eb534c2327694be8404bb066442db4757b6404d1c339
|
|
BLAKE2b-256 checksum How to use checksums |
5037523984b934477a330e013592167f6528678357f27b5852b62d09fca94168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / sadi-1.0.0-py3-none-any.whl
| Download URL | sadi-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f4aa495307d76a1d214407c5c6e2bb5c65a224616c97820a00ef0f63003e10a
|
|
BLAKE2b-256 checksum How to use checksums |
a2538d1d0ed02c8e98d2518179e4bd0d718589d8d66e4e9860dfe6eeb3f53f1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for sadi 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.