Skip to main content

taup_python

Access to the TauP Toolkit from Python via an HTTP server.

The problem is that lots of seismologists like writing Python scripts, but calling a Java library from Python seems somewhere between hard and impossible. But interaction doesn't require direct interoperation. The basic idea of this solution (or bandaid) is that this python library will spin up an instance of taup web, and then use that to answer many queries via http, avoiding the startup time of Java.

You will also need to have an instance of the TauP Toolkit installed. This can be done manually by downloading from Zenodo or from Homebrew via

brew tap crotwell/crotwell
brew trust --formula crotwell/crotwell/taup 
brew install taup

The Python classes representing each tool's query parameters are based off off the command line arguments of the same name. For example, this Python code:

import taup

with taup.TauPServer() as taupserver:
    timeParams = taup.TimeQuery()
    timeParams.phase(["P", "S"])
    timeParams.mod('ak135')
    timeParams.degree(35)
    timeResult = timeParams.calc(taupserver)
    print("Phase  Depth   Dist   Time")
    for a in timeResult.arrivals:
        print(f"{a.phase}      {a.sourcedepth}     {a.distdeg}   {a.time}")

roughly corresponds to this command line:

bin/taup time --ph P,S --mod ak135 --deg 35 --json

Note that if you have many calculations in a loop, you want to have the loop on the inside of the with taup.TauPServer() as taupserver: line so that the server is only started up once.

See example_times.py and others in the examples directory for more detailed examples.

Documentation available at readthedocs for TauP-python

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taup-3.2.0.tar.gz (188.5 kB view details)

Uploaded Source

Built Distribution

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

taup-3.2.0-py3-none-any.whl (86.0 kB view details)

Uploaded Python 3

File details

Details for the file taup-3.2.0.tar.gz.

File metadata

  • Download URL: taup-3.2.0.tar.gz
  • Upload date:
  • Size: 188.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.18.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5.2"},"implementation":{"name":"CPython","version":"3.11.15"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.6.3 9 Jun 2026","python":"3.11.15","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.5.0

File hashes

Hashes for taup-3.2.0.tar.gz
Algorithm Hash digest
SHA256 53126e42cacef8ed9072d0008c8a70bb5e55fe75787a9529dee1aae8dbad9791
MD5 8dc0e8b21de2ad51b26c246e8c9ed7de
BLAKE2b-256 ff4f7dfc3c32b8559b127581cfff404cdc9a14195326cbca04fd279c1699c620

See more details on using hashes here.

File details

Details for the file taup-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: taup-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 86.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.18.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5.2"},"implementation":{"name":"CPython","version":"3.11.15"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.6.3 9 Jun 2026","python":"3.11.15","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.5.0

File hashes

Hashes for taup-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e123211c11a7982e1f024bbf1b127b1970f8a1c5fd118d8f10b6c6d17f8b8a0
MD5 95fd1ddc59fff64d36d3b4c0fd98a17e
BLAKE2b-256 ab3a9123d3d2556105c76e00fd4c68b1c3d88416682290068938744dfdfec288

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 files

0.1.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page