semvec/pypi-packages huggingface dataset:
htmlobj 1.30.0
htmlobj
Requires Python: >=3.10

htmlobj
=======

`htmlobj` allows you to easily create complex HTML (or XML, xHTML) using nothing but Python code.  It is an alternative to using templates in web frameworks, which usually have their own language syntax.

## Example:

``` py
from htmlobj import HTML

h = HTML("html")
h.head.title("My Page")  # can chain tags if only 1 subitem
with h.body:  # use `with` for multiple subitems
    h.p.u("Paragraph 1 underlined")
    with h.p("Paragraph 2 ", class_="p2"):  # add attributes too
        h.b("bold")  
        h.text(", not bold") # add additional text
print(h)
```

Which outputs:

```html
<html>
<head>
<title>My Page</title>
</head>
<body>
<p><u>Paragraph 1 underlined</u></p>
<p class="p2">Paragraph 2 <b>bold</b>, not bold</p>
</body>
</html>
```

Note that the `class_` attribute has a trailing underscore because `class` is a Python keyword.


## New Features

`htmlobj` is a re-packaging of [html3](https://github.com/pavelliavonau/html3/),  with further Python 3 modernization and additional functionality added.

One added feature is creating an `htmlobj.HTML` instance from existing html, either as a string (`HTML.from_html`), or from a url (`HTML.from_url`):

``` py
h = HTML.from_url("https://example.com/")
```

This will often be used in combination with another new feature, `HTML.codify`, to *generate Python code* using `htmlobj`, for you.  Start with a page that is similar to what you want to create, then modify as needed, e.g. to programatically fill in data for that page.

``` py
print(h.codify())
```

which gives output like:

```
h = HTML()
with h.html:
    with h.head:
        h.title("Example Domain")
        h.meta(charset="utf-8")
        h.meta(http-equiv="Content-type", content="text/html; charset=utf-8")
...
```

You can then copy this output as a starting point for you own code, to make a webpage similar to the one passed to `from_url`.

Note:  you can also achieve a `from_url` / `codify` combination from the command line by running `htmlobj.html_parser` with `python -m`:

```
python -m htmlobj.html_parser https://example.com > my_code.py
```


## Installation

```
pip install htmlobj
```


## Next Steps

See [Getting Started](https://darcymason.github.io/htmlobj/getting_started/) for more examples and detailed usage information.
pyflow-detect 0.0.1
Detect port scans in your network with python
Requires Python: >=3.6

<h1 align="center"> 🐍 pyFlowDetect </h1>

Detect port scans in your network with python | Detecte escaneos de puertos dentro de su red con python.

This project uses machine learning and network traffic analysis techniques for port scan detection. It combines data extraction, preprocessing and classification with algorithms such as Decision Trees and Random Forest. It is a tool designed to strengthen cybersecurity through a practical, technical and scalable approach.

## Install | Instalacion
### Linux

```bash
pip install pyflow-detect
```


## Usage | Uso
This project needs several `.argus files`, i.e. network flow information files, stored in `./trainData/netflows`. These files must have legitimate network flows and port scan network flows. You can generate those files using argus and argus clients to record network activity, or converting existing .pcap files to a netflow version (.argus). Refer to [argus documentation](https://openargus.org/using-argus) on how to do that.

One condition to generete these files is to keep track of wich computers in the network are the attackers, and wich ones are innocents, i.e. we need their ips. Then `variables.json` file needs these ips in scannerIps and targetIps properties respectively. Aditionally it needs the password for sudo privileges when running the trainer.

The `variables.json` file  looks like
```json
{
    "argusConfig": "./netflowConfFiles",
    "trainingData": "./trainData/netflows",
    "demoData": "./demoData",
    "scannerIps": ["scanner ip here", "scanner ip here"], 
    "targetIps": ["target ip here", "target ip here"] ,
    "password": "password here"
}
```
Finnally running the following
1. `train.py` file will generate a bagging trained model with the following steps:

[![mydecisiontree.png](https://i.postimg.cc/rpKw7dxR/mydecisiontree.png)](https://postimg.cc/gwbpZ2MG)

* In case you want to see the procedure step by step or run it in jupyter notebook you can use `Entrenamiento.ipynb`

2. `pyDetect.py` To see the model in action run `pyDetect.py` to view a real time netflow clasification. It will search for a model called
   `rFOrest.pkl` and it will use argus in daemon mode to fetch the network traffic on the machine.





## License
This project is licensed under MIT. Contributions to this project are accepted under the same license.