Skip to main content

Python Lib for DHL SOAP API (Germany)

Project description

python_dhl_germany

New WSDL version

install dev

  • create venv: python -m venv venv
  • activate venv:
    • Windows: venv/Scripts/activate
    • Linux / Mac: source venv/bin/activate
  • pip install -r requirements.txt -r requirements_dev.txt
  • pre-commit hook install: pre-commit install --hook-type pre-push
  • create .env file and add DHL_AUTH_USER + DHL_AUTH_PASSWORD variables

build and deploy

  • python setup.py sdist bdist_wheel
  • s3pypi --bucket pypi.fourzero.one

usage

create dhl client:

dhl_client = DHL(
    "DHL_AUTH_USER", # test: DHL-Entwickler User / live: DHL App Name
    "DHL_AUTH_PASSWORD", # test: DHL-Entwickler PW / live: DHL App Token
    "API_USER", # test: 2222222222_01 / live: Geschäftskunden-Portal system user name
    "API_PASSWORD", # test: pass / live: Geschäftskunden-Portal system user pw
    is_test=True,
)

create shipment order:

shipper = {
    "name": "Something Something GmbH",
    "name2": "",
    "street": "Teststraße",
    "street_number": "32",
    "zip": "22222",
    "city": "Bremen",
    "country_code": "DE",
    "phone": "040251090",
    "email": "test@test.com",
    "contact_person": "Test User",
}

receiver = {
    "name": "Test Tester",
    "name2": "TestCompany",
    "street": "Teststraße",
    "street_number": "12",
    "zip": "28217",
    "city": "Bremen",
    "country_code": "DE",
    "careOfName": "",
}

order = {
    "customs": {
        "invoice_no": "1234567",
        "description": "Ziegelsteine",
        "place_of_commital": shipper["city"],
    },
    "positions": [
        {
            "name": "Test Product 1",
            "amount": 2,
            "price": 12.5,
            "weight": 0.15,
            "customs": {
                "country_code_origin": "DE",
                "customs_tariff_number": "49119900",
            },
        },
        {
            "name": "Test Product 2",
            "amount": 3,
            "price": 1.5,
            "weight": 100,
            "customs": {
                "country_code_origin": "DE",
                "customs_tariff_number": "49119900",
            },
        },
    ],
}

dhl_client.create_shipment_order(
    "ORDER_ID",
    shipper, # find example in integration test
    receiver, # find example in integration test
    6.0, # weight
    "V01PAK", # dhl product
    "22222222220101", # dhl account number
    order_to_ship=order, # find example in integration test
)

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

python_dhl_germany-0.3.4.14.tar.gz (65.9 kB view details)

Uploaded Source

Built Distribution

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

python_dhl_germany-0.3.4.14-py3-none-any.whl (76.0 kB view details)

Uploaded Python 3

File details

Details for the file python_dhl_germany-0.3.4.14.tar.gz.

File metadata

  • Download URL: python_dhl_germany-0.3.4.14.tar.gz
  • Upload date:
  • Size: 65.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for python_dhl_germany-0.3.4.14.tar.gz
Algorithm Hash digest
SHA256 da84f6b92bd3b6e1f9d21b1107bab919463cfb113ede9887a55217a8a47d3526
MD5 525d97911c9bdf35e6de0c498ec34da6
BLAKE2b-256 0cbcf3312139cecd56576c93796a87e415ebe4e5d7e9b6fd2d65201722c22ec2

See more details on using hashes here.

File details

Details for the file python_dhl_germany-0.3.4.14-py3-none-any.whl.

File metadata

File hashes

Hashes for python_dhl_germany-0.3.4.14-py3-none-any.whl
Algorithm Hash digest
SHA256 24a4132c6d5b5664aa35e662318320481a82234a3a0cf741b930f955265497ac
MD5 1f5d9f6548c061f3f6959db0ac21f699
BLAKE2b-256 0e91e64c75eb6cd9d94709d1904c4995a3ac83f1a563fdf545b58d8056b22f84

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