Metadata-Version: 2.4
Name: earthscope-s3-client
Version: 0.1.0
Summary: Read miniSEED waveforms directly from EarthScope's (or any) S3 bucket, mirroring obspy's Client.get_waveforms.
Author-email: Sophia Parafina <sophia.parafina@earthscope.org>
License: MIT
Project-URL: Homepage, https://github.com/sparafina-earthscope/earthscope-s3-client
Project-URL: Repository, https://github.com/sparafina-earthscope/earthscope-s3-client
Keywords: seismology,miniseed,obspy,s3,earthscope,fdsn
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: boto3>=1.26
Requires-Dist: obspy>=1.3
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# earthscope-s3-client

Read miniSEED waveforms directly from S3, mirroring `obspy.clients.fdsn.Client.get_waveforms`.

Defaults to EarthScope's public AWS Open Data bucket (`s3://earthscope-geophysical-data/miniseed`,
`us-east-2`, unsigned/anonymous access), but every aspect of the connection (bucket path, region,
credentials, endpoint) and the key layout is configurable, so the same client works against any S3
bucket that stores day-volume miniSEED files.

## Installing

```
pip install -e .          # editable install for development
pip install -e ".[test]"  # + pytest, for running tests/
```

## Usage

```python
from obspy import UTCDateTime
from earthscope_s3_client import EarthScopeS3Client

client = EarthScopeS3Client()

st = client.get_waveforms(
    network="IU", station="ANMO", location="00", channel="BHZ",
    starttime=UTCDateTime("2023-01-01T00:00:00"),
    endtime=UTCDateTime("2023-01-01T00:10:00"),
)
st.write("waveformData.mseed", format="MSEED")
```

Against a private bucket with a different key layout:

```python
client = EarthScopeS3Client(
    bucket_path="s3://my-miniseed",
    anon=False,
    profile_name="my_profile",
    key_template="{station}/{year}/{doy}/{station}.{network}.{year}.{doy}",
)
```

## Running tests

```
pytest tests/
```

## Building and publishing to PyPI

```
python -m pip install build twine
python -m build                                        # writes dist/*.tar.gz and dist/*.whl
python -m twine upload --repository testpypi dist/*    # try it on TestPyPI first
python -m twine upload dist/*                           # then the real PyPI
```

Bump the `version` in `pyproject.toml` (and `__version__` in `src/earthscope_s3_client/__init__.py`)
before each release.
