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 UUIDfilename: Document filenamesharepoint_link: Direct link to documentsharepoint_folder_link: Link to containing foldershort_summary: Brief document summarysummary: Full detailed summarydoc_type: Document type (e.g., "pdf")tunnel: Tunnel name (e.g., "Noordtunnel")tunnel_object: Specific tunnel object/componentNEN_tag: NEN2767 classificationdate: Document date
NENTagResponse
main_category: Main NEN classificationsubcategory: 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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3418b99f257993797202ff32cc0992338e1a6db6c69e6b500f6a8a030fab7fd8
|
|
| MD5 |
9f365ebef45016784b5db9fb83dd13a6
|
|
| BLAKE2b-256 |
a439bb50ce4d47fc6f1262dcf069c3fc76f118037ca2252553bb7a97693191b8
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a709118ee53c5a298e345021dcf63b388eb5bf9dd0a49925626ecf44d98f60b
|
|
| MD5 |
a4b3827edaec6b0477fb60346a5794da
|
|
| BLAKE2b-256 |
c85044bd49f0e3e6545f64cff52840a39b3c8f2045b990dd8b0e1da9891e64d2
|