Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM markstory/python2

COPY . /

RUN pip install networkx
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ Setup & Requirements
====================

pip install networkx

Docker Usage
====================

docker run --rm -v <host_file_path.csv:/new_container_path.csv> smadas/py2trust python /TrustVisualizer.py <new_container_path.csv>

Run Any Python2 File

docker run docker run --rm -v <host_file_path.csv:/new_container_path.csv> smadas/py2trust python <new_container_path.csv>
36 changes: 36 additions & 0 deletions trust_visualizer.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

##############################################################################
# Author: @Sma-Das
#
# Description: Simplify usage of Docker to execute this script.
#
#
# License: BSD 3-clause
##############################################################################

# Check if the number of arguments is correct
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <file_path>"
exit 1
fi

file_path=$1

# Check if the file path exists
if [ ! -e "$file_path" ]; then
echo "Error: File path '$file_path' does not exist."
exit 1
fi

# Check if the file path is a regular file
if [ ! -f "$file_path" ]; then
echo "Error: '$file_path' is not a regular file."
exit 1
fi

filename=$(basename "$file_path")

docker run --rm -v "${file_path}":"/${filename}" smadas/py2trust python "/${filename}"

exit 0