nl-export
nl-export ist ein Kommandozeilen-Tool, um Daten aus einem NL-CMS (Plone) via REST-API zu exportieren.
Entwickelt von der Verbundzentrale des GBV (VZG) für die Nutzung im Kontext der Nationallizenzen.
Funktionen
konfig— Konfiguration mit API-Zugangsdaten erstellen und anzeigenlzn— Lizenznehmer zu einem oder mehreren Lizenzmodellen/Produkten exportieren- Ausgabeformate: CSV, XML, JSON (v1/v2/v3 Schema)
proxy— Einzelnutzer-Lizenzmodelle für den Proxy-Betrieb exportieren (CSV)
Voraussetzungen
- Python ≥ 3.12
- Zugriff auf ein NL-CMS mit gültigem Access-Token
Installation
Das Paket ist auf PyPI verfügbar.
Endnutzer
# Mit uv (empfohlen)
uv tool install nl.export
# Mit pip (in einer isolierten Umgebung)
mkdir nl-export && cd nl-export
python3 -m venv .venv
source .venv/bin/activate
pip install nl.export
Entwicklung (lokales Repository)
# Repository klonen
git clone https://github.com/gbv/nl.export.git
cd nl.export
# Mit uv
uv tool install .
uv pip install -e ".[dev]"
# Mit pip (in einer isolierten Umgebung)
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Konfiguration
Vor der ersten Nutzung muss eine Konfigurationsdatei angelegt werden:
nl-export konfig
Das Tool fragt nach Access-Token und CMS-URL und legt die Konfiguration unter folgendem Pfad an:
$XDG_CONFIG_HOME/nl_export.conf
Falls $XDG_CONFIG_HOME nicht gesetzt ist, wird ~/.config/nl_export.conf verwendet.
Die Datei hat folgendes Format:
[plone]
access-token = IhrTokenHier
base-url = https://cms.example.com
Mit --show wird die vorhandene Konfiguration angezeigt, mit --force wird sie überschrieben:
nl-export konfig --show
nl-export konfig --force
Nutzung
Lizenznehmer exportieren (lzn)
# CSV-Export (Standard)
nl-export lzn https://cms.example.de/lizenzmodell/eindeutige-id
# XML-Export mit Schema v2
nl-export lzn --format xml --version 2 https://cms.example.de/lizenzmodell/eindeutige-id
# JSON-Export in ein bestimmtes Verzeichnis
nl-export lzn --format json --ablage /pfad/zum/exportverzeichnis \
https://cms.example.de/lizenzmodell/eindeutige-id
# Nur ASCII-Zeichen in Dateinamen verwenden
nl-export lzn --only-ascii https://cms.example.de/lizenzmodell/eindeutige-id
# Nach Status filtern (mehrfach möglich)
nl-export lzn --status published --status expired https://cms.example.de/lizenzmodell/eindeutige-id
# Mit UUID statt voller URL
nl-export lzn 123e4567-e89b-12d3-a456-426614174000
# Mehrere Lizenzmodelle auf einmal
nl-export lzn https://cms.example.de/lizenzmodell/1 https://cms.example.de/lizenzmodell/2
Die Exportdateien werden standardmäßig im aktuellen Verzeichnis abgelegt (ä̈nderbar mit --ablage).
Versionen des Export-Schemas
| Version | Beschreibung |
|---|---|
| v1 | Basis-Schema |
| v2 | Erweitertes Schema |
| v3 | Schema mit ip_proxy_server und use_theipregistry_org-Feldern |
| v4 | Schema mit psi_org_ids-Feld |
Proxy-Konfiguration exportieren (proxy)
# Standard-Ausgabe nach ./lmodels_singleuser.csv
nl-export proxy
# Ausgabe in eine bestimmte Datei
nl-export proxy --csvdatei /pfad/zur/datei.csv
Allgemeine Optionen
# Ausführliche Ausgabe
nl-export -v
Ausgabeformate
CSV
- Trennzeichen: Semikolon (
;) - Alle Felder in Anführungszeichen (
QUOTE_ALL) - UTF-8-Kodierung
XML
- Namespace:
http://www.nationallizenzen.de/ns/nl - UTF-8-Kodierung
JSON
- Strukturierte JSON-Dateien
- UTF-8-Kodierung
Entwicklung
Tests ausführen
python3 -m pytest src/nl/export/test/ -v
Linting und Formatierung
ruff check --fix src/
ruff format src/
Lizenz
GNU Affero General Public License v3 (AGPL-3.0).
Copyright (c) 2019-2026 Verbundzentrale des GBV (VZG).
Siehe COPYING oder GNU AGPL v3.
Metadata
Release files for nl.export 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nl_export-1.6.0.tar.gz | 32.9 kB | Without provenance | Details for nl_export-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nl_export-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for nl_export-1.6.0-py3-none-any.whl |
Total release size: 73.6 kB
Release files / nl_export-1.6.0.tar.gz
| Download URL | nl_export-1.6.0.tar.gz |
|---|---|
| Size | 32.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ad04f8f811f649bd2f0b37a3eae508b1629f35183b2f32657e5dcea2f43f24a
|
|
BLAKE2b-256 checksum How to use checksums |
3c36e3fc4c89dde6cac72fd202d8b7e3c6450b0fe0378959ab4b33ae5f004781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / nl_export-1.6.0-py3-none-any.whl
| Download URL | nl_export-1.6.0-py3-none-any.whl |
|---|---|
| Size | 40.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74a441701063c14cf3b8dc2c3779f5389dbb228c90d1e8f0412e689966b94fa7
|
|
BLAKE2b-256 checksum How to use checksums |
c6b9267d7f9db5fc6ded308106826e9644db8dc81afa5e8f4d209581538bcd9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for nl.export 1.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.