Skip to main content

SADI Python

Python CI Python 3.8+ License: BSD

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

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 package
  • make install-dev - Install with development dependencies
  • make test - Run all tests
  • make lint - Run code linting
  • make format - Format code with black and isort
  • make build - Build package distributions
  • make 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 basestring usage to str
  • ✅ Comprehensive test coverage for compatibility

See PYTHON312_COMPATIBILITY.md for detailed information.

Testing Documentation

For comprehensive testing information, see TESTING.md.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add/update tests as needed
  5. Run the test suite: make test
  6. Submit a pull request

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Support

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)

Source distribution for sadi 1.0.0
File Size Uploaded
sadi-1.0.0.tar.gz 36.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sadi 1.0.0
File Interpreter ABI Platform
sadi-1.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

3 release files

0.5.4

4 release files

0.5.3

3 release files

0.5.2

2 release files

0.5.1

3 release files

0.5

3 release files

0.3

3 release files

0.2

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page