Giter Site home page Giter Site logo

tagcounter's Introduction

Overview

tagcounter -h                   # get usage
tagcounter -g http://a.tim.ua   # count tags in http://a.tim.ua and print to STDOUT in parsable format
tagcounter -v http://a.tim.ua   # get previously fetched info about tags from DB and print to STDOUT in parsable format
tagcounter -v a                 # the same by alias
tagcounter                      # run GUI

Tool for count tags by URI. With command line args tagcounter prints the results to STDOUT in parsable format:

uri|db <URI> {<tag1>: <number>[, <tag2>: <number>] ... }
1-st fiels is source - 'db' or 'uri'
2-hd filed is requested URI
3-d fiels is result in '{}'

The results saved locally in a sqlite base and could be fetched later via '-v' arg (or GUI).

Aliases could be defined in the YAML config file which passed in '--cfg' parameter (default ./tagcounter.yaml). Example:

$ cat ./tagcounter.yaml
a: http://a.tim.ua
ggl: http://google.com
epam: http://epam.com

then it could be called by alias instead of a full URL:

tagcounter -g a epam ggl
tagcounter -v a epam ggl

Installation

pip install https://github.com/kubrack/tagcounter.git

testing

git clone https://github.com/kubrack/tagcounter.git
cd tagcounter
pip install -e . # or python3 setup.py develop
py.test

Usage

usage: tagcounter [-h] [--get URI|alias [URI|alias ...]]
                  [--view URI|alias [URI|alias ...]] [--cfg [cfgfile]]
                  [--log [logile]]

Tool for tags count.

optional arguments:
  -h, --help            show this help message and exit
  --get URI|alias [URI|alias ...], -g URI|alias [URI|alias ...]
                        URI or alias to tags counting
  --view URI|alias [URI|alias ...], -v URI|alias [URI|alias ...]
                        URI or alias to get saved from DB
  --cfg [cfgfile], -c [cfgfile]
                        YAML config file, default "./tagcounter.yaml"
  --log [logile], -l [logile]
                        logfile, default "tagcounter.log"

Example

$ tagcounter -v http://a.tim.ua -g http://epam.com http://google.com
uri http://epam.com {'html': 1, 'head': 1, 'meta': 17, 'link': 12, 'script': 21, 'title': 1, 'body': 1, 'a': 316, 'img': 74, 'div': 461, 'noscript': 1, 'iframe': 1, 'header': 1, 'nav': 5, 'ul': 74, 'li': 257, 'span': 122, 'button': 37, 'strong': 21, 'p': 122, 'svg': 38, 'use': 38, 'form': 1, 'label': 1, 'input': 1, 'h3': 15, 'main': 1, 'video': 1, 'h2': 33, 'section': 10, 'br': 226, 'time': 1, 'hr': 2, 'b': 2, 'h5': 82, 'sup': 5, 'footer': 1}
uri http://google.com {'html': 2, 'head': 2, 'meta': 19, 'link': 12, 'script': 26, 'title': 2, 'body': 2, 'a': 334, 'img': 76, 'div': 475, 'noscript': 1, 'iframe': 1, 'header': 1, 'nav': 5, 'ul': 74, 'li': 257, 'span': 130, 'button': 37, 'strong': 21, 'p': 123, 'svg': 38, 'use': 38, 'form': 2, 'label': 1, 'input': 10, 'h3': 15, 'main': 1, 'video': 1, 'h2': 33, 'section': 10, 'br': 231, 'time': 1, 'hr': 2, 'b': 3, 'h5': 82, 'sup': 5, 'footer': 1, 'style': 3, 'nobr': 2, 'u': 1, 'center': 1, 'table': 1, 'tr': 1, 'td': 3}
db http://a.tim.ua {'html': 1, 'head': 1, 'meta': 4, 'title': 1, 'style': 1, 'body': 1, 'table': 1, 'tbody': 1, 'tr': 3, 'td': 3, 'h3': 1, 'b': 7, 'a': 1, 'p': 18, 'br': 4, 'ul': 8, 'li': 27}

tagcounter's People

Watchers

Oleksandr Kubrak 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.