Metadata-Version: 2.4
Name: cozip
Version: 2026.5.17
Summary: Python bindings to libcozip, the reference library for the Cloud-Optimized ZIP (cozip) format.
Project-URL: Homepage, https://github.com/asterisk-labs/cozip
Project-URL: Repository, https://github.com/asterisk-labs/cozip
Project-URL: Issues, https://github.com/asterisk-labs/cozip/issues
Author-email: Cesar Aybar <cesar@asterisk.coop>, Julio Contreras <julio.contreras@uv.es>, Roy Yali <ryali93@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Asterisk Labs
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: archive,cloud-optimized,zip
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: System :: Archiving :: Compression
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: cffi>=1.16
Requires-Dist: duckdb>=1.5.2
Requires-Dist: pandas>=2.0
Requires-Dist: pyarrow>=14
Provides-Extra: test
Requires-Dist: geopandas>=1.0; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Requires-Dist: shapely>=2.0; extra == 'test'
Description-Content-Type: text/markdown

# cozip

Python bindings for libcozip. Read a Cloud-Optimized ZIP archive's manifest over HTTP range requests, or write one from a pyarrow Table.

The native `libcozip` binary ships inside the wheel, no C toolchain required.

## Install

```bash
pip install cozip
```

## Usage

### Write

```python
import cozip
import pyarrow as pa

table = pa.table({
    "name": ["a.txt", "b.bin"],
    "path": ["/path/to/a.txt", "/path/to/b.bin"],
})

cozip.write("out.zip", table)
```

`name` is how each file appears inside the archive. `path` is where it lives on disk, used at write time and dropped from the manifest. Any extra columns ride along into `__metadata__` and become queryable on read.

```python
table = pa.table({
    "name":      ["a.tif", "b.tif"],
    "path":      ["/path/to/a.tif", "/path/to/b.tif"],
    "cloud_pct": [12.3, 45.1],
})

cozip.write("out.zip", table)
```

### Read

```python
import cozip

manifest = cozip.read("https://example.com/dataset.zip")
train = manifest[manifest["split"] == "train"]
```

`manifest` is a pandas DataFrame with `name`, `offset`, `size`, `cozip:gdal_vsi`, plus whatever extras the writer added. Local file or remote URL, same call. Only the byte-0 index and the embedded `__metadata__` Parquet are fetched, never the user payloads. Pass `columns=[...]` to bring only specific extras, `gdal_vsi=False` to drop the VSI path column.

## Versioning

The Python package version tracks the C library, copied verbatim from the repo-root `VERSION` file at build time. The bundled `.so` / `.dylib` / `.dll` inside the wheel matches the wheel's version exactly, so there's no mismatch to worry about.

```python
import cozip
cozip.__version__                  # "2026.5.16"
cozip.lib.cozip_version_string()   # full C library version
```

## Spec

See [SPEC.md](https://github.com/asterisk-labs/cozip/blob/main/SPEC.md) for the on-disk format.

## License

MIT. See [LICENSE](../LICENSE).