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.5.tar.gz (6.0 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.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snelnotuleren-sdk-1.1.5.tar.gz
  • Upload date:
  • Size: 6.0 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.5.tar.gz
Algorithm Hash digest
SHA256 675fb431c64a981cfec9651abe72d616fbacb0cb16b6ea986d37aee61aef133d
MD5 5852fa9cb483b024ea69b089d68d98f7
BLAKE2b-256 4e076847c8b0d43a8d6822bb795d2d48ac18debc91e0783db433c7a6f451ef94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snelnotuleren_sdk-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 64dce8656c88a58d26ef735958801b275f4464526153dd1237480259f5b11a6b
MD5 f6f8357ed37f0ae940dd73ca18cfa351
BLAKE2b-256 b445e00938cfa3150c61b6568e885b4ef5e45ea2ddd9b595d75aff655f5ceeeb

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