python-calamine 0.8.1__tar.gz → 0.8.3__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.
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.github/workflows/CI.yml +28 -22
- {python_calamine-0.8.1 → python_calamine-0.8.3}/Cargo.lock +13 -13
- {python_calamine-0.8.1 → python_calamine-0.8.3}/Cargo.toml +1 -1
- {python_calamine-0.8.1 → python_calamine-0.8.3}/PKG-INFO +1 -1
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/sheet.rs +5 -1
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/test_base.py +18 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/uv.lock +229 -321
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.github/dependabot.yml +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.github/pyodide/pylock.314.toml +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.github/pyodide/requirements.in +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.gitignore +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/.pre-commit-config.yaml +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/LICENSE +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/README.md +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/build.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/pyproject.toml +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/python/python_calamine/__init__.py +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/python/python_calamine/_python_calamine.pyi +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/python/python_calamine/py.typed +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/lib.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/cell.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/errors.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/mod.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/table.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/src/types/workbook.rs +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/__init__.py +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/conftest.py +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/any_sheets.ods +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/any_sheets.xls +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/any_sheets.xlsb +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/any_sheets.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/base.ods +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/base.xls +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/base.xlsb +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/base.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/empty_file.ods +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/empty_file.xlsb +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/empty_file.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/issue139.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/password.ods +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/password.xls +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/password.xlsb +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/password.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/data/table-multiple.xlsx +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/test_pandas.py +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/test_sheet_type.py +0 -0
- {python_calamine-0.8.1 → python_calamine-0.8.3}/tests/test_tables.py +0 -0
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
PYTHON: ${{ matrix.python-version }}
|
|
51
51
|
|
|
52
52
|
steps:
|
|
53
|
-
- uses: actions/checkout@
|
|
53
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
54
54
|
with:
|
|
55
55
|
persist-credentials: false
|
|
56
56
|
|
|
@@ -61,12 +61,12 @@ jobs:
|
|
|
61
61
|
|
|
62
62
|
- id: cache-rust
|
|
63
63
|
name: cache rust
|
|
64
|
-
uses: Swatinem/rust-cache@
|
|
64
|
+
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
65
65
|
with:
|
|
66
66
|
key: v3
|
|
67
67
|
|
|
68
68
|
- name: set up python
|
|
69
|
-
uses: actions/setup-python@
|
|
69
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
70
70
|
with:
|
|
71
71
|
python-version: ${{ matrix.python-version }}
|
|
72
72
|
allow-prereleases: true
|
|
@@ -110,12 +110,12 @@ jobs:
|
|
|
110
110
|
pylock-suffix: "314"
|
|
111
111
|
|
|
112
112
|
steps:
|
|
113
|
-
- uses: actions/checkout@
|
|
113
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
114
114
|
with:
|
|
115
115
|
persist-credentials: false
|
|
116
116
|
|
|
117
117
|
- name: install uv
|
|
118
|
-
uses: astral-sh/setup-uv@
|
|
118
|
+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
119
119
|
with:
|
|
120
120
|
python-version: ${{ matrix.python-version }}
|
|
121
121
|
enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions
|
|
@@ -141,7 +141,7 @@ jobs:
|
|
|
141
141
|
runs-on: ubuntu-latest
|
|
142
142
|
|
|
143
143
|
steps:
|
|
144
|
-
- uses: actions/checkout@
|
|
144
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
145
145
|
with:
|
|
146
146
|
persist-credentials: false
|
|
147
147
|
|
|
@@ -151,9 +151,9 @@ jobs:
|
|
|
151
151
|
components: rustfmt, clippy
|
|
152
152
|
|
|
153
153
|
- name: cache rust
|
|
154
|
-
uses: Swatinem/rust-cache@
|
|
154
|
+
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
155
155
|
|
|
156
|
-
- uses: actions/setup-python@
|
|
156
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
157
157
|
with:
|
|
158
158
|
python-version: "3.14"
|
|
159
159
|
|
|
@@ -183,7 +183,7 @@ jobs:
|
|
|
183
183
|
runs-on: ubuntu-latest
|
|
184
184
|
steps:
|
|
185
185
|
- name: Decide whether the needed jobs succeeded or failed
|
|
186
|
-
uses: re-actors/alls-green@
|
|
186
|
+
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
|
|
187
187
|
with:
|
|
188
188
|
jobs: ${{ toJSON(needs) }}
|
|
189
189
|
|
|
@@ -257,12 +257,12 @@ jobs:
|
|
|
257
257
|
|
|
258
258
|
runs-on: ${{ matrix.runs-on || format('{0}-latest', (matrix.os == 'linux' && 'ubuntu') || matrix.os) }}
|
|
259
259
|
steps:
|
|
260
|
-
- uses: actions/checkout@
|
|
260
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
261
261
|
with:
|
|
262
262
|
persist-credentials: false
|
|
263
263
|
|
|
264
264
|
- name: set up python
|
|
265
|
-
uses: actions/setup-python@
|
|
265
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
266
266
|
with:
|
|
267
267
|
python-version: "3.14"
|
|
268
268
|
|
|
@@ -293,7 +293,7 @@ jobs:
|
|
|
293
293
|
|
|
294
294
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
295
295
|
with:
|
|
296
|
-
name:
|
|
296
|
+
name: python_calamine_pypi_files_${{ matrix.os }}_${{ matrix.target }}_${{ matrix.manylinux || 'auto' }}
|
|
297
297
|
path: dist
|
|
298
298
|
|
|
299
299
|
build-pyemscripten:
|
|
@@ -305,11 +305,11 @@ jobs:
|
|
|
305
305
|
include:
|
|
306
306
|
- python-version: "3.14"
|
|
307
307
|
steps:
|
|
308
|
-
- uses: actions/checkout@
|
|
308
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
309
309
|
with:
|
|
310
310
|
persist-credentials: false
|
|
311
311
|
|
|
312
|
-
- uses: astral-sh/setup-uv@
|
|
312
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
313
313
|
with:
|
|
314
314
|
python-version: ${{ matrix.python-version }}
|
|
315
315
|
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
|
|
@@ -319,10 +319,16 @@ jobs:
|
|
|
319
319
|
- name: Get pyodide config
|
|
320
320
|
id: pyodide-config
|
|
321
321
|
run: |
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
322
|
+
rust_toolchain=$(uv run pyodide config get rust_toolchain)
|
|
323
|
+
emscripten_version=$(uv run pyodide config get emscripten_version)
|
|
324
|
+
pyodide_abi_version=$(uv run pyodide config get pyodide_abi_version)
|
|
325
|
+
rustflags=$(uv run pyodide config get rustflags)
|
|
326
|
+
{
|
|
327
|
+
echo "rust-toolchain=$rust_toolchain"
|
|
328
|
+
echo "emscripten-version=$emscripten_version"
|
|
329
|
+
echo "pyodide-abi-version=$pyodide_abi_version"
|
|
330
|
+
echo "rustflags=$rustflags"
|
|
331
|
+
} >> "$GITHUB_OUTPUT"
|
|
326
332
|
|
|
327
333
|
- uses: emscripten-core/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
|
|
328
334
|
with:
|
|
@@ -366,11 +372,11 @@ jobs:
|
|
|
366
372
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
367
373
|
with:
|
|
368
374
|
path: dist
|
|
369
|
-
pattern:
|
|
375
|
+
pattern: python_calamine_pypi_files_*
|
|
370
376
|
merge-multiple: true
|
|
371
377
|
|
|
372
378
|
- name: Publish package distributions to PyPI
|
|
373
|
-
uses: pypa/gh-action-pypi-publish@
|
|
379
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1.14
|
|
374
380
|
|
|
375
381
|
gh-release:
|
|
376
382
|
needs: [build, build-pyemscripten, check]
|
|
@@ -386,11 +392,11 @@ jobs:
|
|
|
386
392
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
387
393
|
with:
|
|
388
394
|
path: dist
|
|
389
|
-
pattern:
|
|
395
|
+
pattern: python_calamine_pypi_files_*
|
|
390
396
|
merge-multiple: true
|
|
391
397
|
|
|
392
398
|
- name: Upload to GitHub
|
|
393
|
-
uses: softprops/action-gh-release@
|
|
399
|
+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
|
|
394
400
|
with:
|
|
395
401
|
generate_release_notes: true
|
|
396
402
|
files: |
|
|
@@ -47,9 +47,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "calamine"
|
|
50
|
-
version = "0.36.
|
|
50
|
+
version = "0.36.1"
|
|
51
51
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
52
|
-
checksum = "
|
|
52
|
+
checksum = "5fa68281b1a76b54a62156474adb06bb380a67e07dd60656e3217152b42183f3"
|
|
53
53
|
dependencies = [
|
|
54
54
|
"atoi_simd",
|
|
55
55
|
"byteorder",
|
|
@@ -307,9 +307,9 @@ dependencies = [
|
|
|
307
307
|
|
|
308
308
|
[[package]]
|
|
309
309
|
name = "pyo3"
|
|
310
|
-
version = "0.29.
|
|
310
|
+
version = "0.29.3"
|
|
311
311
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
312
|
-
checksum = "
|
|
312
|
+
checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
|
|
313
313
|
dependencies = [
|
|
314
314
|
"chrono",
|
|
315
315
|
"libc",
|
|
@@ -322,18 +322,18 @@ dependencies = [
|
|
|
322
322
|
|
|
323
323
|
[[package]]
|
|
324
324
|
name = "pyo3-build-config"
|
|
325
|
-
version = "0.29.
|
|
325
|
+
version = "0.29.3"
|
|
326
326
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
327
|
-
checksum = "
|
|
327
|
+
checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
|
|
328
328
|
dependencies = [
|
|
329
329
|
"target-lexicon",
|
|
330
330
|
]
|
|
331
331
|
|
|
332
332
|
[[package]]
|
|
333
333
|
name = "pyo3-ffi"
|
|
334
|
-
version = "0.29.
|
|
334
|
+
version = "0.29.3"
|
|
335
335
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
336
|
-
checksum = "
|
|
336
|
+
checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
|
|
337
337
|
dependencies = [
|
|
338
338
|
"libc",
|
|
339
339
|
"pyo3-build-config",
|
|
@@ -349,9 +349,9 @@ dependencies = [
|
|
|
349
349
|
|
|
350
350
|
[[package]]
|
|
351
351
|
name = "pyo3-macros"
|
|
352
|
-
version = "0.29.
|
|
352
|
+
version = "0.29.3"
|
|
353
353
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
354
|
-
checksum = "
|
|
354
|
+
checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
|
|
355
355
|
dependencies = [
|
|
356
356
|
"proc-macro2",
|
|
357
357
|
"pyo3-macros-backend",
|
|
@@ -361,9 +361,9 @@ dependencies = [
|
|
|
361
361
|
|
|
362
362
|
[[package]]
|
|
363
363
|
name = "pyo3-macros-backend"
|
|
364
|
-
version = "0.29.
|
|
364
|
+
version = "0.29.3"
|
|
365
365
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
366
|
-
checksum = "
|
|
366
|
+
checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
|
|
367
367
|
dependencies = [
|
|
368
368
|
"heck",
|
|
369
369
|
"proc-macro2",
|
|
@@ -373,7 +373,7 @@ dependencies = [
|
|
|
373
373
|
|
|
374
374
|
[[package]]
|
|
375
375
|
name = "python-calamine"
|
|
376
|
-
version = "0.8.
|
|
376
|
+
version = "0.8.3"
|
|
377
377
|
dependencies = [
|
|
378
378
|
"calamine",
|
|
379
379
|
"chrono",
|
|
@@ -250,7 +250,7 @@ impl CalamineCellIterator {
|
|
|
250
250
|
CalamineCellIterator {
|
|
251
251
|
empty_row,
|
|
252
252
|
position: 0,
|
|
253
|
-
start: range.start().
|
|
253
|
+
start: range.start().unwrap_or_default(),
|
|
254
254
|
iter: unsafe {
|
|
255
255
|
std::mem::transmute::<
|
|
256
256
|
calamine::Rows<'_, calamine::Data>,
|
|
@@ -269,6 +269,10 @@ impl CalamineCellIterator {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
fn __next__(mut slf: PyRefMut<'_, Self>) -> PyResult<Option<Bound<'_, PyList>>> {
|
|
272
|
+
if slf.range.is_empty() {
|
|
273
|
+
return Ok(None);
|
|
274
|
+
}
|
|
275
|
+
|
|
272
276
|
slf.position += 1;
|
|
273
277
|
if slf.position > slf.start.0 {
|
|
274
278
|
slf.iter
|
|
@@ -222,6 +222,24 @@ def test_xlsx_iter_rows():
|
|
|
222
222
|
assert data == list(reader.get_sheet_by_index(0).iter_rows())
|
|
223
223
|
|
|
224
224
|
|
|
225
|
+
@pytest.mark.parametrize("filename", ["base.xlsx", "base.xls", "base.xlsb", "base.ods"])
|
|
226
|
+
def test_iter_rows_empty_sheet(filename):
|
|
227
|
+
reader = CalamineWorkbook.from_object(PATH / filename)
|
|
228
|
+
sheet = reader.get_sheet_by_index(1)
|
|
229
|
+
|
|
230
|
+
assert sheet.start is None
|
|
231
|
+
assert sheet.end is None
|
|
232
|
+
rows = sheet.iter_rows()
|
|
233
|
+
|
|
234
|
+
assert list(rows) == []
|
|
235
|
+
for _ in range(3):
|
|
236
|
+
with pytest.raises(StopIteration):
|
|
237
|
+
next(rows)
|
|
238
|
+
|
|
239
|
+
sentinel = object()
|
|
240
|
+
assert next(rows, sentinel) is sentinel
|
|
241
|
+
|
|
242
|
+
|
|
225
243
|
def test_nrows():
|
|
226
244
|
reader = CalamineWorkbook.from_object(PATH / "base.xlsx")
|
|
227
245
|
sheet = reader.get_sheet_by_name("Sheet3")
|