pymseed 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. pymseed-0.0.1/LICENSE +201 -0
  2. pymseed-0.0.1/MANIFEST.in +19 -0
  3. pymseed-0.0.1/PKG-INFO +194 -0
  4. pymseed-0.0.1/README.md +142 -0
  5. pymseed-0.0.1/cffi_module/README_libmseed.md +32 -0
  6. pymseed-0.0.1/cffi_module/cffi_defs.py +358 -0
  7. pymseed-0.0.1/cffi_module/libmseed/.clang-format +6 -0
  8. pymseed-0.0.1/cffi_module/libmseed/.gitignore +13 -0
  9. pymseed-0.0.1/cffi_module/libmseed/ChangeLog +1457 -0
  10. pymseed-0.0.1/cffi_module/libmseed/INSTALL.md +48 -0
  11. pymseed-0.0.1/cffi_module/libmseed/LICENSE +201 -0
  12. pymseed-0.0.1/cffi_module/libmseed/Makefile +119 -0
  13. pymseed-0.0.1/cffi_module/libmseed/Makefile.win +49 -0
  14. pymseed-0.0.1/cffi_module/libmseed/README.byteorder +25 -0
  15. pymseed-0.0.1/cffi_module/libmseed/README.md +32 -0
  16. pymseed-0.0.1/cffi_module/libmseed/crc32c.c +410 -0
  17. pymseed-0.0.1/cffi_module/libmseed/doc/Doxyfile +2739 -0
  18. pymseed-0.0.1/cffi_module/libmseed/doc/DoxygenLayout.xml +196 -0
  19. pymseed-0.0.1/cffi_module/libmseed/doc/build-push-docs.sh +100 -0
  20. pymseed-0.0.1/cffi_module/libmseed/doc/capabilities.dox +78 -0
  21. pymseed-0.0.1/cffi_module/libmseed/doc/customdoxygen.css +20 -0
  22. pymseed-0.0.1/cffi_module/libmseed/doc/examples.dox +96 -0
  23. pymseed-0.0.1/cffi_module/libmseed/doc/faq.dox +110 -0
  24. pymseed-0.0.1/cffi_module/libmseed/doc/footer.html +8 -0
  25. pymseed-0.0.1/cffi_module/libmseed/doc/mainpage.dox +77 -0
  26. pymseed-0.0.1/cffi_module/libmseed/doc/porting.dox +179 -0
  27. pymseed-0.0.1/cffi_module/libmseed/doc/tutorial.dox +191 -0
  28. pymseed-0.0.1/cffi_module/libmseed/example/Makefile +49 -0
  29. pymseed-0.0.1/cffi_module/libmseed/example/Makefile.win +29 -0
  30. pymseed-0.0.1/cffi_module/libmseed/example/README +8 -0
  31. pymseed-0.0.1/cffi_module/libmseed/example/lm_pack.c +373 -0
  32. pymseed-0.0.1/cffi_module/libmseed/example/lm_pack_rollingbuffer.c +148 -0
  33. pymseed-0.0.1/cffi_module/libmseed/example/lm_pararead.c +188 -0
  34. pymseed-0.0.1/cffi_module/libmseed/example/lm_parse.c +309 -0
  35. pymseed-0.0.1/cffi_module/libmseed/example/lm_read_buffer.c +107 -0
  36. pymseed-0.0.1/cffi_module/libmseed/example/lm_read_recordlist.c +204 -0
  37. pymseed-0.0.1/cffi_module/libmseed/example/lm_read_selection.c +117 -0
  38. pymseed-0.0.1/cffi_module/libmseed/example/lm_sids.c +132 -0
  39. pymseed-0.0.1/cffi_module/libmseed/example/lm_timestr.c +118 -0
  40. pymseed-0.0.1/cffi_module/libmseed/example/mseedview.c +235 -0
  41. pymseed-0.0.1/cffi_module/libmseed/extraheaders.c +1227 -0
  42. pymseed-0.0.1/cffi_module/libmseed/extraheaders.h +50 -0
  43. pymseed-0.0.1/cffi_module/libmseed/fileutils.c +1064 -0
  44. pymseed-0.0.1/cffi_module/libmseed/genutils.c +2024 -0
  45. pymseed-0.0.1/cffi_module/libmseed/gmtime64.c +185 -0
  46. pymseed-0.0.1/cffi_module/libmseed/gmtime64.h +22 -0
  47. pymseed-0.0.1/cffi_module/libmseed/libmseed.def +101 -0
  48. pymseed-0.0.1/cffi_module/libmseed/libmseed.h +1520 -0
  49. pymseed-0.0.1/cffi_module/libmseed/libmseed.map +15 -0
  50. pymseed-0.0.1/cffi_module/libmseed/logging.c +657 -0
  51. pymseed-0.0.1/cffi_module/libmseed/lookup.c +239 -0
  52. pymseed-0.0.1/cffi_module/libmseed/mseed.pc.in +11 -0
  53. pymseed-0.0.1/cffi_module/libmseed/mseedformat.h +661 -0
  54. pymseed-0.0.1/cffi_module/libmseed/msio.c +762 -0
  55. pymseed-0.0.1/cffi_module/libmseed/msio.h +44 -0
  56. pymseed-0.0.1/cffi_module/libmseed/msrutils.c +416 -0
  57. pymseed-0.0.1/cffi_module/libmseed/pack.c +2390 -0
  58. pymseed-0.0.1/cffi_module/libmseed/packdata.c +724 -0
  59. pymseed-0.0.1/cffi_module/libmseed/packdata.h +55 -0
  60. pymseed-0.0.1/cffi_module/libmseed/parseutils.c +1355 -0
  61. pymseed-0.0.1/cffi_module/libmseed/selection.c +931 -0
  62. pymseed-0.0.1/cffi_module/libmseed/test/Makefile +57 -0
  63. pymseed-0.0.1/cffi_module/libmseed/test/Makefile.win +22 -0
  64. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-defaults.mseed2 +0 -0
  65. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-defaults.mseed3 +0 -0
  66. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-float32.mseed2 +0 -0
  67. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-float32.mseed3 +0 -0
  68. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-float64.mseed2 +0 -0
  69. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-float64.mseed3 +0 -0
  70. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-int16.mseed2 +0 -0
  71. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-int16.mseed3 +0 -0
  72. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-int32.mseed2 +0 -0
  73. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-int32.mseed3 +0 -0
  74. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-nsec.mseed2 +0 -0
  75. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-nsec.mseed3 +0 -0
  76. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-olden.mseed2 +0 -0
  77. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-olden.mseed3 +0 -0
  78. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-repack.mseed2 +0 -0
  79. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-repack.mseed3 +0 -0
  80. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim1-LE.mseed2 +0 -0
  81. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim1.mseed2 +0 -0
  82. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim1.mseed3 +0 -0
  83. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim2-LE.mseed2 +0 -0
  84. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim2.mseed2 +0 -0
  85. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-steim2.mseed3 +0 -0
  86. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-text.mseed2 +0 -0
  87. pymseed-0.0.1/cffi_module/libmseed/test/data/reference-testdata-text.mseed3 +0 -0
  88. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-3channel-signal.mseed2 +0 -0
  89. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-3channel-signal.mseed3 +0 -0
  90. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-detection.record.mseed2 +0 -0
  91. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-encoding-CDSN.mseed2 +0 -0
  92. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-encoding-DWWSSN.mseed2 +0 -0
  93. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-encoding-GEOSCOPE-16bit-3exp-encoded.mseed2 +0 -0
  94. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-encoding-SRO.mseed2 +0 -0
  95. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-invalid-blockette-offsets.mseed2 +0 -0
  96. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-no-blockette1000-steim1.mseed2 +0 -0
  97. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-oneseries-mixedlengths-mixedorder.mseed2 +0 -0
  98. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-oneseries-mixedlengths-mixedorder.mseed3 +0 -0
  99. pymseed-0.0.1/cffi_module/libmseed/test/data/testdata-unapplied-timecorrection.mseed2 +0 -0
  100. pymseed-0.0.1/cffi_module/libmseed/test/lm_pack.c +373 -0
  101. pymseed-0.0.1/cffi_module/libmseed/test/lm_pack_rollingbuffer.c +148 -0
  102. pymseed-0.0.1/cffi_module/libmseed/test/lm_parse.c +309 -0
  103. pymseed-0.0.1/cffi_module/libmseed/test/lm_read_buffer.c +107 -0
  104. pymseed-0.0.1/cffi_module/libmseed/test/lm_read_recordlist.c +204 -0
  105. pymseed-0.0.1/cffi_module/libmseed/test/lm_read_selection.c +117 -0
  106. pymseed-0.0.1/cffi_module/libmseed/test/lm_sids.c +132 -0
  107. pymseed-0.0.1/cffi_module/libmseed/test/lm_timestr.c +118 -0
  108. pymseed-0.0.1/cffi_module/libmseed/test/tau/compilers.h +183 -0
  109. pymseed-0.0.1/cffi_module/libmseed/test/tau/misc.h +81 -0
  110. pymseed-0.0.1/cffi_module/libmseed/test/tau/tau.h +1298 -0
  111. pymseed-0.0.1/cffi_module/libmseed/test/tau/types.h +155 -0
  112. pymseed-0.0.1/cffi_module/libmseed/test/test-crc.c +160 -0
  113. pymseed-0.0.1/cffi_module/libmseed/test/test-extraheaders.c +275 -0
  114. pymseed-0.0.1/cffi_module/libmseed/test/test-msrutils.c +69 -0
  115. pymseed-0.0.1/cffi_module/libmseed/test/test-read.c +473 -0
  116. pymseed-0.0.1/cffi_module/libmseed/test/test-repack.c +100 -0
  117. pymseed-0.0.1/cffi_module/libmseed/test/test-runner.c +144 -0
  118. pymseed-0.0.1/cffi_module/libmseed/test/test-selection.c +70 -0
  119. pymseed-0.0.1/cffi_module/libmseed/test/test-sid.c +124 -0
  120. pymseed-0.0.1/cffi_module/libmseed/test/test-time.c +132 -0
  121. pymseed-0.0.1/cffi_module/libmseed/test/test-tracelist.c +222 -0
  122. pymseed-0.0.1/cffi_module/libmseed/test/test-write.c +385 -0
  123. pymseed-0.0.1/cffi_module/libmseed/test/testdata.h +105 -0
  124. pymseed-0.0.1/cffi_module/libmseed/tracelist.c +2562 -0
  125. pymseed-0.0.1/cffi_module/libmseed/unpack.c +1682 -0
  126. pymseed-0.0.1/cffi_module/libmseed/unpack.h +44 -0
  127. pymseed-0.0.1/cffi_module/libmseed/unpackdata.c +960 -0
  128. pymseed-0.0.1/cffi_module/libmseed/unpackdata.h +59 -0
  129. pymseed-0.0.1/cffi_module/libmseed/yyjson.c +9473 -0
  130. pymseed-0.0.1/cffi_module/libmseed/yyjson.h +7924 -0
  131. pymseed-0.0.1/development.txt +74 -0
  132. pymseed-0.0.1/examples/read_numpy.py +63 -0
  133. pymseed-0.0.1/examples/stream_stats.py +59 -0
  134. pymseed-0.0.1/examples/stream_timewindow.py +130 -0
  135. pymseed-0.0.1/examples/write_with_buffer.py +139 -0
  136. pymseed-0.0.1/pyproject.toml +206 -0
  137. pymseed-0.0.1/setup.cfg +4 -0
  138. pymseed-0.0.1/setup.py +76 -0
  139. pymseed-0.0.1/src/pymseed/__init__.py +50 -0
  140. pymseed-0.0.1/src/pymseed/__version__.py +2 -0
  141. pymseed-0.0.1/src/pymseed/clib.py +41 -0
  142. pymseed-0.0.1/src/pymseed/definitions.py +52 -0
  143. pymseed-0.0.1/src/pymseed/exceptions.py +28 -0
  144. pymseed-0.0.1/src/pymseed/msrecord.py +584 -0
  145. pymseed-0.0.1/src/pymseed/msrecord_buffer_reader.py +86 -0
  146. pymseed-0.0.1/src/pymseed/msrecord_reader.py +113 -0
  147. pymseed-0.0.1/src/pymseed/mstracelist.py +804 -0
  148. pymseed-0.0.1/src/pymseed/util.py +113 -0
  149. pymseed-0.0.1/src/pymseed.egg-info/PKG-INFO +194 -0
  150. pymseed-0.0.1/src/pymseed.egg-info/SOURCES.txt +162 -0
  151. pymseed-0.0.1/src/pymseed.egg-info/dependency_links.txt +1 -0
  152. pymseed-0.0.1/src/pymseed.egg-info/not-zip-safe +1 -0
  153. pymseed-0.0.1/src/pymseed.egg-info/requires.txt +28 -0
  154. pymseed-0.0.1/src/pymseed.egg-info/top_level.txt +2 -0
  155. pymseed-0.0.1/tests/data/packtest_sine2000.mseed3 +0 -0
  156. pymseed-0.0.1/tests/data/packtest_sine500.mseed2 +0 -0
  157. pymseed-0.0.1/tests/data/packtest_sine500.mseed3 +0 -0
  158. pymseed-0.0.1/tests/data/testdata-COLA-signal.mseed2 +0 -0
  159. pymseed-0.0.1/tests/data/testdata-COLA-signal.mseed3 +0 -0
  160. pymseed-0.0.1/tests/test_msrecord.py +143 -0
  161. pymseed-0.0.1/tests/test_msrecord_buffer_reader.py +109 -0
  162. pymseed-0.0.1/tests/test_msrecord_reader.py +104 -0
  163. pymseed-0.0.1/tests/test_mstracelist.py +346 -0
  164. pymseed-0.0.1/tests/test_util.py +292 -0
pymseed-0.0.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,19 @@
1
+ # Include the cffi module and libmseed source code
2
+ recursive-include cffi_module *.py *.c *.h *.md *.txt *.in *.pc.in *.def *.map
3
+ recursive-include cffi_module/libmseed *
4
+ recursive-exclude cffi_module/libmseed *.o *.a *.lib *.so *.dll *.pyd
5
+
6
+ # Include examples
7
+ recursive-include examples *.py
8
+
9
+ # Include test data
10
+ recursive-include tests/data *
11
+
12
+ # Include development files
13
+ include development.txt
14
+
15
+ # Standard files already included by default
16
+ include LICENSE
17
+ include README.md
18
+ include pyproject.toml
19
+ include setup.py
pymseed-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymseed
3
+ Version: 0.0.1
4
+ Summary: A Python package for reading and writing miniSEED formatted data
5
+ Author-email: EarthScope Data Services <software@earthscope.org>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/EarthScope/pymseed
8
+ Project-URL: Repository, https://github.com/EarthScope/pymseed
9
+ Project-URL: Issues, https://github.com/EarthScope/pymseed/issues
10
+ Keywords: seismology,miniseed,mseed,data,waveform,seismic
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Topic :: Scientific/Engineering
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Operating System :: POSIX :: Other
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: Implementation :: CPython
25
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
26
+ Requires-Python: >=3.9
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: cffi>=1.15.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
33
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
34
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
35
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
36
+ Provides-Extra: numpy
37
+ Requires-Dist: numpy>=1.21.0; extra == "numpy"
38
+ Provides-Extra: docs
39
+ Requires-Dist: sphinx>=5.0.0; extra == "docs"
40
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
41
+ Requires-Dist: sphinxcontrib-napoleon>=0.7; extra == "docs"
42
+ Provides-Extra: test
43
+ Requires-Dist: pytest>=7.0.0; extra == "test"
44
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
45
+ Requires-Dist: numpy>=1.21.0; extra == "test"
46
+ Provides-Extra: release
47
+ Requires-Dist: build>=0.10.0; extra == "release"
48
+ Requires-Dist: twine>=4.0.0; extra == "release"
49
+ Provides-Extra: all
50
+ Requires-Dist: pymseed[dev,docs,numpy,test]; extra == "all"
51
+ Dynamic: license-file
52
+
53
+ # pymseed - a Python package to read and write miniSEED formatted data
54
+
55
+ The pymseed package allows for reading and writing of miniSEED
56
+ time series data. Both [miniSEED version 2](https://fdsn.org/pdf/SEEDManual_V2.4.pdf)
57
+ (defined in the SEED standard) and [miniSEED version 3](https://docs.fdsn.org/projects/miniseed3)
58
+ are supported.
59
+
60
+ The package is based on the C-language [libmseed](https://earthscope.github.io/libmseed)
61
+ for most of the data format and manipulation work.
62
+
63
+ ## Installation
64
+
65
+ The [releases](https://pypi.org/project/pymseed/) should be installed
66
+ directly from PyPI with, for example, `pip install pymseed`.
67
+
68
+ The package is built using [CFFI](https://cffi.readthedocs.io/) and supports
69
+ multiple Python implementations including CPython and PyPy for broad usability.
70
+
71
+ If using numpy features use optional dependency "numpy" or install it independently
72
+ e.g. `pip install pymseed[numpy]`.
73
+
74
+ For package develop use optional dependency "dev" for needed dependencies
75
+ e.g. `pip install pymseed[dev]`.
76
+
77
+ ## Example usage
78
+
79
+ Working programs for a variety of use cases ca be found in the
80
+ [examples](https://github.com/EarthScope/pymseed/tree/main/examples) directory of the repository.
81
+
82
+ Read a file and print details from each record:
83
+ ```Python
84
+ from pymseed import MS3RecordReader,TimeFormat
85
+
86
+ input_file = 'testdata-3channel-signal.mseed3'
87
+
88
+ with MS3RecordReader(input_file) as msreader:
89
+ for msr in msreader:
90
+ # Print values directly
91
+ print(f' SourceID: {msr.sourceid}, record length {msr.reclen}')
92
+ print(f' Start Time: {msr.starttime_str(timeformat=TimeFormat.ISOMONTHDAY_SPACE_Z)}')
93
+ print(f' Samples: {msr.samplecnt}')
94
+
95
+ # Alternatively, use the library print function
96
+ msr.print()
97
+ ```
98
+
99
+ Read a file into a trace list and print the list:
100
+ ```Python
101
+ from pymseed import MS3TraceList
102
+
103
+ input_file = 'testdata-3channel-signal.mseed3'
104
+
105
+ mstl = MS3TraceList(input_file)
106
+
107
+ # Print the trace list using the library print function
108
+ mstl.print(details=1, gaps=True)
109
+
110
+ # Alternatively, traverse the data structures and print each trace ID and segment
111
+ for traceid in mstl.traceids():
112
+ print(traceid)
113
+
114
+ for segment in traceid.segments():
115
+ print(' ', segment)
116
+ ```
117
+
118
+ Writing miniSEED requires specifying a "record handler" function that is
119
+ a callback to consume, and do whatever you want, with generated records.
120
+
121
+ Simple example of writing multiple channels of data:
122
+ ```Python
123
+ import math
124
+ from pymseed import MS3TraceList, timestr2nstime
125
+
126
+ # Generate synthetic sinusoid data, starting at 0, 45, and 90 degrees
127
+ data0 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(0, 500)))
128
+ data1 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(45, 500 + 45)))
129
+ data2 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(90, 500 + 90)))
130
+
131
+ mstl = MS3TraceList()
132
+
133
+ sample_rate = 40.0
134
+ start_time = timestr2nstime("2024-01-01T15:13:55.123456789Z")
135
+ format_version = 2
136
+ record_length = 512
137
+
138
+ # Add synthetic data to the trace list
139
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_1",
140
+ data_samples=data0, sample_type='i',
141
+ sample_rate=sample_rate, start_time=start_time)
142
+
143
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_2",
144
+ data_samples=data1, sample_type='i',
145
+ sample_rate=sample_rate, start_time=start_time)
146
+
147
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_3",
148
+ data_samples=data2, sample_type='i',
149
+ sample_rate=sample_rate, start_time=start_time)
150
+
151
+ # Record handler called for each generated record
152
+ def record_handler(record, handler_data):
153
+ handler_data['fh'].write(record)
154
+
155
+ output_file = 'output.mseed'
156
+
157
+ with open(output_file, 'wb') as file_handle:
158
+ # Generate miniSEED records
159
+ mstl.pack(record_handler,
160
+ {'fh':file_handle},
161
+ format_version=format_version,
162
+ record_length=record_length,
163
+ flush_data=True)
164
+ ```
165
+
166
+ ## Package design rationale
167
+
168
+ The package functionality and exposed API are designed to support the most
169
+ common use cases of reading and writing miniSEED data using `libmseed`.
170
+ Extensions of data handling beyond the functionality of the library are
171
+ out-of-scope for this package. Furthermore, the naming of functions, classes,
172
+ arguments, etc. often follows the naming used in the library in order to
173
+ reference their fundamentals at the C level if needed; even though this leaves
174
+ some names distinctly non-Pythonic.
175
+
176
+ In a nutshell, the goal of this package is to provide just enough of a Python
177
+ layer to `libmseed` to handle the most common cases of miniSEED data without
178
+ needing to know any of the C-level details.
179
+
180
+ ## License
181
+
182
+ Licensed under the Apache License, Version 2.0 (the "License");
183
+ you may not use this file except in compliance with the License.
184
+ You may obtain a copy of the License at
185
+
186
+ [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
187
+
188
+ Unless required by applicable law or agreed to in writing, software
189
+ distributed under the License is distributed on an "AS IS" BASIS,
190
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191
+ See the License for the specific language governing permissions and
192
+ limitations under the License.
193
+
194
+ Copyright (C) 2025 EarthScope Data Services
@@ -0,0 +1,142 @@
1
+ # pymseed - a Python package to read and write miniSEED formatted data
2
+
3
+ The pymseed package allows for reading and writing of miniSEED
4
+ time series data. Both [miniSEED version 2](https://fdsn.org/pdf/SEEDManual_V2.4.pdf)
5
+ (defined in the SEED standard) and [miniSEED version 3](https://docs.fdsn.org/projects/miniseed3)
6
+ are supported.
7
+
8
+ The package is based on the C-language [libmseed](https://earthscope.github.io/libmseed)
9
+ for most of the data format and manipulation work.
10
+
11
+ ## Installation
12
+
13
+ The [releases](https://pypi.org/project/pymseed/) should be installed
14
+ directly from PyPI with, for example, `pip install pymseed`.
15
+
16
+ The package is built using [CFFI](https://cffi.readthedocs.io/) and supports
17
+ multiple Python implementations including CPython and PyPy for broad usability.
18
+
19
+ If using numpy features use optional dependency "numpy" or install it independently
20
+ e.g. `pip install pymseed[numpy]`.
21
+
22
+ For package develop use optional dependency "dev" for needed dependencies
23
+ e.g. `pip install pymseed[dev]`.
24
+
25
+ ## Example usage
26
+
27
+ Working programs for a variety of use cases ca be found in the
28
+ [examples](https://github.com/EarthScope/pymseed/tree/main/examples) directory of the repository.
29
+
30
+ Read a file and print details from each record:
31
+ ```Python
32
+ from pymseed import MS3RecordReader,TimeFormat
33
+
34
+ input_file = 'testdata-3channel-signal.mseed3'
35
+
36
+ with MS3RecordReader(input_file) as msreader:
37
+ for msr in msreader:
38
+ # Print values directly
39
+ print(f' SourceID: {msr.sourceid}, record length {msr.reclen}')
40
+ print(f' Start Time: {msr.starttime_str(timeformat=TimeFormat.ISOMONTHDAY_SPACE_Z)}')
41
+ print(f' Samples: {msr.samplecnt}')
42
+
43
+ # Alternatively, use the library print function
44
+ msr.print()
45
+ ```
46
+
47
+ Read a file into a trace list and print the list:
48
+ ```Python
49
+ from pymseed import MS3TraceList
50
+
51
+ input_file = 'testdata-3channel-signal.mseed3'
52
+
53
+ mstl = MS3TraceList(input_file)
54
+
55
+ # Print the trace list using the library print function
56
+ mstl.print(details=1, gaps=True)
57
+
58
+ # Alternatively, traverse the data structures and print each trace ID and segment
59
+ for traceid in mstl.traceids():
60
+ print(traceid)
61
+
62
+ for segment in traceid.segments():
63
+ print(' ', segment)
64
+ ```
65
+
66
+ Writing miniSEED requires specifying a "record handler" function that is
67
+ a callback to consume, and do whatever you want, with generated records.
68
+
69
+ Simple example of writing multiple channels of data:
70
+ ```Python
71
+ import math
72
+ from pymseed import MS3TraceList, timestr2nstime
73
+
74
+ # Generate synthetic sinusoid data, starting at 0, 45, and 90 degrees
75
+ data0 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(0, 500)))
76
+ data1 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(45, 500 + 45)))
77
+ data2 = list(map(lambda x: int(math.sin(math.radians(x)) * 500), range(90, 500 + 90)))
78
+
79
+ mstl = MS3TraceList()
80
+
81
+ sample_rate = 40.0
82
+ start_time = timestr2nstime("2024-01-01T15:13:55.123456789Z")
83
+ format_version = 2
84
+ record_length = 512
85
+
86
+ # Add synthetic data to the trace list
87
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_1",
88
+ data_samples=data0, sample_type='i',
89
+ sample_rate=sample_rate, start_time=start_time)
90
+
91
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_2",
92
+ data_samples=data1, sample_type='i',
93
+ sample_rate=sample_rate, start_time=start_time)
94
+
95
+ mstl.add_data(sourceid="FDSN:XX_TEST__B_S_3",
96
+ data_samples=data2, sample_type='i',
97
+ sample_rate=sample_rate, start_time=start_time)
98
+
99
+ # Record handler called for each generated record
100
+ def record_handler(record, handler_data):
101
+ handler_data['fh'].write(record)
102
+
103
+ output_file = 'output.mseed'
104
+
105
+ with open(output_file, 'wb') as file_handle:
106
+ # Generate miniSEED records
107
+ mstl.pack(record_handler,
108
+ {'fh':file_handle},
109
+ format_version=format_version,
110
+ record_length=record_length,
111
+ flush_data=True)
112
+ ```
113
+
114
+ ## Package design rationale
115
+
116
+ The package functionality and exposed API are designed to support the most
117
+ common use cases of reading and writing miniSEED data using `libmseed`.
118
+ Extensions of data handling beyond the functionality of the library are
119
+ out-of-scope for this package. Furthermore, the naming of functions, classes,
120
+ arguments, etc. often follows the naming used in the library in order to
121
+ reference their fundamentals at the C level if needed; even though this leaves
122
+ some names distinctly non-Pythonic.
123
+
124
+ In a nutshell, the goal of this package is to provide just enough of a Python
125
+ layer to `libmseed` to handle the most common cases of miniSEED data without
126
+ needing to know any of the C-level details.
127
+
128
+ ## License
129
+
130
+ Licensed under the Apache License, Version 2.0 (the "License");
131
+ you may not use this file except in compliance with the License.
132
+ You may obtain a copy of the License at
133
+
134
+ [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
135
+
136
+ Unless required by applicable law or agreed to in writing, software
137
+ distributed under the License is distributed on an "AS IS" BASIS,
138
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139
+ See the License for the specific language governing permissions and
140
+ limitations under the License.
141
+
142
+ Copyright (C) 2025 EarthScope Data Services
@@ -0,0 +1,32 @@
1
+ # libmseed source management in pymseed
2
+
3
+ This directory contains the CFFI module for libmseed used by pymseed.
4
+ This module is private and used through Python API of pymseed.
5
+
6
+ ## Updating libmseed
7
+
8
+ The libmseed source code is in the `libmseed` subdirectory and is simply the
9
+ sources from a release available from:
10
+ https://github.com/EarthScope/libmseed/releases
11
+
12
+ The CFFI package requires definitions of the C functions, structures, constants,
13
+ etc. to be used from the library. This is in essence the public API expressed
14
+ in `libmseed.h`. The rub is that the CFFI definition parser cannot understand
15
+ complex C headers and so cannot use the library headers directly. The solution
16
+ is to maintain a simplified set of definitions from `libmseed.h` specifically
17
+ for CFFI in the `cffi_defs.py` file.
18
+
19
+ To update to a new release:
20
+ 1. copy the new sources to the `libmseed` directory
21
+ 2. add any new files
22
+ 3. review and update `cffi_defs.py` definitions to make sure it matches any changes in `libmseed.h`
23
+ 4. commit all changes
24
+
25
+ p.s. A CFFI-usable header definitions is manually maintained due to lack of
26
+ robust solutions to parse C headers into the simplified form.
27
+
28
+ ## Dynamic versioning
29
+
30
+ During the CFFI module build process (when building wheels) the version of
31
+ libmseed is extracted and stored in the pymseed package to ensure they are in
32
+ sync.