press-format
Search press releases using press-ndjson-search and format results for blog post references. Generates press_references.json files that can be displayed with the PressReferences component.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Press Format Skill
Overview
The press-format skill searches the emv-pers press release dataset and formats results as blog-ready JSON files. It's a wrapper around the press-ndjson-search tool that adds formatting and file management for the data-blog system.
When to Use ✅
- User wants to add press release citations to a blog post
- User asks to "find relevant press releases" for a specific topic
- User wants to generate
press_references.jsonfor a blog analysis
How It Works
- Searches the press.normalized.ndjson dataset using the press-ndjson-search script
- Formats results into blog-friendly JSON structure
- Saves to
embuild-analyses/analyses/<slug>/results/press_references.json - Returns summary of results found
Usage
Command Line
python3 .github/press-format/scripts/format_press.py \
--query "vergunningen" \
--slug "vergunningen-aanvragen" \
--limit 5
# Publish a copy to embuild-analyses/public/press-references (useful for dev server)
python3 .github/press-format/scripts/format_press.py \
--query "faillissementen" \
--slug "faillissementen" \
--limit 5 \
--publish
# Publish any existing results in the repo to public/press-references (local convenience)
python3 .github/press-format/scripts/format_press.py \
--publish-existing
This command scans `embuild-analyses/analyses/*/results/press_references.json` and copies any found files to `embuild-analyses/public/press-references/<slug>.json` for serving in the dev server.
Parameters
-
--query(required): Search query- Supports quoted phrases:
"exact phrase" - Supports OR operator:
vergunning|PFAS - Case-insensitive
- Supports quoted phrases:
-
--slug(required): Blog analysis slug (e.g.,vergunningen-aanvragen) -
--limit(optional): Maximum results (default: 10) -
--start-date(optional): Start date filter (YYYY-MM-DD) -
--end-date(optional): End date filter (YYYY-MM-DD)
Examples
# Basic search
python3 .github/press-format/scripts/format_press.py \
--query "vergunningen" \
--slug "vergunningen-aanvragen" \
--limit 5
# Search with date range
python3 .github/press-format/scripts/format_press.py \
--query "PFAS" \
--slug "vergunningen-aanvragen" \
--start-date 2025-01-01 \
--end-date 2025-12-31
# Complex query with OR operator
python3 .github/press-format/scripts/format_press.py \
--query "vergunning|PFAS" \
--slug "vergunningen-aanvragen" \
--limit 10
Output Format
Creates embuild-analyses/analyses/<slug>/results/press_references.json:
{
"query": "vergunningen",
"generated_at": "2026-01-19T10:30:00Z",
"references": [
{
"id": "6d5e44b6...",
"title": "Bouwsector opgelucht over PFAS-initiatief",
"date": "2025-06-20",
"url": "https://www.embuildvlaanderen.be/press-room/...",
"excerpt": "Verbatim quote from the press release..."
}
]
}
Using in Blog Posts
After generating the JSON file, add the component to your MDX:
---
title: Your Blog Post
...
---
import { PressReferences } from "@/components/analyses/shared/PressReferences"
... blog content ...
<PressReferences slug="vergunningen-aanvragen" />
Component Props
The PressReferences component accepts:
-
slug(required): Analysis slug to load data from -
title(optional): Section title (default: "Gerelateerde persberichten") -
showYear(optional): Group by year (default: false) -
maxExcerptLength(optional): Excerpt truncation (default: 200)
Programmatic Usage
From Python code:
from press_format import format_press_references
data = format_press_references(
query="vergunningen",
slug="vergunningen-aanvragen",
limit=5
)
print(f"Found {len(data['references'])} references")
Installation (Optional)
To use as a command globally:
cd .github/press-format
./install.sh
Then use:
press-format --query "vergunningen" --slug "vergunningen-aanvragen" --limit 5
Dependencies
Requires:
- Python 3.8+
- emv-pers repository cloned to
~/pyprojects/emv-pers - press-ndjson-search script at
~/pyprojects/emv-pers/.github/press-ndjson-search/scripts/search_ndjson.py - Press data file at
~/pyprojects/emv-pers/press.normalized.ndjson
Error Handling
The script validates:
- Search script exists
- Press data file exists
- Query returns valid results
- Output directory can be created
Common errors:
-
FileNotFoundError: emv-pers repository not found or missing files -
subprocess.CalledProcessError: Search script failed (invalid query, etc.)
LLM/Agent Instructions
When a user asks to add press references to a blog:
- Ask for the search query if not provided
- Run the press-format script with appropriate parameters
- Verify the JSON file was created
- Add the
<PressReferences />component to the blog's content.mdx - Suggest viewing the results in the dev server
Example workflow:
User: "Add relevant press releases about permits to the vergunningen-aanvragen blog"
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!