semvec/pypi-packages huggingface dataset:
wheezy.html 3.2.2
A lightweight html rendering library
Requires Python: >=3.10
Keywords: html, widget, markup, mako, jinja2, tenjin, wheezy.template, preprocessor

# wheezy.html

[![tests](https://github.com/akornatskyy/wheezy.html/actions/workflows/tests.yml/badge.svg)](https://github.com/akornatskyy/wheezy.html/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/akornatskyy/wheezy.html/badge.svg?branch=master)](https://coveralls.io/github/akornatskyy/wheezy.html?branch=master)
[![Documentation Status](https://readthedocs.org/projects/wheezyhtml/badge/?version=latest)](https://wheezyhtml.readthedocs.io/en/latest/?badge=latest)
[![pypi version](https://badge.fury.io/py/wheezy.html.svg)](https://badge.fury.io/py/wheezy.html)

[wheezy.html](https://pypi.org/project/wheezy.html) is a
[python](http://www.python.org) package written in pure Python code. It
is a lightweight html widget library. Integrates with the following
template systems:

- [Jinja2 Templates](http://jinja.pocoo.org)
- [Mako Templates](http://www.makotemplates.org)
- [Tenjin Templates](http://www.kuwata-lab.com/tenjin/)
- [Wheezy Templates](http://pypi.python.org/pypi/wheezy.template/)

It is optimized for performance, well tested and documented.

Resources:

- [source code](https://github.com/akornatskyy/wheezy.html)
  and [issues](https://github.com/akornatskyy/wheezy.html/issues)
  tracker are available on
  [github](https://github.com/akornatskyy/wheezy.html)
- [documentation](https://wheezyhtml.readthedocs.io/en/latest/)

## Install

[wheezy.html](https://pypi.org/project/wheezy.html) requires
[python](http://www.python.org) version 3.10+. It is independent of operating
system. You can install it from [pypi](https://pypi.org/project/wheezy.html)
site:

```sh
pip install -U wheezy.html
```

If you would like take a benefit of template preprocessing for Mako,
Jinja2, Tenjin or Wheezy.Template engines specify extra requirements:

```sh
pip install wheezy.html[wheezy.template]
```

If you run into any issue or have comments, go ahead and add on
[github](https://github.com/akornatskyy/wheezy.html/issues).
c-struct-data-parser 0.4.0
Declaratively define and parse C data structures
Requires Python: >=3.11

# c_struct_data_parser

Intended to facilitate declarative, dynamic definition of C data structures.
The library will autogenerate a parser which you can connect to a `BytesReader` or some IO based variant.

You're better off looking at https://github.com/fox-it/dissect.cstruct

Examples from `test_basic.py`:

```python
Struct2Int = create_struct_definition(
    "Struct2Int",
    {
        "value_a": Int4Definition,
        "value_b": Int4Definition,
    },
)


def test_struct2Int() -> None:
    value_a = 0x12345678
    value_b = 0x99887766
    bs = b"".join(map(int_to_le_bytes_4, [value_a, value_b]))
    bytes_reader = BytesReader(address=0, bs=bs)
    struct_2_int, new_reader = Struct2Int.parser(bytes_reader)
    assert struct_2_int.value_a.value == value_a
    assert struct_2_int.value_b.value == value_b

    print(struct_2_int)


BitFieldsExample = create_bit_fields_definition(
    "BitFieldsExample",
    Int4Definition,
    {
        "field_a": 4,
        "reserved_1": 5,
        "field_b": 5,
    },
)


def test_bit_fields() -> None:
    val = 0x123456
    bs = int_to_le_bytes_4(val)
    bytes_reader = BytesReader(address=0, bs=bs)
    bit_fields_example, new_reader = BitFieldsExample.parser(bytes_reader)
    assert bit_fields_example.field_a.value == val & 0xF
    assert bit_fields_example.field_b.value == (val >> 9) & 0x1F
    print(bit_fields_example)


Struct2IntPointer = create_pointer_definition(
    Struct2Int,
    Int4Definition,
)


def test_pointer_type() -> None:
    value_a = 0x12345678
    value_b = 0x99887766
    bs_struct = b"".join(map(int_to_le_bytes_4, [value_a, value_b]))
    bs_pointer = int_to_le_bytes_4(0x2000)
    bs = b"".join([bs_struct, bs_pointer])
    bytes_reader = BytesReader(address=0x2000, bs=bs)

    struct_2_int, new_reader = Struct2Int.parser(bytes_reader)
    assert struct_2_int.value_a.value == value_a
    assert struct_2_int.value_b.value == value_b

    p_struct_2_int, new_reader_2 = Struct2IntPointer.parser(new_reader)

    print(p_struct_2_int)

    struct_2_int_copy = p_struct_2_int.resolve(new_reader_2)

    assert struct_2_int_copy.value_a.value == value_a
    assert struct_2_int_copy.value_b.value == value_b

```