Skip to main content

Library for parsing of awstats result files

Project description

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

Changes

  • 1.2.0 - added available property 2010-01-26 - rnix - added latest property 2010-01-26 - rnix - added logger and log some warnings and errors 2010-01-26 - rnix

  • 1.1 - released on pypi ????-??-?? - jensens

  • 1.0 - initial work - rnix, jensens

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bda.awstatsparser-1.2.0.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file bda.awstatsparser-1.2.0.tar.gz.

File metadata

File hashes

Hashes for bda.awstatsparser-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b6213328953b7baa60d225795caa0c5dde295f859952d4177f634be0f22e5c31
MD5 718e326efae5bb387fa2e35d42795fb1
BLAKE2b-256 ae28282d6dbf609aa0f1610055c3b0a316192d87b8ab5cfd7b57e6ec3e212857

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page