Skip to content

Commit

Permalink
docs: yaml usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
rilshok committed Jul 7, 2024
1 parent 87b083c commit 9f5d075
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

IOKit is a Python library that offers a suite of utilities for managing a wide range of input/output operations. Central to its design is the concept of a `State`, where each state signifies a unit of data that can be loaded, saved, or transformed. Each state corresponds to a valid file state, represented as a bytes-like object.

IOKit abstracts and unifies serialization and deserialization operations from various libraries into a single, cohesive interface. This allows for direct manipulation of the file's state in memory, eliminating the need for disk interaction. Consequently, it facilitates the (de)serialization of data in multiple formats, such as `json`, `txt`, `tar`, `gzip`, among others. This abstraction not only simplifies data handling but also enhances efficiency by reducing disk I/O operations.
IOKit abstracts and unifies serialization and deserialization operations from various libraries into a single, cohesive interface. This allows for direct manipulation of the file's state in memory, eliminating the need for disk interaction. Consequently, it facilitates the (de)serialization of data in multiple formats, such as `json`, `yaml`, `txt`, `tar`, `gzip`, among others. This abstraction not only simplifies data handling but also enhances efficiency by reducing disk I/O operations.

## Installation

Expand Down Expand Up @@ -48,6 +48,22 @@ single.json (16B)
{'key': 'value'}
```

### YAML

```python
from iokit import Yaml

data = {"key": "value"}
state = Yaml(data, name="single")
print(state)
print(state.load())
```

```plain-text
single.yaml (11B)
{'key': 'value'}
```

### GZip Compression

```python
Expand Down

0 comments on commit 9f5d075

Please sign in to comment.