Skip to main content

SOLI Python Library

SOLI Logo

PyPI version License: MIT Python Versions

The SOLI Python Library provides a simple and efficient way to interact with the Standard for Open Legal Information (SOLI) ontology.

SOLI is an open, CC-BY licensed standard designed to represent universal elements of legal data, improving communication and data interoperability across the legal industry.

Features

  • Load the SOLI ontology from GitHub or a custom HTTP URL
  • Search for classes by label or definition
  • Get subclasses and parent classes
  • Access detailed information about each class, including labels, definitions, and examples
  • Convert classes to OWL XML or Markdown format

Changelog

The changelog can be found at CHANGES.md.

Installation

You can install the SOLI Python library using pip:

pip install soli-python

For the latest development version, you can install directly from GitHub:

pip install --upgrade https://github.com/alea-institute/soli-python/archive/refs/heads/main.zip

Quick Start

Here's a simple example to get you started with the SOLI Python library:

from soli import SOLI

# Initialize the SOLI client
soli = SOLI()

# Search by prefix
results = soli.search_by_prefix("Mich")
for owl_class in results:
    print(f"Class: {owl_class.label}")

# Search for a class by label
results = soli.search_by_label("Mich")
for owl_class, score in results:
    print(f"Class: {owl_class.label}, Score: {score}")

# Get all areas of law
areas_of_law = soli.get_areas_of_law()
for area in areas_of_law:
    print(area.label)

Searching with an LLM

# Search with an LLM
async def search_example():
    for result in await soli.parallel_search_by_llm(
        "redline lease agreement",
        search_sets=[
            soli.get_areas_of_law(max_depth=1),
            soli.get_player_actors(max_depth=2),
        ],
    ):
        print(result)

import asyncio
asyncio.run(search_example())

LLM search uses the alea_llm_client to provide abstraction across multiple APIs and providers.

Documentation

For more detailed information about using the SOLI Python library, please refer to our full documentation.

Contributing

We welcome contributions to the SOLI Python library! If you'd like to contribute, please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Make your changes and write tests if applicable
  4. Run the test suite to ensure everything is working
  5. Submit a pull request with a clear description of your changes

For more information, see our contribution guidelines.

SOLI API

A public, freely-accessible API is available for the SOLI ontology.

The API is hosted at https://soli.openlegalstandard.org/.

The source code for the API is available on GitHub at https://github.com/alea-institute/soli-api.

License

The SOLI Python library is released under the MIT License. See the LICENSE file for details.

Support

If you encounter any issues or have questions about using the SOLI Python library, please open an issue on GitHub.

Learn More

To learn more about SOLI, its development, and how you can get involved, visit the SOLI website or join the SOLI community forum.

Metadata

Release files for soli-python 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soli-python 0.1.5
File Size Uploaded
soli_python-0.1.5.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soli-python 0.1.5
File Interpreter ABI Platform
soli_python-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 43.5 kB

Release files / soli_python-0.1.5.tar.gz

Download URL soli_python-0.1.5.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
68661b82e667bc8a419605950b08ecb59c6399efa2dcca4dc52c48add18cbc6a
BLAKE2b-256 checksum
How to use checksums
071a4bffa19ce1adcf4bb879df78c2c65611255d1ee5791d41715b12fc7da2d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-47-generic

Release files / soli_python-0.1.5-py3-none-any.whl

Download URL soli_python-0.1.5-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
559bb290862b7f6ee2033099bb76a0cab620b8257ab4efcbd747054f16328d92
BLAKE2b-256 checksum
How to use checksums
25729d869bd16046b6c9631b4845312bab3c43652f31ba96d157d2cb4c1e304c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-47-generic

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 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