GithubHelp home page GithubHelp logo

traffic-counter's Introduction

Traffic Counter


Running the program

Install requirements

$ pip3 install requirements.txt

Run the program

$ python3 counter.py  # to use default 'traffic.log'
$ python3 counter.py $FILE_NAME  # to use a different logfile

You should see something similar to the output below:

============= Total ============
398
============= Daily ============
2016-12-01 179
2016-12-05 81
2016-12-08 134
2016-12-09 4
============= Most =============
2016-12-01T07:30:00 46
2016-12-01T08:00:00 42
2016-12-08T18:00:00 33
============= Least ============
2016-12-05 11:00:00 7

Run unit tests

$ pytest

Hopefully you will see something similar to this:

================= 5 passed in 0.75s =================

Files in this repo

.
├── README.md
├── counter.py  # the actual program
├── requirements.txt  # packages
├── test_counter.py  # pytest unit tests
└── traffic.log  # example logfile 

traffic-counter's People

Contributors

ijkeleher avatar

Watchers

James Cloos avatar  avatar

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.