Skip to main content

Python SDK voor de Snelnotuleren.nl API

Project description

Snelnotuleren Python SDK

PyPI version Python versions

Python SDK voor de Snelnotuleren.nl API. Automatiseer het verwerken van audio-opnames naar notulen.

Installatie

pip install snelnotuleren-sdk

Gebruik

API Credentials aanmaken

Je kunt op twee manieren API credentials krijgen:

  1. Via het dashboard op dashboard.snelnotuleren.nl
  2. Programmatisch via de SDK:
from snelnotuleren import SnelNotulerenClient

# Maak nieuwe credentials aan
client = SnelNotulerenClient()
credentials = client.create_client_credentials(
    label="Mijn API Client",
    description="Voor automatische verwerking"
)

print(f"Client ID: {credentials['client_id']}")
print(f"Client Secret: {credentials['client_secret']}")
print(f"Webhook Secret: {credentials['webhook_secret']}")  # Voor webhook verificatie

Notulen verwerken

from snelnotuleren import SnelNotulerenClient

# Initialiseer met je credentials
client = SnelNotulerenClient(
    client_id='jouw_client_id',
    client_secret='jouw_client_secret'
)

# Maak een order aan
order_id = client.create_order(
    file_path='vergadering.mp3',
    email='contact@bedrijf.nl',
    context='Maandelijkse vergadering',
    report_type='middel_notulen',  # Optional, standaard op transcriptie
    speaker_diarization=True,      # Optional, experimenteel
    speaker_count=4                # Optional, experimenteel
)

Webhook Notificaties

Je kunt webhooks gebruiken om direct een notificatie te krijgen wanneer je notulen klaar zijn:

# Maak een order met webhook URL
order_id = client.create_order(
    file_path='vergadering.mp3',
    email='contact@bedrijf.nl',
    context='Maandelijkse vergadering',
    webhook_url='https://jouw-domein.nl/webhook'
)

Implementeer een webhook handler:

from flask import Flask, request
import hmac
import hashlib

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    # Verifieer de webhook signature
    signature = request.headers.get('X-Webhook-Signature')
    payload = request.get_data().decode('utf-8')
    
    expected_signature = hmac.new(
        'jouw_webhook_secret'.encode(),  # Van je credentials
        payload.encode(),
        hashlib.sha256
    ).hexdigest()
    
    if signature != expected_signature:
        return 'Invalid signature', 401

    # Verwerk de webhook
    data = request.json
    
    if data['event'] == 'processing.completed':
        # Notulen zijn klaar
        notulen = data['data']['notulen']
        print(f"✅ Notulen ontvangen voor order {data['order_id']}")
        
    elif data['event'] == 'processing.failed':
        print(f"❌ Error voor order {data['order_id']}: {data['error']}")
    
    return 'OK', 200

if __name__ == '__main__':
    app.run(port=8080)

Webhook Events

Je kunt deze events verwachten:

  • processing.completed: Notulen zijn succesvol verwerkt

    {
      "event": "processing.completed",
      "order_id": "order_123",
      "status": "completed",
      "data": {
        "meeting_name": "Maandelijkse vergadering",
        "meeting_date": "2024-02-22",
        "notulen": "Agendapunt 1: Opening\n De vergadering wordt geopend...",
        "speakers": ["Spreker 1", "Spreker 2"],
        "metadata": {
          "speaker_diarization": true,
          "speakers_expected": 2,
          "detected_language": "nl",
          "categories": ["Opening", "Rondvraag"]
        }
      }
    }
    
  • processing.failed: Er is een fout opgetreden

    {
      "event": "processing.failed",
      "order_id": "order_123",
      "status": "failed",
      "error": "Beschrijving van de fout"
    }
    

Report Types

  • transcriptie: Alleen transcriptie
  • korte_notulen: Beknopte notulen
  • middel_notulen: Uitgebreide notulen
  • lange_notulen: Complete notulen met details

Security Best Practices

  1. Bewaar je client secret en webhook secret veilig
  2. Verifieer altijd de webhook signature
  3. Gebruik HTTPS voor je webhook endpoint
  4. Implementeer rate limiting op je webhook endpoint

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

snelnotuleren-sdk-1.1.4.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snelnotuleren_sdk-1.1.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file snelnotuleren-sdk-1.1.4.tar.gz.

File metadata

  • Download URL: snelnotuleren-sdk-1.1.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.6

File hashes

Hashes for snelnotuleren-sdk-1.1.4.tar.gz
Algorithm Hash digest
SHA256 0e3a957755c008c154951683aa6618ebb9298c79cedad1eb3bfaccafdcb3852a
MD5 6c9e7864294dd2e18ec57c577464dfd8
BLAKE2b-256 fd16de12f1311d86e649c86ff8ffaf275ede5517ebd66667b2bb744b3d859612

See more details on using hashes here.

File details

Details for the file snelnotuleren_sdk-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for snelnotuleren_sdk-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2cfda8ddf62a42baab62e91b230f016a81f374f76037a34f72f142c2656f8de5
MD5 e83a203abc91bf5f6e342be93ab537f7
BLAKE2b-256 3f3e7e5808a1a34d42d9ee7c1caafe7b739f60294676d3c339ae0e43c5dcc2ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page