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'
)

# Basis gebruik met verplichte velden
order_id = client.create_order(
    file_path='vergadering.mp3', # Verplicht, 
    email='contact@bedrijf.nl', # Verplicht, 
    context='Maandelijkse vergadering', # Verplicht, 
    meeting_date='2025-02-23',  # Verplicht, format: YYYY-MM-DD
    smart_detection=True,       # Verplicht, voor automatische agendapunt detectie
    report_type='middel_notulen'  # Optional, standaard op 'transcriptie'
)

# Met experimentele features
order_id = client.create_order(
    file_path='vergadering.mp3',
    email='contact@bedrijf.nl',
    context='Maandelijkse vergadering',
    meeting_date='2025-02-23',
    smart_detection=True,
    # Experimentele features
    speaker_diarization=True,  # Optioneel, experimenteel
    speaker_count=4,          # Optioneel, experimenteel (1-10)
    speaker_names=['Jan', 'Piet', 'Marie', 'Anna']  # Optioneel, 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',
    meeting_date='2025-02-23',
    smart_detection=True,
    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)

Verplichte Velden

  • file_path: Pad naar het audio bestand
  • email: Email adres voor notificaties
  • context: Naam/context van de vergadering
  • meeting_date: Datum van de vergadering (format: YYYY-MM-DD)
  • smart_detection: Automatische agendapunt detectie (boolean)

Optionele Velden

  • report_type: Type rapport (default: 'transcriptie')
  • webhook_url: URL voor webhook notificaties
  • unstructured_agenda: Ongestructureerde agenda tekst

Experimentele Features

De volgende features zijn in beta en kunnen wijzigen:

  • speaker_diarization: Sprekerherkenning gebruiken (boolean)
  • speaker_count: Verwacht aantal sprekers (1-10)
  • speaker_names: Lijst met namen van sprekers

Report Types

  • transcriptie: Alleen transcriptie (€5)
  • korte_notulen: Beknopte notulen (€10)
  • middel_notulen: Uitgebreide notulen (€20)
  • lange_notulen: Complete notulen met details (€25)

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": "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"
    }
    

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.9.tar.gz (7.3 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.9-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snelnotuleren-sdk-1.1.9.tar.gz
  • Upload date:
  • Size: 7.3 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.9.tar.gz
Algorithm Hash digest
SHA256 5e532169c559487244f3ae5165a801b6eefd4061b2adedfffa4ecb4a55c9fc28
MD5 2755701d9c443525f2c0966c0d52a87f
BLAKE2b-256 cabd9035aafa2ab0e251cce8833f420063fcf6febd396cbc5628c5ab14959b65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snelnotuleren_sdk-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bf4895c0fc4e405d2705bfc8ea6dbfce8fb409b9cc3b5a0ebc5d7463df4815cc
MD5 89009e6f73aece999d815bf4a5729780
BLAKE2b-256 c4b3a9c5589c4ca7adcd2861c314a9904aa959083108c55f7d15cefe4eba8c86

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