semvec/pypi-packages huggingface dataset:
pycdo 0.2.1
Python wrapper of the Climate Data Operators
Requires Python: >=3.10



# Welcome to pycdo

|  |  |
|----|----|
| Package | [![Latest PyPI Version](https://img.shields.io/pypi/v/pycdo.svg)](https://pypi.org/project/pycdo/) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/pycdo.svg)](https://pypi.org/project/pycdo/) |
| Coverage | [![Codecov test coverage](https://codecov.io/gh/eliocamp/pycdo/graph/badge.svg)](https://app.codecov.io/gh/eliocamp/pycdo) |
| Meta | [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) |

pycdo is a wrapper for the Climate Data Operators (CDO). It allows
chaining CDO operators using method chaining and handles options and
temporary files for you.

## Get started

You can install this package into your preferred Python environment
using pip:

``` bash
pip install pycdo
```

## Example

``` python
from pycdo import cdo, cdo_options, cdo_cache, geopotential
```

The ymonmean operator computes monthly annual cycle. The pycdo function
is `cdo_ymonmean()`

``` python
cdo(geopotential).ymonmean()
```

    CDO operation.
    cdo -ymonmean [ /home/user1/Documents/python/pycdo/src/pycdo/data/geopotential.nc ] {output}

The output just prints the command with a place holder output. Use
`.execute()` to actually run the command. If no output file is
specified, then the result is saved in a tempfile.

``` python
cdo(geopotential).ymonmean().execute()
```

    '/tmp/tmpio8g3urm'

Operators can be chained. Lets select just the Southern Hemisphere
first.

``` python
(
    cdo(geopotential)
    .sellonlatbox(0, 360, -90, 0)
    .ymonmean()
    .execute()
)
```

    '/tmp/tmpnojlbike'

We can save operations to execute later or as input for other operations

``` python
sh_geopotential = (
    cdo(geopotential)
    .sellonlatbox(0, 360, -90, 0)
    .sellevel(300)
    .ymonmean()
) 

cdo(sh_geopotential).ymonmean().execute()
```

    '/tmp/tmpfj30dnfe'

Temporary files are deleted when the variables holding them are garbage
collected to prevent blowing up disk space when iterating over the same
code.

For long-running operations, you can set up a cache.

``` python
cdo_cache.set("data/pycdo")
```

    <pycdo.cdo_cache.CdoCache at 0x708498224710>

This turns off the automatic deletion and returns existing files instead
of re-runing CDO operators.

``` python
import time
# First run. 
start = time.time()
sh_geopotential.execute()
time.time() - start
```

    0.060179710388183594

``` python
# Second run just returns the existing file
start = time.time()
sh_geopotential.execute()
time.time() - start
```

    0.0006704330444335938

You can set global options that will apply to all operations.

``` python
cdo_options.set("-Z")  # Compress result
sh_geopotential
```

    CDO operation.
    cdo -Z -ymonmean [ -sellevel,300 [ -sellonlatbox,0,360,-90,0 [ /home/user1/Documents/python/pycdo/src/pycdo/data/geopotential.nc ] ] ] {output}

``` python
import shutil
shutil.rmtree("data/pycdo")
```

## Copyright

- Copyright © 2025 Elio Campitelli.
- Free software distributed under the [MIT License](./LICENSE).
easy-csv-logging 0.1.3
Simple CSV logging and viewing
Requires Python: >=3.8

how it works is that it is two functions oneto write to log and another to view log in terminal


log(*args)
This functions takes in values. Then these values get stored in csv_log.csv and in a more readable way in csv_log.txt


It has two more special cases.
One where there is 0 arguments then it adds an row where each colum has no values
One where there is 1 arguments then it fills in value under column 0 with the name  "_____".

Else arguments will be interprited as pairs of column_name,value. Where name is always first
The row will be filled based on these pairs.



#All of these are valid:



log("a",1,"b",3) 
log("2")
log()
log()
log()
log("patrik",999)
log("patrik",999)
log("patrik",999)
log("patrik","999öööööööö")
log("29999")
log("29999")
log("29999")
log()
log()
log()
log((2,2),(3,3),(4,4))
log(["2",2],["3",3],["4",4])
log([("2",2),("3",3),("4",4)])

This code will write this to csv_log.txt in the directory of the script where the module is called from. 
| _____:          | a: 1.0  | b: 3.0  | patrik:              | 2:      | 3:      | 4:      |
| _____: 2.0      | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik: 999.0        | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik: 999.0        | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik: 999.0        | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik: 999öööööööö  | 2:      | 3:      | 4:      |
| _____: 29999.0  | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____: 29999.0  | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____: 29999.0  | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2:      | 3:      | 4:      |
| _____:          | a:      | b:      | patrik:              | 2: 2.0  | 3: 3.0  | 4: 4.0  |
| _____:          | a:      | b:      | patrik:              | 2: 2.0  | 3: 3.0  | 4: 4.0  |
| _____:          | a:      | b:      | patrik:              | 2: 2.0  | 3: 3.0  | 4: 4.0  |

csv_log.txt:

_____,a,b,patrik,2,3,4
,1.0,3.0,,,,
2.0,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,999.0,,,
,,,999.0,,,
,,,999.0,,,
,,,999öööööööö,,,
29999.0,,,,,,
29999.0,,,,,,
29999.0,,,,,,
,,,,,,
,,,,,,
,,,,,,
,,,,2.0,3.0,4.0
,,,,2.0,3.0,4.0
,,,,2,3,4
fast-thumbhash 1.0.0
Fast ThumbHash bindings for Python using Rust (PyO3)
Requires Python: >=3.10

# fast_thumbhash

A fast Python package for [ThumbHash](https://github.com/evanw/thumbhash) image encoding/decoding using Rust bindings (PyO3, maturin) to the official `thumbhash` crate.

fast_thumbhash is 60.5x faster than the pure Python implementations I tested:

```
28.13854099076707 ms (thumbhash)
0.46491601096931845 ms (fast-thumbhash - this package)
```

`thumbhash-python` was also taking the same time range as `thumbhash` (27 - 35 ms).

## Features
- Exposes `rgba_to_thumb_hash`, `thumb_hash_to_rgba`, `thumb_hash_to_average_rgba`, `thumb_hash_to_approximate_aspect_ratio`.
- Supports raw RGBA bytes and Pillow Image (Pillow is optional).

## Installation

```sh
pip install git+https://github.com/sitatec/fast_python_thumbhash.git
```

Build from source using maturin:

```sh
maturin develop
```

## Usage Example
```python
from fast_thumbhash import rgba_to_thumb_hash, thumb_hash_to_rgba
from PIL import Image

img = Image.open('example.png').convert('RGBA')
thash = rgba_to_thumb_hash(img)
restored = thumb_hash_to_rgba(thash)
```

## License
MIT