Prawo (ISAP / Dziennik Ustaw)
Fetches Polish legal acts from the official ELI API of the Chancellery of the Sejm using
scripts/prawo.py. Always outputs structured JSON.
Running the script
Run from this skill's directory (or use relative path from repo root):
| OS |
Command |
| Linux / macOS |
python3 scripts/prawo.py <command> … |
| Windows |
py scripts/prawo.py <command> … (or python) |
Zero external dependencies required (standard library only).
Critical: how current is the text?
The API publishes HTML only for some documents. The newest consolidated texts (teksty jednolite)
are often PDF-only, and the HTML of an amended act is its original wording from the day it
was published. article therefore:
- reads the newest consolidated text that has HTML (or the act itself if it was never amended),
- reports that document in
sourceDocument (ref, date, kind),
- lists every amendment that entered into force after that date in
amendmentsAfterSource,
- sets
upToDate and warning.
When upToDate is false, always tell the user the date of the wording and that later
amendments exist, and give the PDF link of the newest consolidated text. Never present such text as
the certain current wording. For the Constitution the API has no HTML at all: give the PDF link.
Workflow
Article wording ("co mówi art. 30 KP", "okres wypowiedzenia"):
python3 scripts/prawo.py article kp 30
- Article numbers:
30, 22a, 67^18 (superscript 67¹⁸ also works).
- Quote the text, then state
sourceDocument.displayAddress and sourceDocument.date.
- If
upToDate is false, add the warning in your own words and the newest PDF link.
Is the act in force / latest consolidated text / upcoming changes:
python3 scripts/prawo.py act kp
latestConsolidatedText (with PDF link), amendmentsAfterLatestConsolidatedText,
upcomingAmendments (entry into force in the future), status, inForce.
Act by reference: act and article accept a shortcut (kp, vat…), DU/2023/1465,
Dz.U. 2023 poz. 1465, Dz.U. 1974 nr 24 poz. 141 or an ISAP address WDU20230001465.
List shortcuts with python3 scripts/prawo.py codes (works offline).
Search by title (acts without a shortcut):
python3 scripts/prawo.py search "o ochronie danych osobowych" --type Ustawa --in-force
- Results include amending acts ("o zmianie ustawy…"); pick the act the user means, then call
act.
Commands
| Command |
Description |
Returns |
article <ref> <nr> [--original] |
Wording of one article with its source and freshness |
text, sourceDocument, upToDate, amendmentsAfterSource, newerConsolidatedTextsPdfOnly, warning |
act <ref> [--limit N] |
Status, consolidated texts, amendments and links |
status, inForce, latestConsolidatedText, amendmentsAfterLatestConsolidatedText, upcomingAmendments, links |
search <query> [--in-force] [--type T] [--year Y] [--publisher DU|MP] [--limit N] |
Search acts by words in the title |
results[] with ref, displayAddress, title, status |
codes |
Offline list of shortcuts for the main codes and statutes |
codes[] with code, ref, name |
Field reference: references/output.md.
Exit codes
JSON goes to stdout; errors go to stderr as {"error": "...", "type": "..."}.
| Code |
Meaning |
What to do |
0 |
Success |
Use the JSON output |
2 |
Not found / not available |
Act or article does not exist, or no HTML text exists (error names the PDF link) |
64 |
Bad usage / validation |
Unrecognised act reference or article number |
69 |
Network / API error |
Retry once; check internet connection |
Rules
- This skill returns legal text, not legal advice. Do not interpret provisions as advice for the
user's specific case; suggest a lawyer (adwokat, radca prawny) for that.
- Always cite the act and the source document, e.g. "art. 36 § 1 Kodeksu pracy (tekst jednolity
Dz.U. 2023 poz. 1465)".
--original returns the historical wording of an amended act. Use it only when the user asks
about the original or historical text, and say so.
1---2name: prawo-b44x3title: Prawo (ISAP / Dziennik Ustaw)4description: 'Official Polish legal acts from the Sejm ELI API (ISAP: Dziennik Ustaw, Monitor Polski). Read the wording of a specific article of a code or statute, together with the source document and date, and a warning about amendments that entered into force later. Check whether an act is in force, find its latest consolidated text (tekst jednolity), list amendments with entry-into-force dates (including upcoming ones), and search acts by title. Shortcuts for the main codes (kp, kc, kk, kpc, ksh, kpa, vat, pit, cit, op…). Use whenever the user asks about Polish law, e.g. "co mówi art. 30 Kodeksu pracy", "okres wypowiedzenia umowy o pracę", "czy ta ustawa obowiązuje", "tekst jednolity ustawy o VAT", "kiedy wchodzą zmiany w Kodeksie pracy", "Dz.U. 2023 poz. 1465", "przepisy o pracy zdalnej".'5author: b44x6author_url: https://github.com/b44x/ai-polish-skills/tree/dev/skills/prawo7license: MIT8version: 0.1.19execution_mode: open10jurisdiction: pl11practice: general12language: en13tags: [prawo, ustawy, kodeks, isap, dziennik-ustaw, tekst-jednolity, przepisy, eli]14sources:15- title: Output16 path: references/output.md17metadata:18 source: https://skillmd.com/skills/thomasmoreai/prawo-b44x19---2021# Prawo (ISAP / Dziennik Ustaw)2223Fetches Polish legal acts from the official ELI API of the Chancellery of the Sejm using24`scripts/prawo.py`. Always outputs structured JSON.2526## Running the script2728Run from this skill's directory (or use relative path from repo root):2930| OS | Command |31|---|---|32| Linux / macOS | `python3 scripts/prawo.py <command> …` |33| Windows | `py scripts/prawo.py <command> …` (or `python`) |3435Zero external dependencies required (standard library only).3637## Critical: how current is the text?3839The API publishes HTML only for some documents. The newest consolidated texts (teksty jednolite)40are often **PDF-only**, and the HTML of an amended act is its **original** wording from the day it41was published. `article` therefore:42431. reads the newest consolidated text that has HTML (or the act itself if it was never amended),442. reports that document in `sourceDocument` (`ref`, `date`, `kind`),453. lists every amendment that entered into force after that date in `amendmentsAfterSource`,464. sets `upToDate` and `warning`.4748When `upToDate` is `false`, **always** tell the user the date of the wording and that later49amendments exist, and give the PDF link of the newest consolidated text. Never present such text as50the certain current wording. For the Constitution the API has no HTML at all: give the PDF link.5152## Workflow53541. **Article wording** ("co mówi art. 30 KP", "okres wypowiedzenia"):55 `python3 scripts/prawo.py article kp 30`56 - Article numbers: `30`, `22a`, `67^18` (superscript `67¹⁸` also works).57 - Quote the text, then state `sourceDocument.displayAddress` and `sourceDocument.date`.58 - If `upToDate` is false, add the `warning` in your own words and the newest PDF link.59602. **Is the act in force / latest consolidated text / upcoming changes:**61 `python3 scripts/prawo.py act kp`62 - `latestConsolidatedText` (with PDF link), `amendmentsAfterLatestConsolidatedText`,63 `upcomingAmendments` (entry into force in the future), `status`, `inForce`.64653. **Act by reference:** `act` and `article` accept a shortcut (`kp`, `vat`…), `DU/2023/1465`,66 `Dz.U. 2023 poz. 1465`, `Dz.U. 1974 nr 24 poz. 141` or an ISAP address `WDU20230001465`.67 List shortcuts with `python3 scripts/prawo.py codes` (works offline).68694. **Search by title** (acts without a shortcut):70 `python3 scripts/prawo.py search "o ochronie danych osobowych" --type Ustawa --in-force`71 - Results include amending acts ("o zmianie ustawy…"); pick the act the user means, then call `act`.7273## Commands7475| Command | Description | Returns |76|---|---|---|77| `article <ref> <nr> [--original]` | Wording of one article with its source and freshness | `text`, `sourceDocument`, `upToDate`, `amendmentsAfterSource`, `newerConsolidatedTextsPdfOnly`, `warning` |78| `act <ref> [--limit N]` | Status, consolidated texts, amendments and links | `status`, `inForce`, `latestConsolidatedText`, `amendmentsAfterLatestConsolidatedText`, `upcomingAmendments`, `links` |79| `search <query> [--in-force] [--type T] [--year Y] [--publisher DU\|MP] [--limit N]` | Search acts by words in the title | `results[]` with `ref`, `displayAddress`, `title`, `status` |80| `codes` | Offline list of shortcuts for the main codes and statutes | `codes[]` with `code`, `ref`, `name` |8182Field reference: [references/output.md](references/output.md).8384## Exit codes8586JSON goes to stdout; errors go to stderr as `{"error": "...", "type": "..."}`.8788| Code | Meaning | What to do |89|---|---|---|90| `0` | Success | Use the JSON output |91| `2` | Not found / not available | Act or article does not exist, or no HTML text exists (error names the PDF link) |92| `64` | Bad usage / validation | Unrecognised act reference or article number |93| `69` | Network / API error | Retry once; check internet connection |9495## Rules9697- This skill returns legal text, not legal advice. Do not interpret provisions as advice for the98 user's specific case; suggest a lawyer (adwokat, radca prawny) for that.99- Always cite the act and the source document, e.g. "art. 36 § 1 Kodeksu pracy (tekst jednolity100 Dz.U. 2023 poz. 1465)".101- `--original` returns the historical wording of an amended act. Use it only when the user asks102 about the original or historical text, and say so.