Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 22ef525

Browse files
committed
docs: update readme
1 parent f14b293 commit 22ef525

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

README.md

+41-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22

33
A command line tool for Twitch analytics. This is originally a group project of my class at school.
44

5+
Here is an eaxmple web page generated by this program.
6+
7+
![](./docs/res/web.png)
8+
9+
If you want to try this command line tool, you can go to [example](#example) part directry.
510
## Table of Contents
611

712
* [Backgournd](#background)
813
* [Installation](#installation)
914
* [Usage](#usage)
15+
+ [save-user](#save-user-command)
16+
+ [collect](#collect-command)
17+
+ [process](#process-command)
1018
* [Example](#example)
1119
+ [[Opitional] Save ID and Secret](#optional-save-id-and-secret)
1220
+ [Collect Data](#collect-data)
21+
+ [Process Data](#process-data)
1322
* [Guide for Developing This Tool](#guide-for-developing-this-tool)
1423
* [Other Available Online Resources](#other-available-online-resources)
1524
* [Contributors](#contributors)
@@ -41,6 +50,7 @@ Options:
4150

4251
Commands:
4352
collect Collect data for analysis
53+
process Process data and do visualization.
4454
save-user Save user id and secret key in `secret.yaml`.
4555
```
4656

@@ -59,7 +69,7 @@ Options:
5969
--help Show this message and exit.
6070
```
6171

62-
### collect command
72+
### collect Command
6373

6474
`collect` command is one of the most important command in this tool. It used to collect top games data and related streams data into csv files. Later, we can use these files to do data analysis.
6575

@@ -77,6 +87,24 @@ Options:
7787
--help Show this message and exit.
7888
```
7989

90+
### process Command
91+
92+
This command is to process data and show analized results in figures.
93+
94+
``` shell
95+
Usage: twitchanal process [OPTIONS]
96+
97+
Process data and do visualization.
98+
99+
Options:
100+
--debug Run in debug mode.
101+
-d, --dir TEXT Data directory.
102+
-t, --timestamp TEXT Data timestamp. Specify which csv file to use or the
103+
program will use the latest one by default.
104+
105+
--help Show this message and exit.
106+
```
107+
80108
## Example
81109

82110
### [Optional] Save ID and Secret
@@ -111,8 +139,18 @@ dataset
111139

112140
There suffix of the file name is a timestamp. It tells us when we collect the data. **But it is just a approximate time**. This tool uses the time of starting collect `top_games` as the timestamp for all data files. Since we do not need a accurate time to do data analysis. This is acceptable.
113141

114-
`top_games_xxxx.csv` contains the data of top games.
115-
`game_streams_xxxx.csv` contains the data of a certain game stream.
142+
- `top_games_xxxx.csv` contains the data of top games.
143+
- `game_streams_xxxx.csv` contains the data of a certain game stream.
144+
145+
### Process Data
146+
147+
``` shell
148+
twichanal process [-d] [-t]
149+
```
150+
151+
Program will create a web page and run on http://127.0.0.1:8050/
152+
153+
![](./docs/res/web.png)
116154

117155
## Guide for Developing This Tool
118156

src/twitchanal/cli.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ def collect(dir: str, timestamp: bool, num: int, stream: int, extra: bool,
6969
is_flag=True,
7070
default=False,
7171
help='Run in debug mode.')
72-
@click.option('--dir', '-d',
73-
default='dataset',
74-
help='Data directory.')
75-
@click.option('--timestamp', '-t',
76-
default=None,
77-
help='Data timestamp.')
72+
@click.option('--dir', '-d', default='dataset', help='Data directory.')
73+
@click.option(
74+
'--timestamp',
75+
'-t',
76+
default=None,
77+
help=
78+
'Data timestamp. Specify which csv file to use or the program will use the latest one by default.'
79+
)
7880
def process(debug: bool, dir: str, timestamp: str):
7981
""" Process data and do visualization.
8082
"""

0 commit comments

Comments
 (0)