Skip to main content

A package to convert German postal codes (PLZ) to their corresponding Bundesland

Project description

PLZ to Bundesland Converter

This Python package converts German postal codes (PLZ, Postleitzahl) to their corresponding Bundesland (federal state). It can process individual PLZ inputs or bulk process PLZ data from Excel files.

Installation

You can install the PLZ to Bundesland Converter using pip:

pip install plz-to-bundesland

Usage

As a Python Module

You can use the get_bundesland function in your Python scripts:

from plz_to_bundesland import get_bundesland

bundesland = get_bundesland("10115")
print(bundesland)  # Output: Berlin

Command-line Interface

The package also provides a command-line interface:

  1. To convert a single PLZ:

    plz-to-bundesland -p 10115
    
  2. To process an Excel file:

    plz-to-bundesland -f input.xlsx -o output.xlsx
    

Input Excel File Format

The input Excel file should have the following format:

  • The file must be in .xlsx format.
  • It must contain a column named 'PLZ' (case-sensitive).
  • The 'PLZ' column should contain the postal codes to be converted.
  • Each PLZ should be in a separate row.

Output

When processing an Excel file, the script will create a new Excel file with the following columns:

  • All original columns from the input file
  • A new 'Bundesland' column containing the corresponding federal state for each PLZ

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

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

plz_to_bundesland-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

plz_to_bundesland-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file plz_to_bundesland-0.1.2.tar.gz.

File metadata

  • Download URL: plz_to_bundesland-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for plz_to_bundesland-0.1.2.tar.gz
Algorithm Hash digest
SHA256 95d90607d727cb89ad65e0a4fecea98254c02d9820dbdac492a546fc2ffba896
MD5 b463a922a1775a18ba8233ca7d293db4
BLAKE2b-256 b4a67142d0488528aa018a137d982c3daac77f2f071fccc6cf676d904454f7c9

See more details on using hashes here.

File details

Details for the file plz_to_bundesland-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for plz_to_bundesland-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 497f6525e5feeac21e8936410c28a80b596822c207435d67e092f8379f604b99
MD5 101173c6ba4403b89a12a4224957c50e
BLAKE2b-256 89d6851e7fe0516b0d60b4e416743938c0c6aadda469d8410b6989c350edce06

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