GithubHelp home page GithubHelp logo

populationstats's Introduction

This project uses pandas, pymysql, click and plotly to generate a population graph for a ss13 server

Installation

Install poetry https://python-poetry.org/docs/#installation

cd populationstats
poetry init
poetry run python populationstats/script.py 

Usage

First you need to refresh the local data from your servers database

poetry run python populationstats/script.py refresh-data

The script will prompt you for any required remaining values, but you can also pass them as options

Once this completes, you will have a local pickle file with the data from the database, now you can generate a graph using

poetry run python populationstats/script.py show-graph

It will open a browser window where you can examine the graph

Command reference

python populationstats/script.py
Usage: script.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  refresh-data  Grab the latest connection records from your database,...
  save-graph    Crunch the local data and write to an html file for...
  show-graph    Crunch the local data and open the resulting plotly plot...


Usage: script.py refresh-data [OPTIONS]

Options:
  --host TEXT             The mariadb/mysql host address
  --user TEXT             The mariadb/mysql user name
  --password TEXT         The mariadb/mysql user password
  --database TEXT         The mariadb/mysql database
  --tablename TEXT        The database table containing your connection
                          logging
  --filename TEXT         Where the database data is stored
  --startdate [%Y-%m-%d]  The starting date from which to generate the
                          playtime statistics
  --help                  Show this message and exit.

Usage: script.py save-graph [OPTIONS]

  Crunch the local data and write to an html file for display on the web

Options:
  --filename TEXT         Where the database data is stored
  --target-filename TEXT  Where to write the html page for the plot
  --help                  Show this message and exit.

Usage: script.py show-graph [OPTIONS]

  Crunch the local data and open the resulting plotly plot in your browser

Options:
  --filename TEXT  Where the database data is stored
  --help           Show this message and exit.

populationstats's People

Contributors

optimumtact avatar

Watchers

 avatar  avatar  avatar

Forkers

marksuckerberg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.