Skip to content

Commit

Permalink
Added script to get dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphor committed Sep 25, 2024
1 parent 74d076a commit de7a6fa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
cov.xml
dist/
docs/_build
backup/
backup/
dataset
23 changes: 23 additions & 0 deletions get_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Downloads a dataset."""
from os import remove, rename
from requests import session
from zipfile import ZipFile

EXIT_SUCCESS = 0
DATASET = "dataset.zip"
URL = "https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES/archive/refs/heads/master.zip"

def main() -> int:
"""Downloads a dataset."""
with session() as client:
repo = client.get(URL)
with open(DATASET, 'wb') as download:
download.write(repo.content)
with ZipFile(DATASET, 'r') as dataset:
dataset.extractall(".")
rename("EVTX-ATTACK-SAMPLES-master", "dataset")
remove(DATASET)
return EXIT_SUCCESS

if __name__ == "__main__":
main()

0 comments on commit de7a6fa

Please sign in to comment.