Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
cymseed3
is a Python package for reading and writing MiniSEED files using the libmseed
library Version 3 (currently 3.1.3). This package provides a simple and efficient interface for handling seismic data in the MiniSEED format, making it easy to import, export, and manipulate seismic records.
libmseed
library.Ensure you have Python 3.6 or higher installed. Additionally, you'll need setuptools
, wheel
, and cython
for building the package if you are installing from source.
The easiest way to install cymseed3
is via PyPI, using pip
. This will download and install the latest version of the package, including all dependencies.
pip install cymseed3
This command will automatically handle the installation of all required dependencies, making it the preferred method for most users.
If you want to install cymseed3
from source, for example, to modify the code or contribute to development, follow these steps:
git clone https://github.com/shakelab/cymseed3.git
cd cymseed3
pip install setuptools wheel cython
python3 setup.py build_ext --inplace
pip install -e .
This approach allows you to make changes to the source code and have them immediately available without reinstalling the package.
Here’s an example of how to use cymseed3
to create, write, read, and export MiniSEED data:
from cymseed3 import MiniSeed
# Initialise a Miniseed object
ms = MiniSeed()
record_dict = {
'network' : 'OX',
'station' : 'ABCD',
'location' : '00',
'channel' : 'HHZ',
'starttime' : '2010-01-10T08:23:45.019538Z',
'rate' : 200,
'nsamp' : 100,
'data' : [i for i in range(100)]
}
ms.import_record(record_dict)
# Write data into binary buffer
byte_buffer = ms.write(msformat=2, reclen=512, encoding=11)
# Write bytes to file
with open("my_file.mseed", "wb") as fid:
fid.write(byte_buffer)
# Read the file
with open("my_file.mseed", 'rb') as fid:
byte_buffer = fid.read()
# Read the buffer
ms.read(byte_buffer, verbose=1)
# Export data to a list of dictionaries.
rec_list = ms.export_records()
print(rec_list[0])
Running the example above will print the first record from the MiniSEED file as a Python dictionary, showing details like network, station, channel, and the data itself.
Contributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request. You can also report bugs or suggest new features by opening an issue.
git checkout -b feature/YourFeature
).git commit -am 'Add a new feature'
).git push origin feature/YourFeature
).This project is licensed under the GNU General Public License v3.0 (GPL-3.0). You are free to use, modify, and distribute this software under the terms of the GPL-3.0 license. See the LICENSE file for more details.
cymseed3
uses the libmseed
library for handling MiniSEED files (https://github.com/EarthScope/libmseed). The libmseed
library is distributed by Data EarthScope Services (Copyright (C) 2024 Chad Trabant) under the Apache License, Version 2.0. A copy of the library and its license is included in this package.
If you have any questions or need help, please open an issue on the GitHub repository or contact us via email.
FAQs
A Python package for reading and writing miniseed files using libmseed 3.
We found that cymseed3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.