Skip to main content

Derogada

PyPI Python CI License: CC BY-NC-SA 4.0 Ruff

¿Tu demanda invoca una norma derogada sin saberlo?

Derogada lee tu escrito jurídico (PDF, Word o texto), extrae cada referencia normativa y comprueba en las fuentes oficiales (la API de datos abiertos del BOE y CELLAR / EUR-Lex) si sigue vigente, fue modificada o está derogada. Con enlace oficial en cada línea y propuesta de cambio anclada a la norma vigente.

Sirve tanto para revisar lo que redactas como lo que recibes: una norma derogada en el escrito de la parte contraria es un argumento a tu favor.

Demo en vivo · Documentación técnica · PyPI · GitHub

$ derogada check demanda.pdf --format md --out informe.md

Qué hace

  • Extrae las citas del documento ("Ley 30/1992, art. 42", "Reglamento (UE) 2016/679", "art. 217 LECrim"...) con doble canal: regex determinista + LLM opcional.
  • Las contrasta con fuentes oficiales: API de datos abiertos del BOE y endpoint SPARQL de CELLAR (EUR-Lex). Sin scrapers, sin inventar.
  • Informa del estado: VIGENTE · MODIFICADA · DEROGADA · VIGENCIA AGOTADA · NO RESUELTA · NO ENCONTRADA, con la norma que deroga o modifica y su enlace oficial.
  • Verifica a dos niveles: la norma completa y el artículo citado (que puede estar derogado aunque la norma siga viva).
  • Propone el cambio textual anclado a la norma vigente equivalente, con fuente.
  • Si una cita es ambigua, nunca la adivina: la marca NO RESUELTA con los candidatos.

Instalación

pip install derogada

Requiere Python ≥ 3.10. Para desarrollo:

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"

Uso

derogada check demanda.pdf                  # informe Markdown por stdout
derogada check demanda.docx -f json -o informe.json
derogada check demanda.pdf -f tabla         # tabla en terminal
derogada check demanda.pdf --no-llm         # solo regex, sin LLM
derogada norma BOE-A-1992-26318             # estado de una norma suelta
derogada norma 32016R0679                   # también CELEX (EUR-Lex)
derogada cache clear                        # vacía la caché local

Como biblioteca:

from derogada import analizar_documento

informe = analizar_documento("demanda.pdf")
for r in informe.resultados:
    print(r.cita.texto, "->", r.estado.value, r.derogada_por)

Configuración de la IA (opcional)

El canal LLM mejora el recall con siglas y nombres comunes ("el Estatuto de los Trabajadores", "el RGPD"...). Sin configuración, todo funciona en modo solo-regex.

# cualquier modelo LiteLLM: gpt-5.6, anthropic/claude-sonnet-5,
# gemini/gemini-3.5-flash, openai/qwen3.6 (endpoint propio), ollama/llama4...
export DEROGADA_MODEL="anthropic/claude-sonnet-5"
export DEROGADA_API_BASE="https://api.ejemplo/v1" # endpoint OpenAI-compatible
export DEROGADA_API_KEY="sk-..."

Las respuestas de las APIs oficiales se cachean localmente (SQLite, TTL 7 días, DEROGADA_CACHE_DIR) para no martillear los servicios públicos.

Cómo funciona

ingesta (txt/docx/pdf) → extracción (regex + LLM) → resolución (BOE-A / CELEX)
→ verificación (norma y artículo) → sugerencia anclada → informe (md/json/tabla)

Reglas de diseño: nunca inventar identificadores, validar todo contra la API (numero_oficial y rango), y no proponer nada sin fuente oficial. Detalles en la documentación técnica.

Demo web

La landing (derogada.686f6c61.dev, rama landing) incluye una demo que se ejecuta 100% en el navegador: verificación en vivo contra el BOE (CORS abierto) y EUR-Lex (vía proxy CORS; solo viaja el CELEX, dato público). El servidor opcional para la demo completa con IA (FastAPI, demo/) vive en la misma rama landing, que es la que se despliega en producción.

Desarrollo

ruff check src tests
pytest -q          # 51 tests con cassettes VCR grabadas: no necesita red

CI: ruff + pytest en Python 3.10–3.13. Publicación en PyPI con Trusted Publishing al pushear un tag v*. Cambios por versión: CHANGELOG.md.

Aviso

Derogada no ofrece asesoramiento jurídico. Los textos consolidados del BOE tienen carácter meramente informativo: a efectos jurídicos, consulta siempre la publicación oficial. Los datos de la UE proceden de CELLAR / EUR-Lex.

Licencia

CC BY-NC-SA 4.0 © 2026 686f6c61. Uso libre para fines no comerciales con atribución, y las obras derivadas deben compartirse bajo la misma licencia (share-alike). Para uso comercial, contacta con el autor para una licencia aparte.

Metadata

Release files for derogada 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for derogada 0.1.0
File Size Uploaded Provenance
derogada-0.1.0.tar.gz 73.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for derogada 0.1.0
File Interpreter ABI Platform
derogada-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 113.0 kB

Release files / derogada-0.1.0.tar.gz

Download URL derogada-0.1.0.tar.gz
Size 73.6 kB
Tags Source
SHA-256 checksum
How to use checksums
becae5e9839c4cd9da477f02bcccb9d806bbe7061341799d10580967eb85126d
BLAKE2b-256 checksum
How to use checksums
04b26831db3957666d688d9eabc9e8c43b80f858c60b133393e8e3cc8a7bd1ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release files / derogada-0.1.0-py3-none-any.whl

Download URL derogada-0.1.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aac11c5c72696d0d27f600f53e64abd096bf96fe9f7cc45dfb33d23eae2d7da
BLAKE2b-256 checksum
How to use checksums
c075425223bb635240f33bdf958e2a4cc1f9040e2b9a88f6331d9e991580fca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Security for derogada 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for derogada-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page