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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: snelnotuleren-sdk-1.1.0.tar.gz
  • Upload date:
  • Size: 5.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.0.tar.gz
Algorithm Hash digest
SHA256 d8a7786c7dde044140c0eba7cd7108403d8be5c1fae0eb39c93427498230af95
MD5 54da7d3f198143c7421d5931ff2b9e9e
BLAKE2b-256 c84339d640af5a190614fc0d90346c5599959e8f8c0c69bb7004d3cbf08ee043

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snelnotuleren_sdk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81241fd5595aee1919f8748554c76ec0b67cfaaa116f60573d212d2371caf26a
MD5 2234af48deab13f58e479bf3855cac19
BLAKE2b-256 fb14ef07f3664aa7a5dfd26294957ca106269699914885176eae648d4e0d996a

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