Skip to content

Conversation

@marcarl
Copy link
Collaborator

@marcarl marcarl commented Jan 7, 2026

Summary

This PR adds comprehensive analysis of EU legislation connections in Swedish SFS documents from 2015-2025.

Key Findings

  • 1624 documents analyzed (all SFS 2015-2025)
  • 620 documents (38.2%) have EU connections
  • 5396 total EU references found
  • 176 documents have EU directive metadata flag
  • 1 document has CELEX number

Reference Types

  • 3738 förordning references (EU regulations)
  • 959 eu_institution references (Europaparlamentet och rådets...)
  • 356 kommissionen references (Commission regulations)
  • 343 direktiv references (EU directives)

Top Areas with EU Connections

  1. 🌾 Agriculture and rural development
  2. ♻️ Environment and waste management
  3. 💊 Pharmaceuticals and medical devices
  4. 🚛 Transport and traffic
  5. 🍽️ Food safety

What's Included

New Script: scripts/analyze_eu_connection.py

  • Analyzes both metadata and text references
  • Supports year range filtering
  • Generates detailed markdown reports
  • Creates linkable references to selex.se
  • Multiple reference type detection

Generated Report: reports/eu_analysis_2015-2025.md

  • Complete statistics and breakdown
  • Top 20 documents with most EU references
  • Examples of each reference type
  • All document references link to selex.se

Usage Examples

# Analyze test documents
python scripts/analyze_eu_connection.py --input data/testdocs/rkrattsbaser

# Analyze 2015-2025 with report
python scripts/analyze_eu_connection.py \
  --input ../sfs-jsondata \
  --year-range 2015-2025 \
  --output reports/eu_analysis_2015-2025.md

# Verbose mode
python scripts/analyze_eu_connection.py --input sfs_json --verbose

Technical Details

  • Uses regex patterns to detect EU regulations, directives, CELEX numbers
  • Handles various formats: (EU), (EG), (EEG)
  • Detects institutional references and Commission documents
  • Generates ELI-compliant URLs for all SFS documents

🤖 Generated with Claude Code

This commit adds a new analysis script and report documenting the
connection between Swedish SFS legislation and EU legislation.

Key features:
- Analyzes both metadata (CELEX numbers, EU directive flags) and text
  references (regulations, directives, institutions)
- Filters by year range (2015-2025 analyzed)
- Generates detailed report with linkable document references
- Found 620/1624 documents (38.2%) with EU connections
- 5396 total EU references across all document types

The script supports:
- Year range filtering
- Multiple reference type detection (förordning, direktiv, kommissionen)
- Markdown report generation with selex.se links
- Verbose mode for processing feedback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants