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 Distribution

germanlegaltexts-0.2.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

germanlegaltexts-0.2.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file germanlegaltexts-0.2.1.tar.gz.

File metadata

  • Download URL: germanlegaltexts-0.2.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 3eaf22ceaa7a74f2d5d04676fbe84cb3c46023284291d887041ddcd7b155674b
MD5 ef08869f1fafc5c29d419e4ceb0814e0
BLAKE2b-256 d04820e8921ca3d1ae282e792009120917056cdb13673749a75860f16902dd63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: germanlegaltexts-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23c6784c58a117d488d7d80b785c6a9cad5971b7a6b3c955d4c0ddb0f70ff870
MD5 ccfdb6eae39fe399fb3d0b35db427c73
BLAKE2b-256 15df0b3ce2111ba7538bece27cb15e3cd932fa9aede6a27a4cfdf0d508b35b88

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