semvec/pypi-packages huggingface dataset:
daio 1.0.0
video and data IO tools for Python
License: MIT
Requires Python: >=3.8
Keywords: python, HDF5, data IO, video IO

![Python Version](https://img.shields.io/badge/python-3.8+-blue)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![tests](https://github.com/danionella/daio/actions/workflows/test.yml/badge.svg)
[![PyPI - Version](https://img.shields.io/pypi/v/daio)](https://pypi.org/project/daio/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/daio.svg)](https://anaconda.org/conda-forge/daio)
![GitHub last commit](https://img.shields.io/github/last-commit/danionella/daio)

# daio
Video and data IO tools for Python.

Links: [API documentation](http://danionella.github.io/daio), [GitHub repository](https://github.com/danionella/daio)

## Installation
- via conda or mamba: `conda install conda-forge::daio`
- if you prefer pip: `pip install daio`

## Use 

### Video IO

Write video:
```python
from daio.video import VideoReader, VideoWriter
writer = VideoWriter('/path/to/video.mp4', fps=25)
for i in range(20):
    frame = np.random.randint(0,255,size=(720,1280), dtype='uint8')
    writer.write(frame)
writer.close()
```

Read video using speed-optimized array-like indexing or iteration:
```python
reader = VideoReader('/path/to/video.mp4')
frame_7 = reader[7]
first10_frames = reader[:10]
for frame in reader:
    process_frame(frame)
reader.close()
```

You can also use with statements to handle file closure:
```python
with VideoWriter('/path/to/video.mp4', fps=25) as writer:
    for i in range(20):
        frame = np.random.randint(0,255,size=(720,1280), dtype='uint8')
        writer.write(frame)
#or
with VideoReader('/path/to/video.mp4') as reader:
    frame_7 = reader[7]
```

### HDF5 file IO

Lazily load HDF5 with a dict-like interface (contents are only loaded when accessed):
```python
from daio.h5 import lazyh5
h5 = lazyh5('/path/to/datafile.h5')
b_loaded = h5['b']
e_loaded = h5['c']['e']
h5.keys()
```

Create a new HDF5 file (or add items to existing file by setting argument `readonly=False`):
```python
h5 = lazyh5('test.h5')
h5['a'] = 1
h5['b'] = 'hello'
h5['c'] = {} # create subgroup
h5['c']['e'] = [2,3,4]
```

Load entire HDF5-file to dict, or save dict to HDF5-file:
```python
# save dict to HDF5 file:
some_dict = dict(a = 1, b = np.random.randn(3,4,5), c = dict(g='nested'), d = 'some_string')
lazyh5('/path/to/datafile.h5').from_dict(some_dict)
# load dict from HDF5 file:
loaded = lazyh5('/path/to/datafile.h5').to_dict()
```

In Jupyter, you can interactively explore the file structure:

<img width="598" alt="image" src="https://github.com/user-attachments/assets/878d4af6-ce26-4ec3-9ba5-2701fba1c07e">


-----
<details><summary>Old interface (expand this)</summary>
    
```python
from daio.h5 import save_to_h5, load_from_h5
# save dict to HDF5 file:
some_dict = dict(a = 1, b = np.random.randn(3,4,5), c = dict(g='nested'), d = 'some_string')
save_to_h5('/path/to/datafile.h5', some_dict)
# load dict from HDF5 file:
dict_loaded = load_from_h5('/path/to/datafile.h5')
```

</details>
skplatform 0.2.17
Attitude solutions for optical, remote sensing instruments  flying on, or simulating, balloons, aircraft and satellites
License: MIT
Requires Python: >=3.7

# skplatform #
This package is used for the attitude solution of optical instruments remote sensing the atmosphere from space,
balloons, aircraft or the ground. The package can be used to generate lines of sight for simulations or real instruments.
A simple interface for simulating satellite based instruments, supporting scripting and integration with integration
with [hawksimulator](https://github.com/usask-arg/hawc-simulator), is included as a submodule.

## Installation

    pip install skplatform

### Building a wheel
The python wheel can also be built from source code,

    conda install setuptools build
    python -m build --wheel

## Documentation
Documentation can be found at ReadTheDocs [skplatform](https://skplatform.readthedocs.io/en/latest/index.html)

## Unit Testing

    python -m unittest discover -s skplatform.tests

The tests take around 90 seconds to run, so be patient.

## License
This project is licensed under the MIT license.