Python SDK for Nirmi Events API - No API keys needed, connects to your Nirmi backend
Project description
Nirmi Events SDK
A Python SDK for accessing Nirmi's event, place, and weather data services. This SDK connects to your Nirmi backend API, which manages all API keys - you don't need any API keys to use this SDK.
Installation
pip install nirmi-events-sdk
Or install from source:
git clone https://github.com/nirmi/nirmi-events-sdk.git
cd nirmi-events-sdk
pip install -e .
Quick Start
from nirmi_events_sdk import Client
from datetime import datetime, timedelta
# Initialize the client with your Nirmi backend URL
# The backend has all API keys - you don't need any!
client = Client(
api_base_url="https://api.nirmi.ai" # Your Nirmi backend URL
)
# Get events near a location
events = client.get_events(
latitude=41.3851, # Barcelona
longitude=2.1734,
radius_km=5,
start_time=datetime.now(),
end_time=datetime.now() + timedelta(days=7)
)
# Chat with AI concierge
response = client.chat(
message="What's happening tonight?",
latitude=41.3851,
longitude=2.1734
)
print(response["response"])
No API Keys Needed!
This SDK connects to your Nirmi backend API, which manages all API keys:
- ✅ Google Places API (managed by Nirmi)
- ✅ Ticketmaster API (managed by Nirmi)
- ✅ Eventbrite API (managed by Nirmi)
- ✅ OpenWeather API (managed by Nirmi)
- ✅ OpenAI API (managed by Nirmi)
You just need the URL of your Nirmi backend API.
Features
Events
- ✅ Eventbrite Integration: Fetch events from Eventbrite
- ✅ Ticketmaster Integration: Fetch events from Ticketmaster
- ✅ Location-based Search: Search events by coordinates and radius
- ✅ Date Filtering: Filter events by start/end time
- ✅ Automatic Deduplication: Events from multiple sources are automatically deduplicated
AI Concierge
- ✅ Natural Language Chat: Ask questions in natural language
- ✅ Context-aware: Understands location and conversation history
- ✅ Multi-source Integration: Combines events, places, and weather data
Usage Examples
Get Events
from nirmi_events_sdk import Client
from datetime import datetime, timedelta
client = Client(api_base_url="https://api.nirmi.ai")
# Get events in the next week
events = client.get_events(
latitude=41.3851,
longitude=2.1734,
start_time=datetime.now(),
end_time=datetime.now() + timedelta(days=7),
radius_km=10
)
for event in events:
print(f"{event['name']} at {event['venue_name']} - {event['start_time']}")
Chat with AI Concierge
# Simple query
response = client.chat(
message="What's happening tonight?",
latitude=41.3851,
longitude=2.1734
)
print(response["response"])
# With conversation history
conversation = [
{"user": "What restaurants are nearby?", "assistant": "Here are some great restaurants..."}
]
response = client.chat(
message="What about Italian restaurants?",
latitude=41.3851,
longitude=2.1734,
conversation_history=conversation
)
print(response["response"])
Configuration
Backend URL
Set your Nirmi backend URL:
client = Client(api_base_url="https://api.nirmi.ai")
For local development:
client = Client(api_base_url="http://localhost:8000")
Authentication (Optional)
If your backend requires authentication:
client = Client(
api_base_url="https://api.nirmi.ai",
api_key="your-api-key"
)
Response Formats
Events
Each event contains:
id: Event IDname: Event namedescription: Event descriptionstart_time: Formatted start timeend_time: Formatted end time (if available)url: Event URLvenue_name: Venue namevenue_address: Venue addressvenue_latitude: Venue latitudevenue_longitude: Venue longitudesource: Source ("eventbrite" or "ticketmaster")
Chat Response
{
"response": "AI-generated response text",
"context_used": {
"weather": {...},
"places_found": 5,
"events_found": 10
}
}
Error Handling
The SDK gracefully handles errors:
- If the backend is unavailable, returns empty results or error messages
- All errors are logged for debugging
- Network timeouts are handled with 30-second default timeout
Requirements
- Python 3.8+
- requests >= 2.28.0
- pydantic >= 2.6.0
Backend Setup
Your Nirmi backend should be running and accessible. The backend:
- Manages all API keys (Google, Ticketmaster, Eventbrite, OpenWeather, OpenAI)
- Provides
/eventsand/chatendpoints - Handles all third-party API calls
See the nirmi-concierge-demo for the backend implementation.
License
MIT License
Support
For issues and questions, please contact support@nirmi.ai
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
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 nirmi_events_sdk-1.3.1.tar.gz.
File metadata
- Download URL: nirmi_events_sdk-1.3.1.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d47dc9b7d08d7b24cb71d02d8be7f9fbcfd84b819f66253c1711375e5fcd472c
|
|
| MD5 |
8fc5dd51aae7d47bf70b05c8a4a90ed9
|
|
| BLAKE2b-256 |
91d1be916ec17a7b47ce1c1dfb07b0637ff84f7f3095d90494be54e8e08f0f5c
|
Provenance
The following attestation bundles were made for nirmi_events_sdk-1.3.1.tar.gz:
Publisher:
publish.yml on narmiAI/nirmi-events-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nirmi_events_sdk-1.3.1.tar.gz -
Subject digest:
d47dc9b7d08d7b24cb71d02d8be7f9fbcfd84b819f66253c1711375e5fcd472c - Sigstore transparency entry: 1066515957
- Sigstore integration time:
-
Permalink:
narmiAI/nirmi-events-sdk@07b9e75c4d25c6a654af194de4e4fbe28d42be12 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/narmiAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07b9e75c4d25c6a654af194de4e4fbe28d42be12 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nirmi_events_sdk-1.3.1-py3-none-any.whl.
File metadata
- Download URL: nirmi_events_sdk-1.3.1-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f83992281d2fc0abf9b76a1654a8b4b23ee52212b659179fe1130395b2c82a2
|
|
| MD5 |
13ba9b07a6021269d8b1bdcfea3f0b4b
|
|
| BLAKE2b-256 |
e88978397c2106fa640d567584cf41b663f05d09125cb319b6f49868c1d8163a
|
Provenance
The following attestation bundles were made for nirmi_events_sdk-1.3.1-py3-none-any.whl:
Publisher:
publish.yml on narmiAI/nirmi-events-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nirmi_events_sdk-1.3.1-py3-none-any.whl -
Subject digest:
9f83992281d2fc0abf9b76a1654a8b4b23ee52212b659179fe1130395b2c82a2 - Sigstore transparency entry: 1066515963
- Sigstore integration time:
-
Permalink:
narmiAI/nirmi-events-sdk@07b9e75c4d25c6a654af194de4e4fbe28d42be12 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/narmiAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07b9e75c4d25c6a654af194de4e4fbe28d42be12 -
Trigger Event:
release
-
Statement type: