Skip to main content

GeoUsage is a pure Python package to read and write NASA Southern Hemisphere ADditional OZonesondes (SHADOZ) data.

Project description

GeoUsage

Build Status

Metrics Analysis for OGC Web Services

Overview

GeoUsage is a pure Python package providing OGC Web Services usage analysis.

Installation

The easiest way to install GeoUsage is via pip:

pip install GeoUsage

This assumes you have the privileges to install GeoUsage on your system which may require administrator/root privileges. For isolated installations, see Installing GeoUsage in a virtualenv.

Requirements

Dependencies

Dependencies are listed in requirements.txt. Dependencies are automatically installed during GeoUsage installation.

Installing GeoUsage in a virtualenv

Using a virtualenv allows for isolated installations which do not affect system wide dependencies which require administrative/root privileges. To install to a virtualenv, perform the following steps:

# setup virtualenv
python3 -m venv GeoUsage
cd GeoUsage
source bin/activate

# clone codebase and install
git clone https://github.com/geopython/GeoUsage.git
cd GeoUsage
python3 setup.py install

Running

cp GeoUsage-config.env local.env
vi local.env # update environment variables accordingly

# help
GeoUsage --help

# get version
GeoUsage --version

# perform WMS analysis on an Apache logfile on any WMS endpoint
GeoUsage log analyze --service-type=OGC:WMS --logfile </path/to/apache_logfile>

# perform WMS analysis on an Apache logfile on a specific WMS endpoint
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile>

# perform WMS analysis on an Apache logfile for a single date
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --time=2018-01-26

# perform WMS analysis on an Apache logfile for a date range
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --time=2018-01-26/2018-01-27

# perform WMS analysis on an Apache logfile for a single datetime
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --time=2018-01-26T11:11:11

# perform WMS analysis on an Apache logfile for a datetime range
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --time=2018-01-26T11:11:11/2018-01-27T12:32:11

# resolve IP addresses
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --verbosity=INFO --resolve-ips

# show top 10 unique IPs and top 10 layers
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --verbosity=INFO --resolve-ips --top=10

# add verbose mode
GeoUsage log analyze --service-type=OGC:WMS --endpoint=/ows --logfile </path/to/apache_logfile> --verbosity=INFO

# query a Mailman mailing list member count
GeoUsage mailing_list member_count

Using the API

from GeoUsage.mailman import MailmanAdmin

ma = MailmanAdmin('http://example.org/mailman/admin/list', 'secret')
print(ma.member_count)

Development

Running Tests

# install dev requirements
pip install -r requirements-dev.txt

# run tests like this:
python3 GeoUsage/tests/run_tests.py

# or this:
python3 setup.py test

# measure code coverage
coverage run --source=GeoUsage -m unittest GeoUsage.tests.run_tests
coverage report -m

Releasing

python3 setup.py sdist bdist_wheel --universal
twine upload dist/*

Code Conventions

Bugs and Issues

All bugs, enhancements and issues are managed on GitHub.

Contact

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

GeoUsage-0.1.0.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

GeoUsage-0.1.0-py2.py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 2 Python 3

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