- TypeScript 99.3%
- JavaScript 0.7%
fix(deps): update dependency got to v14.6.6 See merge request logius/nldoc/lib/typescript/document-test-set-generator!120 |
||
|---|---|---|
| .vscode | ||
| src | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .nvmrc | ||
| .prettierignore | ||
| CODEOWNERS | ||
| eslint.config.mjs | ||
| index.spec.ts | ||
| index.ts | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| prettier.config.mjs | ||
| README.md | ||
| renovate.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||
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:
- Choose between downloading locally or uploading to MinIO
- Configure MinIO settings (if uploading)
- Select document types to download
- Specify the number of documents to retrieve
Development
Local Setup
-
Clone the repository:
git clone <repository-url> cd document-test-set-generator -
Install dependencies:
npm install -
Run the tool:
npm run get
Available Scripts
npm run get- Run the document downloader interactivelynpm run test- Run the test suite with Vitestnpm run test:watch- Run tests in watch modenpm run test:ui- Run tests with UInpm run test:coverage- Run tests with coverage reportnpm run format- Format code using Prettiernpm run format:check- Check code formattingnpm run lint- Lint the codebase using ESLintnpm 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:
- All tests pass (
npm test) - Code is properly formatted (
npm run format:check) - 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
- Integrates with officielebekendmakingen.nl API
- Uses MinIO for object storage
- Built with Got for HTTP requests
- Interactive CLI powered by Inquirer.js