Official Python client library for Summize.app
Get started with the Python SDK
pip install summize
Install from PyPI using pip.
conda install -c conda-forge summize
Install from conda-forge channel.
Get up and running in minutes
import summize
# Initialize with your API key
client = summize.Client('your-api-key')
# Generate a summary
result = client.summarize(
data=sales_data,
format='narrative',
style='executive'
)
print(result.summary)
Complete documentation of all methods and options
client = summize.Client('your-api-key', timeout=30)
api_key
(str) - Your Summize API keytimeout
(int) - Request timeout in secondsbase_url
(str) - Custom API base URLretries
(int) - Number of retry attemptsapi_key
- Your API keytimeout
- Request timeoutbase_url
- API base URLGenerate AI-powered summaries from your data
result = client.summarize(
data=sales_data,
format='narrative',
style='executive',
max_length=500
)
data
- Your data to summarizeformat
- 'narrative' | 'bullet' | 'executive'style
- 'technical' | 'business' | 'casual'max_length
- Maximum summary lengthsummary
- Generated summary textinsights
- List of key insightsconfidence
- Confidence score (0-1)processing_time
- Processing time in secondsRetrieve generated reports and summaries
reports = client.get_reports(
limit=10,
offset=0,
status='completed'
)
limit
- Number of reports to returnoffset
- Pagination offsetstatus
- Filter by statusreports
- List of report objectstotal
- Total number of reportshas_more
- Whether more reports existCommon use cases and patterns
import pandas as pd
import summize
# Load your data
df = pd.read_csv('sales_data.csv')
# Convert to dict for summarization
data = {
'total_sales': df['sales'].sum(),
'avg_order': df['sales'].mean(),
'top_products': df.groupby('product')['sales'].sum().nlargest(5).to_dict()
}
# Generate summary
result = client.summarize(data, format='executive')
print(result.summary)
from summize import SummizeError
try:
result = client.summarize(data)
print(result.summary)
except SummizeError as e:
if e.code == 'RATE_LIMIT':
print('Rate limit exceeded')
elif e.code == 'INVALID_API_KEY':
print('Invalid API key')
else:
print(f'Error: {e.message}')
except Exception as e:
print(f'Unexpected error: {e}')
Perfect for Jupyter notebooks and data analysis workflows
# In your Jupyter notebook
import summize
import matplotlib.pyplot as plt
# Analyze sales data
sales_summary = client.summarize(sales_data)
print("📊 Sales Summary:")
print(sales_summary.summary)
# Get insights
for insight in sales_summary.insights:
print(f"💡 {insight}")
# Process multiple datasets
datasets = [sales_data, marketing_data, user_data]
summaries = []
for data in datasets:
summary = client.summarize(data)
summaries.append(summary)
# Combine insights
all_insights = []
for summary in summaries:
all_insights.extend(summary.insights)
Upgrading from previous versions
Install the Python SDK and start building with Summize.