semvec/pypi-packages huggingface dataset:
read-protobuf 0.2.0
Small library to read serialized protobuf(s) directly into Pandas DataFrame
License: MIT
Requires Python: >=3.7
Keywords: pandas,protobuf

# read-protobuf

Small library to read serialized protobuf(s) directly into Pandas DataFrame.

This is intended to be a simple shortcut for translating serialized
protobuf bytes / files directly to a dataframe.

## Install

Available via pip:

```bash
$ pip install read-protobuf
```

## Usage

Run the [demo-notebook](tests/demo.ipynb) for an interactive demo.

```python
import demo_pb2                             # compiled protobuf message module 
from read_protobuf import read_protobuf

MessageType = demo_pb2.MessageType()        # instantiate a new message type
df = read_protobuf(b'\x00\x00', MessageType)    # create a dataframe from serialized protobuf bytes
df = read_protobuf([b'\x00\x00', b'x00\x00'] MessageType)    # read multiple protobuf bytes

df = read_protobuf('demo.pb', MessageType)    # use file instead of bytes
df = read_protobuf(['demo.pb', 'demo2.pb'], MessageType)    # read multiple files

# options
df = read_protobuf('demo.pb', MessageType, flatten=False)    # don't flatten pb messages
df = read_protobuf('demo.pb', MessageType, prefix_nested=True)    # prefix nested messages with parent keys (like pandas.io.json.json_normalize)
```

To compile a protobuf Message class from python, use:

```bash
$ protoc --python_out="." demo.proto
```

## Alternatives

#### protobuf-to-dict

https://github.com/benhodgson/protobuf-to-dict

This library was developed earlier to convert protobufs to JSON via a dict.

#### MessageToDict, MessageToJson

The google protobuf library comes with utilities to convert messages to a `dict` or JSON,
then loaded by Pandas.

```python
from google.protobuf.json_format import MessageToJson
from google.protobuf.json_format import MessageToDict
```

In brief tests, the `read_protobuf` package is about 2x as fast
as using `MessageToDict` and 3x as fast as `MessageToJson`.

## Develop

To install a development version of the package, run from the root directory:

```bash
$ pip install -e .
```

- To install development dependencies, use the optional `[dev]`dependencies:

```bash
$ pip install -e ".[dev]"
```

## Format

Uses `black` and `isort` to format files.

```bash
$ make black
$ make isort
```

## Lint

Uses `ruff` to lint application.

```bash
$ make ruff
```

## Test

Uses `pytest` to run unit tests. From the root of the repository, run:

```bash
$ make pytest

# specify test
$ pytest -k "TestRead::test_read_bytes"
```

## Code Coverage

Use `coverage` to monitor code coverage during tests.
To record coverage while running tests, run:

```bash
$ make pytest-cov
```

## License

[MIT License](LICENSE)
win-defender 0.2.0
Tools to defend windows and get compliant with common regulations
License: MIT
Requires Python: >=3.7

# Win Defender

Windows Defender contains several functions for tools to secure Windows machine and get compliant with common regulations.
## Win-Block-USBs

A simple python script to block usb root hubs on windows devices. 

## Usage

- Run cmd prompt/Powershell as administrator

- Clone repo

    ```bash
    git clone https://github.com/dmdhrumilmistry/win-block-usbs
    ```

- Change directory

    ```bash
    cd win-block-usbs
    ```

- Run script

    ```bash
    python win-block-usb.py
    ```
pytest-goldie 0.1.5
A plugin to support golden tests with pytest.
License: MIT
Requires Python: >=3.5

pytest-goldie: Golden Testing for pytest
========================================

.. image:: https://img.shields.io/pypi/v/pytest-goldie.svg
    :target: https://pypi.org/project/pytest-goldie
    :alt: PyPI version
.. image:: https://img.shields.io/pypi/l/pytest-goldie.svg
    :target: https://pypi.python.org/pypi/pytest-goldie

pytest-goldie is a pytest plugin that enables `golden testing <https://en.wikipedia.org/wiki/Characterization_test>`_ using pytest framework.
Golden testing is a methodology that compares the output of your code with a pre-recorded output. This package provides a fixture called `golden` that can be used to update test results and make test comparisons.

Example
-------

First, install the plugin:

.. code-block:: bash

    $ pip install pytest-goldie

Then, in your test file, use the `golden` fixture:

.. code-block:: python

    def my_function():
        return "Hello, world!"

    def test_my_function(golden):
        output = my_function()
        golden.test(output)

The `golden.test` method takes the output of your function and compares it to the saved output of a previous run. If the `update_goldens` flag is set, pytest-goldie will update the saved output with the new output.

To run the tests and update goldens, use the following command:

.. code-block:: bash

    $ pytest --update_goldens

By default, the golden files are stored in a folder named 'goldens'. You can change the folder name with --goldens_folder flag:

.. code-block:: bash

    $ pytest --goldens_folder my_goldens


This will set the goldens folder to "my_goldens" instead of the default "goldens".

License
-------

This software is licensed under the `MIT License <https://opensource.org/licenses/MIT>`_.

Created by Nick Kartashov and contributors.