diff options
Diffstat (limited to '')
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | bin/online_sessions.py (renamed from bin/online_duration.py) | 4 | ||||
-rw-r--r-- | docs/online_sessions.md (renamed from docs/online_duration.md) | 24 | ||||
-rw-r--r-- | docs/track_status.md | 4 |
4 files changed, 19 insertions, 19 deletions
@@ -7,7 +7,7 @@ Prerequisites ------------- Python 3.4 or higher is required. -Additionally, [online_duration.py] uses the excellent [matplotlib] plotting +Additionally, [online_sessions.py] uses the excellent [matplotlib] plotting library. The versions below have been verified to work properly. @@ -32,12 +32,12 @@ The supplied scripts are listed below. * [mutual_friends.py] — Learn who your ex and her new boyfriend are both friends with. * [track_status.py] — Track when people go online/offline. -* [online_duration.py] — View/visualize the amount of time people spend +* [online_sessions.py] — View/visualize the amount of time people spend online. [mutual_friends.py]: docs/mutual_friends.md [track_status.py]: docs/track_status.md -[online_duration.py]: docs/online_duration.md +[online_sessions.py]: docs/online_sessions.md License ------- diff --git a/bin/online_duration.py b/bin/online_sessions.py index ac9251b..3732f4c 100644 --- a/bin/online_duration.py +++ b/bin/online_sessions.py @@ -413,7 +413,7 @@ def _parse_args(args=sys.argv): return parser.parse_args(args[1:]) -def write_online_duration( +def process_online_sessions( db_fd, db_fmt=DatabaseFormat.CSV, fd=sys.stdout, fmt=OutputFormat.CSV, group_by=GroupBy.USER, @@ -430,7 +430,7 @@ def write_online_duration( def main(args=sys.argv): args = _parse_args(args) - write_online_duration(**vars(args)) + process_online_sessions(**vars(args)) if __name__ == '__main__': main() diff --git a/docs/online_duration.md b/docs/online_sessions.md index f5c703b..e6b4b08 100644 --- a/docs/online_duration.md +++ b/docs/online_sessions.md @@ -1,4 +1,4 @@ -online_duration.py +online_sessions.py ================== View/visualize the amount of time people spend online. @@ -9,8 +9,8 @@ Usage Run from the top-level directory using `python -m`: ``` -> python -m bin.online_duration -h -usage: online_duration.py [-h] [-g {user,date,weekday,hour}] +> python -m bin.online_sessions -h +usage: online_sessions.py [-h] [-g {user,date,weekday,hour}] [-i {csv,log,null}] [-o {csv,json,plot}] [-a TIME_FROM] [-b TIME_TO] input [output] @@ -24,7 +24,7 @@ For example (assuming the database in "db.csv" was generated by [track_status.py] before): ``` -> python -m bin.online_duration db.csv +> python -m bin.online_sessions db.csv 89497105,John,Smith,john.smith,0:12:31 3698577,Jane,Smith,jane.smith,1:34:46 ``` @@ -36,7 +36,7 @@ The output format is CSV (comma-separated values) by default. You can also get a JSON document: ``` -> python -m bin.online_duration --output-format json db.csv +> python -m bin.online_sessions --output-format json db.csv [ { "uid": 89497105, @@ -63,7 +63,7 @@ For example (assuming that both Jane and Joe spent their time online on Friday, June 17, 2016). ``` -> python -m bin.online_duration --output-format json --group-by date db.csv +> python -m bin.online_sessions --output-format json --group-by date db.csv [ { "date": "2016-06-17", @@ -73,7 +73,7 @@ June 17, 2016). ``` ``` -> python -m bin.online_duration --output-format csv --group-by weekday db.csv +> python -m bin.online_sessions --output-format csv --group-by weekday db.csv Monday,0:00:00 Tuesday,0:00:00 Wednesday,0:00:00 @@ -84,7 +84,7 @@ Sunday,0:00:00 ``` ``` -> python -m bin.online_duration --group-by hour db.csv +> python -m bin.online_sessions --group-by hour db.csv 0:00:00,0:00:00 1:00:00,0:00:00 2:00:00,0:00:00 @@ -117,25 +117,25 @@ To produce a plot, pass `plot` as the `--output-format` parameter value and add a file path to write the image to. ``` -> python -m bin.online_duration --output-format plot db.csv user.png +> python -m bin.online_sessions --output-format plot db.csv user.png ``` ![user.png] ``` -> python -m bin.online_duration --output-format plot --group-by date db.csv date.png +> python -m bin.online_sessions --output-format plot --group-by date db.csv date.png ``` ![date.png] ``` -> python -m bin.online_duration --output-format plot --group-by weekday db.csv weekday.png +> python -m bin.online_sessions --output-format plot --group-by weekday db.csv weekday.png ``` ![weekday.png] ``` -> python -m bin.online_duration --output-format plot --group-by hour db.csv hour.png +> python -m bin.online_sessions --output-format plot --group-by hour db.csv hour.png ``` ![hour.png] diff --git a/docs/track_status.md b/docs/track_status.md index be4764a..8fe0746 100644 --- a/docs/track_status.md +++ b/docs/track_status.md @@ -30,11 +30,11 @@ For example (using made up user IDs/"screen names"), By default, the script produces a human-readable log. Use the `--log` parameter to write the log to a file. If you want to record when people go online/offline for further analysis using -[online_duration.py], specify the path to a database using the `--output` +[online_sessions.py], specify the path to a database using the `--output` parameter. Be careful: if the file already exists, it will be overwritten! -[online_duration.py]: online_duration.md +[online_sessions.py]: online_sessions.md See also -------- |