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

Uploaded Python 3

File details

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

File metadata

  • Download URL: snelnotuleren-sdk-1.1.7.tar.gz
  • Upload date:
  • Size: 7.4 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.7.tar.gz
Algorithm Hash digest
SHA256 7068d1a495c200c5dbc572b90769b0306b9e8e97b9b885c1f96d88154b759109
MD5 537779874f419c4df0d3070f33eb07bb
BLAKE2b-256 a84e6f44c493adf974202a1d733b5eed6488def813ba0729039b23d3f58fcf58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snelnotuleren_sdk-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a3db193831534716a6f1cd4bcf08958868a95227bb89aa245fa1da6560256bd2
MD5 2f229b3af63b7d562407338325366c2c
BLAKE2b-256 61b89c01248b8588b33ac653c21258d80fe3056e8b7aeeae12d1d7c94aca8917

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