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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plz_to_bundesland-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 56315a1fd1b357ffcd7f0acbcc1cd1b03cf44b8d28ad2a1e0b9fed6cb5d1bbd0
MD5 a694fb34bbdfaf4ffc6a2f449aa5ebf7
BLAKE2b-256 a73859eb2c62f32e4e13d93b7aff9b8d22ff404f4bfbee6bf3b4a7af9ef52af8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plz_to_bundesland-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d1d4e9c0676a9c83f4ba33d2cbfd38b52ec10bca0fce2f22a2ff1de49e495e3
MD5 c948e3930fc4dc571ff0efa9fd88380e
BLAKE2b-256 8f5743eaa0fadd6ea6440fa11a2bfb75901e080f57a9e4885a309e9204983233

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