GithubHelp home page GithubHelp logo

ptaf-report's Introduction

Reporting tool for PT AF

This tools is designed to use with data produced by ptaf-export tool. Report template should be created using python-docx-template syntax.

Prerequisites

  • python

  • pip

    python3 -m pip install --user --upgrade pip
    
  • virtualenv

    On macOS and Linux:

    python3 -m pip install --user virtualenv
    

    On Windows:

    py -m pip install --user virtualenv
    

Installation

  1. Clone the project by git or extract zip with code

  2. Create virtual environment in the project folder:

    On macOS and Linux:

    python3 -m venv env
    

    On Windows:

    py -m venv env
    
  3. Activate virtual environment:

    On macOS and Linux:

    source env/bin/activate
    

    On Windows:

    .\env\Scripts\activate
    
  4. Install dependencies

    pip install -r requirements.txt
    

Usage

  1. Activate virtual environment

    On macOS and Linux:

    source env/bin/activate
    

    On Windows:

    .\env\Scripts\activate
    
  2. Copy data files produced by ptaf-export to the project folder.

  3. Copy template file to the project folder.

  4. Run run.py

    (venv) ubuntu@ubuntu:~/ptaf-report$ python3 ./run.py -h
    usage: run.py [-h] [-t TEMPLATE_FILE] [-o REPORT_FILE] [-m META_FILE] [-r RULES_FILE] [-p PROTECTORS_FILE]
                  [-e EVENTS_FILE] [--ua-csv-file UA_CSV]
    
    Build report with exported data from PT AF
    
    optional arguments:
    -h, --help          show this help message and exit
    -t TEMPLATE_FILE, --template TEMPLATE_FILE
                        template file name, template.docx by default
    -o REPORT_FILE, --output REPORT_FILE
                        report file name, report.docx by default
    -m META_FILE, --meta META_FILE
                        meta file name, meta.csv by default
    -r RULES_FILE, --rules RULES_FILE
                        rules file name, rules.csv by default
    -p PROTECTORS_FILE, --protectors PROTECTORS_FILE
                        protectors file name, protectors.csv by default
    -e EVENTS_FILE, --events EVENTS_FILE
                        events file name, events.csv by default
    --ua-csv-file UA_CSV  Filename to store UA stats (optional)
    
  5. Deactivate virtual environment if needed

    deactivate
    

Demo

  1. Copy data files (.csv) and report template (report.docx) from demo folder to project folder:
  2. Activate virtual environment
  3. Run run.py with no parameters
    (venv) ubuntu@ubuntu:~/ptaf-report$ python3 ./run.py 
    [~] Starting to build report based on template.docx
    [+] Report saved to report.docx
    (venv) ubuntu@ubuntu:~/ptaf-report$ 
    
  4. Open generated report from report.docx

ptaf-report's People

Contributors

b4bay avatar honeybot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.