Skip to main content

Python client for the COB SharePoint search

Project description

COB AI

Python client for the COB SharePoint search API.

Installation

pip install cob-ai

Usage

Basic Search

from cob_ai import COB

# Initialize the client (uses COB_APIKEY environment variable)
client = COB()

# Basic search
results = client.search("your search query")
print(results)

Advanced Search Options

# Search with custom parameters
results = client.search(
    question="prefab wandelementen in de noordtunnel",
    top_n=10,                    # Number of results (default: 8)
    sort="newest_first",         # Sort by date: "newest_first" or "oldest_first"
    show_full_summary=True       # Show both short and full summaries
)

# Access individual results
for result in results.results:
    print(f"Document: {result.filename}")
    print(f"Tunnel: {result.tunnel}")
    print(f"Short summary: {result.short_summary}")
    print(f"Full summary: {result.summary}")
    print(f"NEN Tag: {result.NEN_tag}")
    print(f"Date: {result.date}")

Search Results Format

The search results display includes:

  • 📄 Document filename
  • Tunnel information, document type, and date
  • 📝 Document summary (short or both short + full)
  • NEN2767 classification tags
  • 📄 Document bekijken | 📁 Map openen (clickable links)

Sync Operations

# Start a sync and wait for completion
client.start_sync(wait_for_completion=True)

# Start sync in background
client.start_sync(wait_for_completion=False)

# Check sync status
status = client.status()
print(status)

# Legacy sync method (backward compatibility)
client.sync(wait=True)

Configuration

Configure using environment variables:

  • COB_APIKEY: Your API key for authentication

Or pass directly to the client:

client = COB(apikey="your-api-key", apiurl="https://custom-api-url.com")

Data Models

SearchResult

  • doc_id: Document UUID
  • filename: Document filename
  • sharepoint_link: Direct link to document
  • sharepoint_folder_link: Link to containing folder
  • short_summary: Brief document summary
  • summary: Full detailed summary
  • doc_type: Document type (e.g., "pdf")
  • tunnel: Tunnel name (e.g., "Noordtunnel")
  • tunnel_object: Specific tunnel object/component
  • NEN_tag: NEN2767 classification
  • date: Document date

NENTagResponse

  • main_category: Main NEN classification
  • subcategory: Optional subcategory

Requirements

  • Python 3.8+
  • requests >= 2.25.0
  • attrs >= 23.1.0
  • python-dotenv

License

MIT License

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

cob_ai-0.1.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

cob_ai-0.1.5-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file cob_ai-0.1.5.tar.gz.

File metadata

  • Download URL: cob_ai-0.1.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cob_ai-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3418b99f257993797202ff32cc0992338e1a6db6c69e6b500f6a8a030fab7fd8
MD5 9f365ebef45016784b5db9fb83dd13a6
BLAKE2b-256 a439bb50ce4d47fc6f1262dcf069c3fc76f118037ca2252553bb7a97693191b8

See more details on using hashes here.

File details

Details for the file cob_ai-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cob_ai-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cob_ai-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9a709118ee53c5a298e345021dcf63b388eb5bf9dd0a49925626ecf44d98f60b
MD5 a4b3827edaec6b0477fb60346a5794da
BLAKE2b-256 c85044bd49f0e3e6545f64cff52840a39b3c8f2045b990dd8b0e1da9891e64d2

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