semvec/pypi-packages huggingface dataset:
pcap-fuzzer 0.5.0
Randomly edit packet fields in a PCAP file.
Requires Python: >=3.8
Keywords: network, dns, unbound

# pcap-fuzzer

[PyPI package page](https://pypi.org/project/pcap-fuzzer)

This program randomly edits packets from a PCAP file,
one field per edited packet.

The edited field will be chosen at random,
starting from the highest layer, and going down until it finds a supported protocol layer.

Example: a DNS packet will have one of its DNS fields edited,
and not one of the UDP or IP fields.


## Installation

```bash
pip install pcap-fuzzer
```

## Usage

Import statement:
```python
import pcap_fuzzer
```

`fuzz_pcaps` function doc:
```python
pcap_fuzzer.fuzz_pcaps(
    pcaps: Union[str, list]       # (List of) input PCAP files
    output: str,                  # [Optional] Output PCAP file path. Used only if a single input file is specified.
    random_range: int = 1,        # [Optional] Upper bound for random range (not included). Defaults to 1.
    packet_numbers: list = None,  # [Optional] List of indices, starting from 1, of packets to edit. If not specified, packets are randomly picked.
    dry_run: bool = False         # [Optional] If True, do not write output PCAP file(s).
) -> None
```

This function produces new, edited PCAP file(s).
If no output file is specified (for a single input file),
or if multiple input files are given,
the output file(s) will have the same name as the input file(s),
but with the suffix `.edit`,
and will be placed in a directory called `edited`,
in the same directory as the input files.
It will be created if it doesn't exist.

The program also produces CSV log files,
indicating which fields were edited for each packet.
The log files will be placed in a directory called `logs`,
in the same directory as the input files.
It will be created if it doesn't exist.


## Supported protocols (for now)

* Datalink Layer (2)
  * ARP
* Network Layer (3)
  * IPv4
  * IPv6
* Transport Layer (4)
  * TCP
  * UDP
  * ICMP
  * IGMP(v2 and v3)
* Application Layer (7)
  * HTTP
  * DNS
  * DHCP
  * SSDP
  * CoAP
common-util-py 0.0.28
Common Python utility modules
Requires Python: >=3.8
Keywords: utilities, common, python, sql, weetech

## common-util-py
Common utilities in Python

## How to install
The following commands show how to install `common-util-py` using pip within a Python virtual environment. To see which versions of Python are supported by `common-util-py`, see (here)[#tested-installation-via-pypi-on-the-following-python-versions].
```sh
$ python3 -m venv py313_env
$ source py313_env/bin/activate
$ pip install .[dev]
$ # or
$ virtualenv --python=/usr/bin/python3 py39_env
$ source env_py39/bin/activate
$ pip install .
$ # or
$ python3.8 -m venv env_py38
$ source env_py38/bin/activate
$ pip install .
```

## How to build
To create a source distribution, run the following commands:
```sh
$ source py313_env/bin/activate
$ python3 setup.py --help-commands
$ python3 setup.py sdist
```

## How to test
Initially we were using `nosetests` and have since migrated to `pytest`.
```sh
$ # deprecated
$ # python setup.py test
$ # python setup.py nosetests
$ # nose is replace by pytest since python3.13
$ pytest
```

read more [here](https://nose.readthedocs.io/en/latest/setuptools_integration.html)


* https://www.codingforentrepreneurs.com/blog/pipenv-virtual-environments-for-python/
* https://packaging.python.org/
* https://betterscientificsoftware.github.io/python-for-hpc/tutorials/python-pypi-packaging/

## How to upload to PyPI (Python Package Index)
First, build a source distribution and then install the `twine` package.
```sh
$ python setup.py sdist
$ pip install twine
```
Then, use twine to upload the package to PyPI.
```sh
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```
or
```sh
$ twine upload --config-file ~/.pypirc -r testpypi dist/common_util_py-0.0.1.tar.gz
```

## Test install
Install from Test PyPI
```sh
$ pip install --index-url https://test.pypi.org/simple/ common-util-py
```
Install from Local Distribution.
```sh
$ pip install dist/common_util_py-<version>.tar.gz
```

## Legacy
To generate `requirements.txt` and `requirements-dev.txt` from `pyproject.toml`, run the following command.
```
pip install pip-tools
pip-compile --extra dev pyproject.toml -o requirements-dev.txt
pip-compile pyproject.toml -o requirements.txt
```

## Tested installation via PyPI on the following Python versions:
| Python Version  | tested installed  |
| --------------- |:-----------------:|
| 3.9             | Yes               |
| 3.10            | Yes               |
| 3.11            | Yes               |
| 3.12            | Yes               |
| 3.13            | Yes               |
| 3.14            | Upcoming          |
nomad-camels-driver-derived-channels 0.1.3
Instrument driver for derived_channels for NOMAD CAMELS
Requires Python: >=3.9

# NOMAD Camels driver for derived hannels

This is a special driver for [NOMAD CAMELS](https://fau-lap.github.io/NOMAD-CAMELS/).
It can be used to directly calculate values from other channels inside CAMELS.


## How to use

You may add an arbitrary number of channels to each instance of this instrument.
Each channel can be configured either as readable or writable.

When you make the channel readable, you need to select which channels it depends on. The calculation formula should then depend on these channels.

A writable channel may only write to a single channel. The calculation formula is then, how the output is scaled. In that case, use `x` for the value written to the newly defined channel. For example when you want to define a new channel `scaled` that writes to the channel `channel1` of some instrument, you can write `x * 5` so when `scaled` is set to `2`, `channel1` will be set to `10`.

Alternatively, you can define a python function inside any file and select "From File" for the conversion (either read or write). Then select the file and set the name of the function that should be used for the conversion.
- For writing: The function may take only one argument (which will be the set value) and should return one value.
- For reading: Make sure that the function takes the read channels as arguments, for example:
```python
def read_conversion(read_channel_1, read_channel_2):
    return read_channel_1 + read_channel_2
```
or
```python
def read_conversion(**values):
    return values['read_channel_1'] + values['read_channel_2']
```


## Documentation

For more information on NOMAD CAMELS and instruments visit the [documentation](https://fau-lap.github.io/NOMAD-CAMELS/doc/instruments/instruments.html).


## Changelog

### 0.1.3
Made custom python functions more robust when the file is removed

### 0.1.2
Added functionality to use custom python functions.