DAS Setup Helper
A Python CLI tool to set up crawlers and manage acquisitions in WIHP (EUROSTAT). It provides three pipelines: creating crawlers, triggering acquisitions, and stopping them.
Requirements
- Python >= 3.12
- uv — fast Python package and project manager
Install uv (once, globally):
curl -LsSf https://astral.sh/uv/install.sh | sh
Installation
From PyPI (recommended)
# Create a project directory
mkdir das-setup-helper && cd das-setup-helper
# Install the package in an isolated environment
uv add das-setup-helper
All three CLI commands (das-setup-crawler, das-create-acq, das-stop-acq) are then available via uv run.
From source (contributors)
# Clone the repository
git clone <repo-url>
cd das-setup-helper
# Install all dependencies including dev tools
make sync
# or directly:
uv sync --extra dev
Configuration
Copy the template and fill in your values:
cp env.sh.template env.sh
# edit env.sh with your settings
Key variables:
| Variable | Description |
|---|---|
STORAGE_BACKEND |
local (default) or s3 |
USE_SECRET_MANAGER |
false (default, uses env vars) or true (uses AWS Secrets Manager) |
AWS_SECRET_MANAGER_NAME |
Secret name in Secrets Manager — only needed if USE_SECRET_MANAGER=true |
S3_AWS_WIHP_CONFIG_DIRECTORY |
Path to the config directory (local path or S3 prefix) |
S3_AWS_WIHP_INPUT_SOURCES_TO_CREATE |
Path to the input CSV file with sources to create |
S3_AWS_WHIP_READY_FOR_CRAWLING_DIRECTORY |
Directory where crawler outputs are written |
WIHP_API_URL |
WIHP API base URL |
WIHP_TOKEN_URL |
WIHP OAuth token endpoint |
WIHP_API_KEY |
WIHP API key |
WIHP_GROUP |
WIHP group (e.g. /MNE) |
Local storage
When STORAGE_BACKEND=local, paths are local filesystem paths.
The local_storage/ directory mirrors the S3 structure:
local_storage/
├── config/ # input files
├── ready_for_crawling/ # crawler outputs
├── ready_to_export/
├── done/
└── staging/
"" source to create directory"
The only input file required to run das-setup-crawler:
local_storage/MNE/config/dashelper/sources_to_create.csv
Format (semicolon-separated):
mne_name;wikipedia_url
Airbus;https://en.wikipedia.org/wiki/Airbus
TotalEnergies;https://en.wikipedia.org/wiki/TotalEnergies
Running the pipelines
Load your environment variables then run a pipeline:
source env.sh
# 1. Create a crawler from the input CSV
uv run das-setup-crawler
# or: make run-crawler
# 2. Trigger acquisitions for existing crawlers
uv run das-create-acq
# or: make run-acq
# 3. Stop running acquisitions
uv run das-stop-acq
# or: make run-stop
Pipeline order: setup-crawler → create-acq → stop-acq
Development
# Run tests
make test
# Format code
make lint
# Refresh dependency lock (without upgrading)
make lock
# Upgrade all dependencies
make lock-upgrade
Available make targets:
make info
Deployment (prod/staging)
In production (MWAA / Lambda), set:
USE_SECRET_MANAGER=true
AWS_SECRET_MANAGER_NAME=prod/DASHelper
STORAGE_BACKEND=s3
All other variables are loaded automatically from AWS Secrets Manager.
The IAM role must have secretsmanager:GetSecretValue permission on the secret.
Release
# Build the package
make build
# Publish a development build to TestPyPI
make publish-test
# Publish a release build to PyPI
make publish
The package version is derived from Git tags and follows Python package versioning conventions (PEP 440):
- Tagged releases use stable versions such as
v1.2.3. - Untagged branch builds produce development versions such as
1.2.4.dev5.
GitLab CI release flow:
- Branch
develop: manual jobpublish-internalpublishes the current branch build to the internal Python repository. - Branch
test: manual jobpublish-testpypipublishes the current branch build to TestPyPI. - Branch
main: manual jobsprepare-release-patch,prepare-release-minor, andprepare-release-majorcreate the next Git tag. - Tag pipeline
vX.Y.Z: manual jobpublish-pypipublishes that tagged release to PyPI.
SonarQube runs in the quality stage for merge requests and for the develop and main branches.
To allow the release-tag job to push tags from CI, define these GitLab CI/CD variables:
REPO_PUSH_USERREPO_PUSH_TOKEN
Also define the repository tokens used for publishing:
DOCKER_REGISTRY_USERDOCKER_REGISTRY_PASSWORDTEST_PYPI_TOKENPYPI_TOKEN
For SonarQube, also define:
SONAR_TOKEN
License
This project is distributed under the European Union Public Licence v1.2 (EUPL-1.2). The full licence text is available in LICENSE and on the European Commission website: https://commission.europa.eu/about/departments-and-executive-agencies/digital-services/open-source-strategy-history/european-union-public-licence_en
Test and Deploy
Use the built-in continuous integration in GitLab.
- Get started with GitLab CI/CD
- Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)
- Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy
- Use pull-based deployments for improved Kubernetes management
- Set up protected environments
Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to makeareadme.com for this template.
Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
Name
Choose a self-explaining name for your project.
Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
License
For open source projects, say how it is licensed.
Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
Release files for das-setup-helper 0.1.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 | |
|---|---|---|---|
| das_setup_helper-0.1.0.tar.gz | 106.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| das_setup_helper-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.8 kB
Release files / das_setup_helper-0.1.0.tar.gz
| Download URL | das_setup_helper-0.1.0.tar.gz |
|---|---|
| Size | 106.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16a272f9148a96c57e3b09a0ff65ec6b234b471ee53f15a44eb41830e2d98b9b
|
|
BLAKE2b-256 checksum How to use checksums |
39071cda28cf9bf1946ea978888f5f2d6765d6978be8566b35732279a18cdea4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / das_setup_helper-0.1.0-py3-none-any.whl
| Download URL | das_setup_helper-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e07236a31fb617f0e998ed72f9bf09532abede3f4df2a11807bf28b243023bd
|
|
BLAKE2b-256 checksum How to use checksums |
5f7405cb3f343bf631b511dd58febe5acae98d91d7f8e6eb823a8bfc9b5b0f69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|