[![PyPI version](https://badge.fury.io/py/wavpack-numcodecs.svg)](https://badge.fury.io/py/wavpack-numcodecs) ![tests](https://github.com/AllenNeuralDynamics/wavpack-numcodecs/actions/workflows/python-package-cython.yml/badge.svg)
# WavPack - numcodecs implementation
[Numcodecs](https://numcodecs.readthedocs.io/en/latest/index.html) wrapper to the
[WavPack](https://www.wavpack.com/index.html) audio codec.
This implementation enables one to use WavPack as a compressor in
[Zarr](https://zarr.readthedocs.io/en/stable/index.html).
### Requirements
To install `wavpack-numcodecs` on MacOS, you need to install `wavpack` with `brew`:
```bash
brew install wavpack
```
For Linux and Windows, the package comes with pre-built binaries of the most
[recent version Wavpack version](https://github.com/dbry/WavPack/releases/tag/5.7.0).
On Linux, if an existing `wavpack` installation is found, the package will use it. Otherwise, it will use the pre-built binaries available in the `wavpack_numcodecs/libraries` folder.
On Windows, you need to have the "Microsoft C++ Build Tools" installed. You can download it and install it from [here](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
## Installation
Install via `pip`:
```
pip install wavpack-numcodecs
```
Or from sources:
```
git clone https://github.com/AllenNeuralDynamics/wavpack-numcodecs.git
cd wavpack_numcodecs
pip install .
```
## Usage
This is a simple example on how to use the `WavPackCodec` with `zarr`:
```
from wavpack_numcodecs import WavPack
data = ... # any numpy array
# instantiate WavPack compressor
wv_compressor = WavPack(level=2, bps=None)
z = zarr.array(data, compressor=wv_compressor)
data_read = z[:]
```
Available `**kwargs` can be browsed with: `WavPack?`
**NOTE:**
In order to reload in zarr an array saved with the `WavPack`, you just need to have the `wavpack_numcodecs` package
installed.
# Developmers guide
## How to upgrade WavPack installation and make a new release
To upgrade the WavPack installation, you need to:
1. Download the latest version of WavPack from the [official website](https://www.wavpack.com/downloads.html).
2. Extract the content of the downloaded file.
3. Create a new folder in the `src/wavpack_numcodecs/libraries` folder with the name of the version of the WavPack you are installing.
4. Add the Windows .dll and .lib files to the `windows-x86_32` and `windows-x86_64` folders, respectievely.
5. Update the version of the CI workflows in the `.github/wavpack_latest_version.txt` file and set the `LATEST_WAVPACK_VERSION` variable in the `setup.py` to match the version of the WavPack you are installing.
6. Make a PR with the changes and merge it.
7. Manually trigger the `Build wavpack binaries` workflow in the Actions tab of the repository. This will automatically build the binaries for different Linux versions and make PRs with the changes to the `main` branch.
8. Merge the automated PRs to update the Linux binaries.
9. Update the version of the package in the `pyproject.toml` file and tag the repo to automatically make a new release.
Raw data
{
"_id": null,
"home_page": null,
"name": "wavpack-numcodecs",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "example, project",
"author": null,
"author_email": "Alessio Buccino <alessiop.buccino@gmail.com>, David Bryant <david@wavpack.com>",
"download_url": "https://files.pythonhosted.org/packages/66/51/c11893dfe0435f4a259d9f62becbe62143204ee9084b895fba397525856e/wavpack-numcodecs-0.2.2.tar.gz",
"platform": null,
"description": "[![PyPI version](https://badge.fury.io/py/wavpack-numcodecs.svg)](https://badge.fury.io/py/wavpack-numcodecs) ![tests](https://github.com/AllenNeuralDynamics/wavpack-numcodecs/actions/workflows/python-package-cython.yml/badge.svg)\n\n\n# WavPack - numcodecs implementation\n\n[Numcodecs](https://numcodecs.readthedocs.io/en/latest/index.html) wrapper to the \n[WavPack](https://www.wavpack.com/index.html) audio codec.\n\nThis implementation enables one to use WavPack as a compressor in \n[Zarr](https://zarr.readthedocs.io/en/stable/index.html).\n\n\n### Requirements\n\nTo install `wavpack-numcodecs` on MacOS, you need to install `wavpack` with `brew`:\n\n```bash\nbrew install wavpack\n```\n\nFor Linux and Windows, the package comes with pre-built binaries of the most \n[recent version Wavpack version](https://github.com/dbry/WavPack/releases/tag/5.7.0).\n\nOn Linux, if an existing `wavpack` installation is found, the package will use it. Otherwise, it will use the pre-built binaries available in the `wavpack_numcodecs/libraries` folder.\n\nOn Windows, you need to have the \"Microsoft C++ Build Tools\" installed. You can download it and install it from [here](https://visualstudio.microsoft.com/visual-cpp-build-tools/).\n\n## Installation\n\nInstall via `pip`:\n\n```\npip install wavpack-numcodecs\n```\n\nOr from sources:\n\n```\ngit clone https://github.com/AllenNeuralDynamics/wavpack-numcodecs.git\ncd wavpack_numcodecs\npip install .\n```\n\n## Usage\n\nThis is a simple example on how to use the `WavPackCodec` with `zarr`:\n\n```\nfrom wavpack_numcodecs import WavPack\n\ndata = ... # any numpy array\n\n# instantiate WavPack compressor\nwv_compressor = WavPack(level=2, bps=None)\n\nz = zarr.array(data, compressor=wv_compressor)\n\ndata_read = z[:]\n```\nAvailable `**kwargs` can be browsed with: `WavPack?`\n\n**NOTE:** \nIn order to reload in zarr an array saved with the `WavPack`, you just need to have the `wavpack_numcodecs` package\ninstalled.\n\n# Developmers guide\n\n## How to upgrade WavPack installation and make a new release\n\nTo upgrade the WavPack installation, you need to:\n\n1. Download the latest version of WavPack from the [official website](https://www.wavpack.com/downloads.html).\n2. Extract the content of the downloaded file.\n3. Create a new folder in the `src/wavpack_numcodecs/libraries` folder with the name of the version of the WavPack you are installing.\n4. Add the Windows .dll and .lib files to the `windows-x86_32` and `windows-x86_64` folders, respectievely.\n5. Update the version of the CI workflows in the `.github/wavpack_latest_version.txt` file and set the `LATEST_WAVPACK_VERSION` variable in the `setup.py` to match the version of the WavPack you are installing.\n6. Make a PR with the changes and merge it.\n7. Manually trigger the `Build wavpack binaries` workflow in the Actions tab of the repository. This will automatically build the binaries for different Linux versions and make PRs with the changes to the `main` branch.\n8. Merge the automated PRs to update the Linux binaries.\n9. Update the version of the package in the `pyproject.toml` file and tag the repo to automatically make a new release.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Numcodecs implementation of WavPack audio codec.",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/AllenNeuralDynamics/wavpack-numcodecs"
},
"split_keywords": [
"example",
" project"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6651c11893dfe0435f4a259d9f62becbe62143204ee9084b895fba397525856e",
"md5": "11dd4994631cb26d85584f9800a9f575",
"sha256": "d570c4348cfc335e4e23d09695f6f1b73af2d64bd2c58351642306079131bfb5"
},
"downloads": -1,
"filename": "wavpack-numcodecs-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "11dd4994631cb26d85584f9800a9f575",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2611998,
"upload_time": "2024-11-16T08:51:27",
"upload_time_iso_8601": "2024-11-16T08:51:27.468519Z",
"url": "https://files.pythonhosted.org/packages/66/51/c11893dfe0435f4a259d9f62becbe62143204ee9084b895fba397525856e/wavpack-numcodecs-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-16 08:51:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AllenNeuralDynamics",
"github_project": "wavpack-numcodecs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "numcodecs",
"specs": []
},
{
"name": "packaging",
"specs": []
}
],
"lcname": "wavpack-numcodecs"
}