https://github.com/bluedynamics/bda.awstatsparser
Library for parsing awstats result files
https://github.com/bluedynamics/bda.awstatsparser
Last synced: about 1 year ago
JSON representation
Library for parsing awstats result files
- Host: GitHub
- URL: https://github.com/bluedynamics/bda.awstatsparser
- Owner: bluedynamics
- License: other
- Created: 2012-11-15T15:42:49.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-05T07:33:49.000Z (over 13 years ago)
- Last Synced: 2025-02-03T18:38:56.329Z (over 1 year ago)
- Language: Python
- Size: 152 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
Usage
=====
This egg contains a parser for ``AwStats`` files, providing a convenient
``dict`` like API::
>>> from bda.awstatsparser.defaults import (
... PREFIX,
... POSTFIX,
... SECTIONDEFS,
... )
``PREFIX`` and ``POSTFIX`` are used to build the target stats file path,
``SECTIONDEFS`` defines the expected structure of the stats file and the keys
to use for providing the several values.
The API is provided due to the ``ParsedStatistics`` class::
>>> from bda.awstatsparser.parser import ParsedStatistics
>>> parser = ParsedStatistics(domain='same_as_awstats_conf_name',
... dir='/var/lib/awstats',
... PREFIX, POSTFIX, SECTIONDEFS)
You can ask for ``available`` stats keys::
>>> parser.available
['012010', '122009']
You can query the ``latest`` available stats key::
>>> parser.latest
'012010'
Access some stats information::
>>> sider = parser[parser.latest]['SIDER']
>>> stat = sider['/path/which/was/logged']
>>> stat['pages']
99
Contributors
============
- Jens Klein
- Robert Niederreiter