Releases: Kaszanas/SC2AnonServerPy
1.1.0 SC2AnonyServerPy Release
What's Changed
- [PR] Moved all source to src directory by @Kaszanas in #4
- [PR] Adjusted Imports, Moved Files by @Kaszanas in #5
- [PR] 7 Docker Support by @Kaszanas in #8
- [PR] Add Pre-commit by @Kaszanas in #10
- [PR] Renamed Default Data Directory by @Kaszanas in #13
- [PR] Added pre-commit to GitHub Actions by @Kaszanas in #14
- [PR] Using Path, Added Typer to grpc_server by @Kaszanas in #17
- [PR] Added Separate Multiprocssing Args by @Kaszanas in #19
- [PR] All CLI Using Typer by @Kaszanas in #20
- [PR] Adjusted CLI Usage and Instructions by @Kaszanas in #22
- [PR] Test With SC2reader by @Kaszanas in #26
- [PR] Release 1.1.0 by @Kaszanas in #27
Full Changelog: 1.0.1...1.1.0
SC2AnonServerPy
This project is used for weak anonymization of StarCraft II replays for research. Depending on further parsing and extraction implementations this project can assist with replacing toon identifiers (unique) or nicknames (not unique) with a weak anonymized ID or a customized function.
Installation
Note
To run this project there are some prerequisites that you need to have installed on your system:
- Docker
- Optional make (if you do not wish to use make, please refer to the commands defined in the
makefileand run them manually)
Our prefered way of distributing the toolset is through DockerHub. We use the Docker Image to provide a fully reproducible environment for our scripts.
To pull the image from DockerHub, run the following command:
docker pull kaszanas/datasetpreparator:latestIf you wish to clone the repository and build the Docker image yourself, run the following command:
make docker_buildUsage
- Place replays in
./processing/demos/inputwhich is a default path for the replay input. - Open a terminal and run
make grpc_server, which is responsible for persistent anonymization process. - Open another terminal and run
make grpc_clientwith default command line arguments to start up a sample replay processing. - The resulting processed files will be placed in
./processing/demos/outputby default. - Turn off the server by a keyboard interrupt (CTRL+C).
CLI Usage
The grpc_server.py script is used to start the gRPC anonymization server. The script has the following command line arguments:
Usage: grpc_server.py [OPTIONS]
Options:
--anonymized-db-path FILE Path to the .pickle file that will be used to
store anonymized nicknames. [required]
--help Show this message and exit.
The grpc_client.py script is used to start the replay processing. The script has the following command line arguments:
Usage: grpc_client.py [OPTIONS]
Options:
--replay-directory DIRECTORY Path to the directory that contains
.SC2Replay files. [required]
--output-directory DIRECTORY Path to the directory where .pickle files
for processed replays will be saved.
[required]
--agents INTEGER Number of multiprocessing agents. [default:1]
--chunksize INTEGER Number of replays to process by each agent.
[default: 1]
--multiprocessing / --no-multiprocessing
True if multiprocessing should be used.
[default: no-multiprocessing]
--anonymize-toon / --no-anonymize-toon
True if the unique toon should be
anonymized. [default: anonymize-toon]
--anonymize-chat / --no-anonymize-chat
True if chat should be anonymized.
[default: anonymize-chat]
--help Show this message and exit.
Implementation Notes
If You would like to implement a custom anonymization function please see the Listener class in grpc_server.py.
For the sake of logging and comments when "nickname" is mentioned it means any string that is meant to be anonymized and is sent to the gRPC server for that matter.
Pleaase keep in mind that the grpc_client.py is a sample implementation and uses https://github.com/ggtracker/sc2reader to perform processing.
1.0.1 SC2AnonyServerPy Release
SC2AnonServerPy
This project is used for weak anonymization of StarCraft II replays for research. Depending on further parsing and extraction implementations this project can assist with replacing toon identifiers (unique) or nicknames (not unique) with a week anonymized ID or a customized function.
Usage
grpc_server.py- Server used to synchronize anonymization.grpc_client.py- Client with multiprocessing of replays using gRPC server for persistent anonymization.
-
Install Python 3.7.7
-
OPTIONAL: Create a virtual environment by running the following command (replace
<path_to_venv>with a path)python -m venv <path_to_venv>. -
OPTIONAL: Activate the environment which You created.
-
Install
requirements.txtby performing the following commandpip install -r requirements.tIn order to begin processing please installrequirements.txtand follow these steps: -
Place replays in
./DEMOS/Inputwhich is a default path for the replay input. -
Run
python grpc_server.py, which is responsible for persistent anonymization process. -
Run
python grpc_client.pywith command line arguments which will start up a sample replay processing usage below:
usage: grpc_client.py [-h] [--input_dir INPUT_DIR] [--output_dir OUTPUT_DIR]
[--agents AGENTS] [--chunksize CHUNKSIZE]
[--use_multiprocessing USE_MULTIPROCESSING]
[--anonymize_toon ANONYMIZE_TOON]
[--anonymize_chat ANONYMIZE_CHAT]
StarCraft II replay processing tool that uses multiprocessing.
optional arguments:
-h, --help show this help message and exit
--input_dir INPUT_DIR
Provide the path to the input directory that contains
.SC2Replay files.
--output_dir OUTPUT_DIR
Provide the path to the output directory that will
contain .pickle files.
--agents AGENTS Provide how much agents will be available in the pool
for execution.
--chunksize CHUNKSIZE
Provide how much replays are to be processed at once.
--use_multiprocessing USE_MULTIPROCESSING
Set this flag to true if You would like to use
multiprocessing.
--anonymize_toon ANONYMIZE_TOON
Set this flag to true if You would like to perform
toon/nickname anonymization.
--anonymize_chat ANONYMIZE_CHAT
Set this flag to true if You would like to perform
chat anonymization.
- The resulting processed files will be placed in
./DEMOS/Outputby default.
Notes
If You would like to implement a custom anonymization function please see the Listener class in grpc_server.py.
For the sake of logging and comments when "nickname" is mentioned it means any string that is meant to be anonymized and is sent to the gRPC server for that matter.
Pleaase keep in mind that the grpc_client.py is a sample implementation and uses https://github.com/ggtracker/sc2reader to perform processing.
1.0.0 SC2AnonServerPy Release
SC2AnonServerPy
This project is used for weak anonymization of StarCraft II replays for research. Depending on further parsing and extraction implementations this project can assist with replacing toon identifiers (unique) or nicknames (not unique) with a week anonymized ID or a customized function.
Usage
grpc_server.py- Server used to synchronize anonymization.grpc_client.py- Client with multiprocessing of replays using gRPC server for persistent anonymization.
-
Install Python 3.7.7
-
OPTIONAL: Create a virtual environment by running the following command (replace
<path_to_venv>with a path)python -m venv <path_to_venv>. -
OPTIONAL: Activate the environment which You created.
-
Install
requirements.txtby performing the following commandpip install -r requirements.tIn order to begin processing please installrequirements.txtand follow these steps: -
Place replays in
./DEMOS/Inputwhich is a default path for the replay input. -
Run
python grpc_server.py, which is responsible for persistent anonymization process. -
Run
python grpc_client.pywith command line arguments which will start up a sample replay processing usage below:
usage: grpc_client.py [-h] [--input_dir INPUT_DIR] [--output_dir OUTPUT_DIR]
[--agents AGENTS] [--chunksize CHUNKSIZE]
[--use_multiprocessing USE_MULTIPROCESSING]
[--anonymize_toon ANONYMIZE_TOON]
[--anonymize_chat ANONYMIZE_CHAT]
StarCraft II replay processing tool that uses multiprocessing.
optional arguments:
-h, --help show this help message and exit
--input_dir INPUT_DIR
Provide the path to the input directory that contains
.SC2Replay files.
--output_dir OUTPUT_DIR
Provide the path to the output directory that will
contain .pickle files.
--agents AGENTS Provide how much agents will be available in the pool
for execution.
--chunksize CHUNKSIZE
Provide how much replays are to be processed at once.
--use_multiprocessing USE_MULTIPROCESSING
Set this flag to true if You would like to use
multiprocessing.
--anonymize_toon ANONYMIZE_TOON
Set this flag to true if You would like to perform
toon/nickname anonymization.
--anonymize_chat ANONYMIZE_CHAT
Set this flag to true if You would like to perform
chat anonymization.
- The resulting processed files will be placed in
./DEMOS/Outputby default.
Notes
If You would like to implement a custom anonymization function please see the Listener class in grpc_server.py.
For the sake of logging and comments when "nickname" is mentioned it means any string that is meant to be anonymized and is sent to the gRPC server for that matter.
Pleaase keep in mind that the grpc_client.py is a sample implementation and uses https://github.com/ggtracker/sc2reader to perform processing.