Metadata-Version: 2.4
Name: lighthouse-private-markets-sdk
Version: 0.1.1
Summary: Python SDK for Lighthouse Private Markets API with PostgREST-style querying
Project-URL: Homepage, https://github.com/lighthouse-app/lighthouse-private-markets-sdk
Project-URL: Repository, https://github.com/lighthouse-app/lighthouse-private-markets-sdk.git
Author-email: Your Name <your.email@example.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Requires-Dist: httpx
Requires-Dist: postgrest
Requires-Dist: pydantic
Requires-Dist: requests
Description-Content-Type: text/markdown

# Lighthouse API Client (Python)

Simple and powerful Python client for interacting with the Lighthouse API. Perfect for managing and analyzing your startup's data.

## Features

- 🚀 Easy to use API
- 📦 Built on Supabase
- 💪 Python support
- ⚡ Lightweight

## Installation

### Using pip:
```bash
pip install lighthouse-private-markets-sdk
```

## Quick Start

### Importing and Initialization
```python
from lighthouse import Lighthouse

# Initialize the client
lighthouse = Lighthouse('your-api-key')
```

### Fetching Startups
```python
def get_startups():
    try:
        response = lighthouse.from_('startups').select('*').limit(10).execute()
        if response.error:
            raise Exception(response.error)
        print("Startups:", response.data)
    except Exception as err:
        print("Error:", err)

get_startups()
```

## Common Query Examples

### Select Single Record
```python
# Get a specific startup
response = lighthouse.from_('startups').select('*').eq('id', 123).single().execute()
```

### Filter Records
```python
# Get all startups valued over $1M
response = lighthouse.from_('startups').select('name, valuation').gte('valuation', 1000000).order('valuation', ascending=False).execute()
```

### Select with Relationships
```python
# Get startups with their founders
response = lighthouse.from_('startups').select('name, founders (name, role)').execute()
```

### Pagination
```python
# Get 10 records with offset
response = lighthouse.from_('startups').select('*').range(0, 9).execute()
```

### Full Text Search
```python
# Search startups by name
response = lighthouse.from_('startups').select('*').text_search('name', 'tech').execute()
```

## API Reference

### Initialization Options
```python
lighthouse = Lighthouse('your-api-key', url='https://your-custom-url.com')  # Optional
```

### Available Methods

- `select()`: Choose fields to return
- `single()`: Return a single record
- `eq()`: Equal to
- `neq()`: Not equal to
- `gt()`: Greater than
- `gte()`: Greater than or equal to
- `lt()`: Less than
- `lte()`: Less than or equal to
- `like()`: Pattern matching
- `ilike()`: Case insensitive pattern matching
- `in_()`: In array
- `order()`: Order results
- `limit()`: Limit number of records
- `range()`: Select range of records

## Error Handling
```python
response = lighthouse.from_('startups').select('*').execute()
if response.error:
    if response.error.code == 'PGRST116':
        print('Invalid API key')
    elif response.error.code == '42P01':
        print('Table does not exist')
    else:
        print('An error occurred:', response.error)
    exit()

# Process your data
print(response.data)
```

## Best Practices

1. Always check for errors before using data
2. Use try/except blocks for error handling
3. Limit your selections to required fields only
4. Use pagination for large datasets
5. Cache results when appropriate

## Support

- 📧 Email: hello@trylighthouse.vc

## License

MIT License - see the [LICENSE](LICENSE) file for details.

