semvec/pypi-packages huggingface dataset:
pyflowmeter 0.2.4
CICFlowMeter V3 Python Implementation
License: MIT
Requires Python: >=3.7.0

# Python CICFlowMeter (PyFlowmeter)

> This project is cloned from [Python Wrapper CICflowmeter](https://gitlab.com/hieulw/cicflowmeter) and customized to fit my need. Therefore, it is not maintained actively. If there are any problems, please create an issue or a pull request.  


### Installation
```sh
pip install --upgrade pip
pip install pyflowmeter
```

# Usage
```python
from pyflowmeter.sniffer import create_sniffer
```
This function returns a `scapy.sendrecv.AsyncSniffer` object.

## Parameters

* `input_file` [default=None]  
    * A .pcap file where capture offline data from. If it is set to ´None´, the data will be capture from `input_interface`

* `input_interface` [default=None]  
    *  Interface or list of interfaces (default: None for sniffing on all interfaces).  

* `server_endpoint` [default=None]  
    * A server endpoint where the data of the flow will be sent. If it is set to `None`, no data will be sent.  

* `verbose` [default=False]  
    * Wheather or not to print a message when a new packet is read.

* `to_csv` [defalut=Fasle]  
    * Wheather or not to save the output flows as csv. The data will be saved on `output_file`.

* `output_file` [default=None]  
    * File to store the data. If `to_csv` is set to `False`, this parameter will be ignored.  

* `sending_interval` [defalut=1]  
    * The frequency, in seconds, at which data will be sent to the server. If `server_endpoint` is None, this parameter will be ignored.

## Examples

### Sniff packets real-time from interface and send the flow to a server every 5 seconds(**need root permission**): 
```python
from pyflowmeter.sniffer import create_sniffer

sniffer = create_sniffer(
            server_endpoint='http://127.0.0.1:5000/send_traffic',
            verbose=True,
            sending_interval=5
        )

sniffer.start()
try:
    sniffer.join()
except KeyboardInterrupt:
    print('Stopping the sniffer')
    sniffer.stop()
finally:
    sniffer.join()
```

### Get CSV analysis from a pcap file:
```python
from pyflowmeter.sniffer import create_sniffer

sniffer = create_sniffer(
            input_file='path_to_the_file.pcap',
            to_csv=True,
            output_file='./flows_test.csv',
        )

sniffer.start()
try:
    sniffer.join()
except KeyboardInterrupt:
    print('Stopping the sniffer')
    sniffer.stop()
finally:
    sniffer.join()
```

### Simulate offline traffic from a file and send the data to a server:
```python
from pyflowmeter.sniffer import create_sniffer

sniffer = create_sniffer(
            input_file='path_to_the_file.pcap',
            server_endpoint='http://127.0.0.1:5000/send_traffic',
        )

sniffer.start()
try:
    sniffer.join()
except KeyboardInterrupt:
    print('Stopping the sniffer')
    sniffer.stop()
finally:
    sniffer.join()
```

- Reference: https://www.unb.ca/cic/research/applications.html#CICFlowMeter
datafirst 0.1.5
A Python package for working with DataFirst database.
License: MIT
Requires Python: >=3.9.17,<4.0.0

# datafirst

<div align="center">

[![Build status](https://github.com/ckids_datafirst/datafirst/workflows/build/badge.svg?branch=master&event=push)](https://github.com/ckids_datafirst/datafirst/actions?query=workflow%3Abuild)
[![Python Version](https://img.shields.io/pypi/pyversions/datafirst.svg)](https://pypi.org/project/datafirst/)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/ckids_datafirst/datafirst/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Security: bandit](https://img.shields.io/badge/security-bandit-green.svg)](https://github.com/PyCQA/bandit)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/ckids_datafirst/datafirst/blob/master/.pre-commit-config.yaml)
[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/ckids_datafirst/datafirst/releases)
[![License](https://img.shields.io/github/license/ckids_datafirst/datafirst)](https://github.com/ckids_datafirst/datafirst/blob/master/LICENSE)
![Coverage Report](assets/images/coverage.svg)

Awesome `datafirst` is a Python cli/package created with https://github.com/TezRomacH/python-package-template

</div>

## Installation

```bash
pip install datafirst
```

## 🛡 License

[![License](https://img.shields.io/github/license/ckids_datafirst/datafirst)](https://github.com/ckids_datafirst/datafirst/blob/master/LICENSE)

This project is licensed under the terms of the `MIT` license. See [LICENSE](https://github.com/ckids_datafirst/datafirst/blob/master/LICENSE) for more details.

## 📃 Citation

```bibtex
@misc{datafirst,
  author = {ckids-datafirst},
  title = {Awesome `datafirst` is a Python cli/package created with https://github.com/TezRomacH/python-package-template},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ckids_datafirst/datafirst}}
}
```

## Credits [![🚀 Your next Python package needs a bleeding-edge project structure.](https://img.shields.io/badge/python--package--template-%F0%9F%9A%80-brightgreen)](https://github.com/TezRomacH/python-package-template)

This project was generated with [`python-package-template`](https://github.com/TezRomacH/python-package-template)