Skip to main content

Generieke client voor GEMMA-zaken componenten

Project description

De ZDS-Client is een (voorlopig) interne client die op basis van OAS 3.0 specificaties met GEMMA-zaken componenten communiceert.

1 Features

  • Ophalen van OAS 3.0 specificatie

  • Aanmaken van resources volgens specificatie

  • Generiek

2 Installatie

2.1 Benodigdheden

  • Python 3.6 of hoger

  • setuptools 30.3.0 of hoger

2.2 Installeren

pip install gemma-zds-client

3 Gebruik

3.1 Initialiseren

De client moet geinitialiseerd worden met de locatie van de componenten. Dit doe je eenmalig:

from zds_client import Client

Client.load_config('/pad/naar/config.yml')

De makkelijkste manier is configuratie via een yaml bestand, in het formaat:

---

zrc:
  scheme: http
  host: localhost
  port: 8000

drc:
  scheme: http
  host: localhost
  port: 8001

ztc:
  scheme: http
  host: localhost
  port: 8002

orc:
  scheme: http
  host: localhost
  port: 8003

De key is de naam van de component.

Je kan echter ook de configuratie zonder yaml bestand doen, en volledig gebruik maken van Python dictonaries, bijvoorbeeld:

from zds_client import Client

ZRC = {
    'scheme': 'http',
    'host': 'localhost',
    'port': 8000,
}

DRC = {
    'scheme': 'http',
    'host': 'localhost',
    'port': 8001,
}

Client.load_config(**{
    'zrc': ZRC,
    'drc': DRC,
    ...
})

3.2 Resources manipuleren

Per component kan je vervolgens een client resources laten opvragen of manipuleren:

zrc_client = Client('zrc')  # gebruik alias uit configuratie

# oplijsten
zaken = zrc_client.list('zaak')

# opvragen
zaak = zrc_client.retrieve('zaak', uuid='<uuid>')

# aanmaken
zaak = zrc_client.create('zaak', {
    'bronorganisatie': '000000000',
    'zaaktype': 'http://localhost:8002/api/v1/zaaktypen/<uuid>'
})

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

gemma-zds-client-0.1.3.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

gemma_zds_client-0.1.3-py2.py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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