Skip to main content

SADI for Python - Semantic Automated Discovery and Integration framework

Project description

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

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 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

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sadi-1.0.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sadi-1.0.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file sadi-1.0.0.tar.gz.

File metadata

  • Download URL: sadi-1.0.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for sadi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0914613170a0b819be89eb534c2327694be8404bb066442db4757b6404d1c339
MD5 b7cc673c654f34785e0f42f424bd4eba
BLAKE2b-256 5037523984b934477a330e013592167f6528678357f27b5852b62d09fca94168

See more details on using hashes here.

File details

Details for the file sadi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sadi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for sadi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f4aa495307d76a1d214407c5c6e2bb5c65a224616c97820a00ef0f63003e10a
MD5 5c18519dc3ba47be8abca7bb75ac15c5
BLAKE2b-256 a2538d1d0ed02c8e98d2518179e4bd0d718589d8d66e4e9860dfe6eeb3f53f1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page