Skip to main content

A package which implements functionality to download and parse german legal texts.

Project description

GermanLegalTexts

A Python package for downloading, parsing, and working with German legal texts and court judgements from official German government sources.

Description

GermanLegalTexts provides tools to programmatically access and work with German legal texts and court judgements. It allows you to:

  • Law Books (Gesetzbücher): Download and parse legal codes from Gesetze im Internet

    • Download individual law books by abbreviation (e.g., "bgb" for Bürgerliches Gesetzbuch)
    • Download all available German legal texts
    • Access specific paragraphs, sections, and other elements
  • Court Judgements (Rechtsprechung): Download and parse court decisions from Rechtsprechung im Internet

    • Download individual judgements
    • Browse and filter judgement index
    • Download first n judgements or all available judgements
    • Access structured judgement data (facts, reasoning, decision)

The package handles the complexities of downloading, extracting, and parsing the XML files provided by the official German legal repositories.

Installation

Requires Python 3.12 or higher.

pip install germanlegaltexts

Usage

Law Books (Gesetzbücher)

from germanlegaltexts.GermanLawDownloader import GermanLawDownloader

downloader = GermanLawDownloader()

url = "https://www.gesetze-im-internet.de/bgb/xml.zip"
bgb = downloader.download_law_book(url)

paragraph = bgb.get_paragraph("§ 1")
if paragraph:
    print(f"Content: {paragraph.textdaten.text.content.text}")

Court Judgements (Rechtsprechung)

from germanlegaltexts.GermanJudgementDownloader import GermanJudgementDownloader

downloader = GermanJudgementDownloader()

judgements = downloader.download_first_n_judgements(10)
for judgement in judgements:
    print(f"Case: {judgement.aktenzeichen} - Type: {judgement.doktyp}")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

germanlegaltexts-0.2.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file germanlegaltexts-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: germanlegaltexts-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for germanlegaltexts-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b472a94bfbfec276a06a050152754a84709a564cd88a277b2b193a3c30ae179
MD5 2ee404119dd76a61c2d09669f0e342ab
BLAKE2b-256 a45e485672f568264ed1ccd0eefa00086b210a05d5fee13d880a74b22a04c230

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page