Skip to main content

User Guide

This guide is for developers who consume dlubal.api.geo_zone_tool in their applications.

Install

pip install dlubal.api.geo_zone_tool

Import

from dlubal.api import geo_zone_tool

Authentication

A token is optional. These methods are public and work without one:

  • get_geo_locations
  • get_load_zone_standards
  • get_hazard_data

The remaining methods require a token; calling them without one raises a ValueError.

from dlubal.api import geo_zone_tool

# Public methods only
geo_zone = geo_zone_tool.GeoZoneTool()

# All methods
geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")

Sync vs Async

GeoZoneTool is synchronous. AsyncGeoZoneTool exposes the same methods as coroutines for use inside an event loop.

import asyncio
from dlubal.api import geo_zone_tool

async def main():
    geo_zone = geo_zone_tool.AsyncGeoZoneTool("<your-token>")
    user = await geo_zone.get_user_data()
    print(user)

asyncio.run(main())

The examples below use the sync client.

Common Enums

  • geo_zone_tool.Language (EN, DE, IT, CS, FR, ES, PT, PL, RU, ZH)
  • geo_zone_tool.LoadZoneType (SNOW, WIND, SEISMIC, TORNADO)
  • geo_zone_tool.ScreenshotType (PNG, JPEG)
  • geo_zone_tool.MapMode (ZONES, TERRAIN_CATEGORY)
  • geo_zone_tool.RiskCategory (I, II, III, IV)
  • geo_zone_tool.SiteClass (DEFAULT, A, B, BC, C, CD, D, DE, E)
  • geo_zone_tool.AsceVersion (ASCE22, ASCE16)

Examples

Find Locations

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool()  # public method
locations = geo_zone.get_geo_locations(
    address="Flugplatzweg 6, 14913, Germany",
    language=geo_zone_tool.Language.EN,
)

for loc in locations.locations:
    print(loc)

Get User Info

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")
user = geo_zone.get_user_data()
print(user)

Get Available Standards

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool()  # public method
standards = geo_zone.get_load_zone_standards(
    country_code="DE",
    language=geo_zone_tool.Language.EN,
)

print(f"{standards.country} ({standards.country_code})")
for group in standards.type_groups:
    print(f"  {group.name}")
    for item in group.load_zones:
        print(f"    {item.standard.name} / {item.annex.name}")

Get Load Zone Characteristics

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")
result = geo_zone.get_load_zone_characteristics(
    address="Flugplatzweg 6, 14913, Germany",
    load_zone_type=geo_zone_tool.LoadZoneType.SNOW,
    standard="EN 1991-1-3",
    annex="DIN EN 1991-1-3",
    layer_id=1,
    language=geo_zone_tool.Language.EN,
)

print(result)

Each entry in result.characteristics has an optional terrain_category (range, symbol); it is None when the load zone has no terrain category.

Get Screenshot (Base64)

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")
screenshot = geo_zone.get_load_zone_screenshot(
    address="Flugplatzweg 6, 14913, Germany",
    load_zone_type=geo_zone_tool.LoadZoneType.SNOW,
    standard="EN 1991-1-3",
    annex="DIN EN 1991-1-3",
    layer_id=1,
    zoom=6,
    screenshot_type=geo_zone_tool.ScreenshotType.JPEG,
    screenshot_quality=80,
)

print(screenshot.screenshot[:40])  # base64 prefix

map_mode is optional. MapMode.TERRAIN_CATEGORY renders the terrain category map instead of the load zones; load zones without terrain category data fall back to the zones map. Leave it out to get the zones map (MapMode.ZONES).

terrain = geo_zone.get_load_zone_screenshot(
    address="Flugplatzweg 6, 14913, Germany",
    load_zone_type=geo_zone_tool.LoadZoneType.WIND,
    standard="EN 1991-1-4",
    annex="DIN EN 1991-1-4",
    layer_id=3,
    zoom=6,
    map_mode=geo_zone_tool.MapMode.TERRAIN_CATEGORY,
)

Stream PDF Progress

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")
for msg in geo_zone.get_load_zone_pdf(
    address="Flugplatzweg 6, 14913, Germany",
    standard="EN 1991-1-3",
    annex="DIN EN 1991-1-3",
    layer_id=1,
):
    print(f"[{msg.current_step}/{msg.steps}] {msg.message}")

Get Final PDF (Base64)

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool("<your-token>")
pdf_result = geo_zone.get_load_zone_pdf_result(
    address="Flugplatzweg 6, 14913, Germany",
    standard="EN 1991-1-3",
    annex="DIN EN 1991-1-3",
    layer_id=1,
)

if pdf_result is not None:
    print(pdf_result.name)
    print(pdf_result.pdf[:40])  # base64 prefix

Get Seismic Hazard Data (ASCE)

Returns seismic hazard / design map parameters from USGS for a given US location, risk category, and site class. Only AsceVersion.ASCE22 (the default) is currently available; ASCE16 raises TransportError.

from dlubal.api import geo_zone_tool

geo_zone = geo_zone_tool.GeoZoneTool()  # public method
result = geo_zone.get_hazard_data(
    latitude="37.7749",
    longitude="-122.4194",
    risk_category=geo_zone_tool.RiskCategory.II,
    site_class=geo_zone_tool.SiteClass.D,
    asce_version=geo_zone_tool.AsceVersion.ASCE22,
)

if result.data is not None:
    data = result.data
    print(f"reference: {result.reference_document}")
    print(f"Sds = {data.sds}")
    print(f"Sd1 = {data.sd1}")
    print(f"SDC = {data.sdc}")

Error Handling

All SDK errors derive from geo_zone_tool.GeoZoneError:

  • ValidationError — invalid input (empty strings, out-of-range numbers). It subclasses ValueError, so except ValueError still catches it. A wrong enum type raises TypeError.
  • TransportError — a network/transport failure or a non-OK server response.
from dlubal.api import geo_zone_tool
from dlubal.api.geo_zone_tool import GeoZoneError

try:
    geo_zone_tool.GeoZoneTool("<your-token>").get_geo_locations(address="Berlin")
except GeoZoneError as exc:
    print(f"GeoZone call failed: {exc}")

Metadata

Release files for dlubal.api.geo-zone-tool 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dlubal.api.geo-zone-tool 0.3.3
File Size Uploaded Provenance Actions
dlubal_api_geo_zone_tool-0.3.3.tar.gz 40.4 kB Without provenance Details for dlubal_api_geo_zone_tool-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dlubal.api.geo-zone-tool 0.3.3
File Interpreter ABI Platform Actions
dlubal_api_geo_zone_tool-0.3.3-py3-none-any.whl Python 3 none any Details for dlubal_api_geo_zone_tool-0.3.3-py3-none-any.whl

Total release size: 76.9 kB

Release files / dlubal_api_geo_zone_tool-0.3.3.tar.gz

Download URL dlubal_api_geo_zone_tool-0.3.3.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
46be6d23845839873f8c76472725ff5df0285225a238c7fbc35c889019db162e
BLAKE2b-256 checksum
How to use checksums
c7814eb1c0ce08ba86e6c4be6e0a223a03ef2e79bf049d094d5b4449cd5a0f42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dlubal_api_geo_zone_tool-0.3.3-py3-none-any.whl

Download URL dlubal_api_geo_zone_tool-0.3.3-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c423a9cf8e8f526b6de66fc50fc42c44164f239b74b602ae40e58ff295d5533a
BLAKE2b-256 checksum
How to use checksums
ea16472981ab6025905d10c7d85034640df21efb5e2cec96922f352014acc7be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for dlubal.api.geo-zone-tool 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page