• TypeScript 99.3%
  • JavaScript 0.7%
Find a file
DigiToegankelijk NLdoc 4a77997e8f Merge branch 'renovate/got-14.x-lockfile' into 'main'
fix(deps): update dependency got to v14.6.6

See merge request logius/nldoc/lib/typescript/document-test-set-generator!120
2025-12-30 19:14:28 +00:00
.vscode chore: update deps and add tests 2025-07-30 14:20:15 +02:00
src chore: update deps and add tests 2025-07-30 14:20:15 +02:00
.editorconfig chore: set .editorconfig 2025-04-22 00:08:37 +00:00
.gitignore feat: test set generator 2023-08-10 14:47:43 +02:00
.gitlab-ci.yml chore(deps): update node.js to v24 2025-10-29 23:10:57 +00:00
.nvmrc chore(deps): update node.js to v24 2025-10-29 23:10:57 +00:00
.prettierignore chore: update deps and add tests 2025-07-30 14:20:15 +02:00
CODEOWNERS chore: set CODEOWNERS 2025-04-22 00:25:20 +00:00
eslint.config.mjs chore: update deps and add tests 2025-07-30 14:20:15 +02:00
index.spec.ts chore: update deps and add tests 2025-07-30 14:20:15 +02:00
index.ts chore: update deps and add tests 2025-07-30 14:20:15 +02:00
LICENSE chore: add license 2025-04-15 00:20:20 +02:00
package-lock.json fix(deps): update dependency got to v14.6.6 2025-12-30 19:09:47 +00:00
package.json chore(deps): update dependency @tsconfig/node-lts to v24 2025-11-21 05:10:32 +00:00
prettier.config.mjs chore: update deps and add tests 2025-07-30 14:20:15 +02:00
README.md docs: add readme 2025-08-18 13:47:43 +02:00
renovate.json chore: npm install twice 2025-11-05 14:12:41 +00:00
tsconfig.json chore: update deps and add tests 2025-07-30 14:20:15 +02:00
vitest.config.ts chore: update deps and add tests 2025-07-30 14:20:15 +02:00

NLdoc Document Test Set Generator

A utility tool that downloads a test set of PDF documents from officielebekendmakingen.nl (Dutch Official Publications) for testing and development purposes.

Overview

This TypeScript utility provides an interactive command-line interface to:

  • Download PDF documents from Dutch official publications
  • Filter by document types (Staatscourant, Gemeenteblad, etc.)
  • Upload documents directly to MinIO object storage
  • Create local test document sets for development

The tool supports various Dutch government publication types including Staatscourant, Gemeenteblad, Tractatenblad, and parliamentary documents, making it ideal for testing document processing systems.

Getting Started

Prerequisites

  • Node.js >= 22.0.0 < 23.0.0
  • npm >= 10.0.0 < 12.0.0

Installation

Install the package via npm:

npm install @nldoc/document-test-set-generator

Or using yarn:

yarn add @nldoc/document-test-set-generator

Basic Usage

Run the interactive CLI to download documents:

npm run get

The tool will prompt you to:

  1. Choose between downloading locally or uploading to MinIO
  2. Configure MinIO settings (if uploading)
  3. Select document types to download
  4. Specify the number of documents to retrieve

Development

Local Setup

  1. Clone the repository:

    git clone <repository-url>
    cd document-test-set-generator
    
  2. Install dependencies:

    npm install
    
  3. Run the tool:

    npm run get
    

Available Scripts

  • npm run get - Run the document downloader interactively
  • npm run test - Run the test suite with Vitest
  • npm run test:watch - Run tests in watch mode
  • npm run test:ui - Run tests with UI
  • npm run test:coverage - Run tests with coverage report
  • npm run format - Format code using Prettier
  • npm run format:check - Check code formatting
  • npm run lint - Lint the codebase using ESLint
  • npm run fix - Auto-fix formatting and linting issues

Document Types

The tool supports downloading various types of Dutch government publications:

Publication Types

  • Staatscourant - Dutch Government Gazette
  • Gemeenteblad - Municipal Gazette
  • Tractatenblad - Treaty Publication
  • Provinciaal blad - Provincial Gazette
  • Waterschapsblad - Water Authority Gazette
  • Blad gemeenschappelijke regeling - Joint Arrangement Gazette

Parliamentary Documents

  • Agenda - Parliamentary agenda items
  • Handelingen - Parliamentary proceedings
  • Kamerstuk - Parliamentary papers
  • Kamervragen - Parliamentary questions
  • Motie - Parliamentary motions

Configuration

MinIO Setup

When uploading to MinIO, you'll be prompted for:

  • Host (default: 127.0.0.1)
  • Port (default: 9000)
  • Access key
  • Secret key

The tool will create a .env file to store these credentials for future use.

Download Location

Documents are downloaded to ./downloads/<publication-type>/ by default.

API Integration

The tool integrates with the Dutch government's SRU (Search/Retrieve via URL) API:

  • Base URL: https://repository.overheid.nl/sru
  • Supports pagination for large result sets
  • Filters by publication type and subcategory
  • Downloads PDF documents directly

Testing

Run the test suite:

npm test

For coverage reports:

npm run test:coverage

Contributing

We welcome contributions! Please ensure:

  1. All tests pass (npm test)
  2. Code is properly formatted (npm run format:check)
  3. Linting rules are followed (npm run lint)

License

This project is licensed under the European Union Public License 1.2 - see LICENSE for details.

Acknowledgements