bpptkg / bpptkg-querybulletin

Simple Python library to query seismic bulletin database

Home Page:https://pypi.org/project/bpptkg-querybulletin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bpptkg-querybulletin

Simple Python library to query seismic bulletin database.

Installation

Install the latest version from PyPI:

pip install -U bpptkg-querybulletin

Install database vendor dependent client package, e.g. for MySQL:

pip install mysqlclient

After the installation, you will have querybulletin program in your executable path.

Database Credentials

Create JSON file in ~/.bulletin/querybulletin/config.json to store your seismic bulletin database credentials. For example:

{
  "dburl": "mysql://user:password@localhost/seismic_bulletin"
}

If you have custom config file path, add -c or --config option to the full path of JSON config file in the script arguments.

Examples

Query bulletin for certain time range:

querybulletin -s "2021-08-01 06:00:00" -e "2021-08-10 06:00:00"

Query bulletin for certain time range and event type:

querybulletin -s "2021-08-01 06:00:00" -e "2021-08-10 06:00:00" -t VTB

Query bulletin for certain event ID:

querybulletin -u "2021-07#2355"

Store output to the CSV file:

querybulletin -s "2021-08-01 06:00:00" -e "2021-08-10 06:00:00" -t VTB -o bulletin.csv

To see all program options, run:

querybulletin -h

License

MIT

About

Simple Python library to query seismic bulletin database

https://pypi.org/project/bpptkg-querybulletin/

License:MIT License


Languages

Language:Python 96.7%Language:Shell 3.3%