GeoUsage
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
- Python 3
- virtualenv
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
Metadata
Release files for GeoUsage 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| GeoUsage-0.1.0.tar.gz | 9.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| GeoUsage-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / GeoUsage-0.1.0.tar.gz
| Download URL | GeoUsage-0.1.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a4be407f2c3d2e3b1fe0bea65467a5a52d4a230435eb7b53df21df2c9087f20
|
|
BLAKE2b-256 checksum How to use checksums |
74628cb26454cfd11dfca6b726995b37de4a1c8370a2811759a05e3d8cb3ad8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6
|
Release files / GeoUsage-0.1.0-py2.py3-none-any.whl
| Download URL | GeoUsage-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
71b16f7aebe7f7ec597d4ce07c44cc83181584920056ca39715129e444ad81b9
|
|
BLAKE2b-256 checksum How to use checksums |
8aacfc0a968118ecf2ee7fc709b1ebf29664e250dd6f6f82fea32d3bdc3022e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6
|
Security for GeoUsage 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.