Metadata-Version: 2.4
Name: cob-ai
Version: 0.1.5
Summary: Python client for the COB SharePoint search
Author-email: Lennart Timmermans <lennart@vondr.ai>
License: MIT License
        
        Copyright (c) 2025 vondr
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/vondr/cob-ai
Project-URL: Repository, https://github.com/vondr/cob-ai
Project-URL: Issues, https://github.com/vondr/cob-ai/issues
Keywords: sharepoint,search,api,client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs>=23.1.0
Requires-Dist: requests>=2.25.0
Requires-Dist: dotenv<0.10.0,>=0.9.9
Requires-Dist: build<2.0.0,>=1.3.0
Requires-Dist: twine<7.0.0,>=6.2.0
Dynamic: license-file

# COB AI

Python client for the COB SharePoint search API.

## Installation

```bash
pip install cob-ai
```

## Usage

### Basic Search

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

```python
# 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

```python
# 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:

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