Metadata-Version: 2.1
Name: udata-metrics
Version: 2.0.5.dev199
Summary: Connexion handler to metrics service for udata
Home-page: https://github.com/opendatateam/udata-metrics
Author: Open Data Team
Author-email: contact@opendata.team
License: AGPL
Keywords: udata metrics
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Environment :: Web Environment
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: System :: Software Distribution
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: udata >=8.0.1
Requires-Dist: udata-front >=4.0.0
Provides-Extra: test
Requires-Dist: httpretty ==1.1.4 ; extra == 'test'
Requires-Dist: mock ==5.0.1 ; extra == 'test'
Requires-Dist: pytest-flask ==1.2.0 ; extra == 'test'
Requires-Dist: pytest-sugar ==0.9.6 ; extra == 'test'
Requires-Dist: pytest ==7.2.1 ; extra == 'test'
Requires-Dist: requests-mock ==1.10.0 ; extra == 'test'

# udata-metrics

This plugin adds views to display metrics on datasets, reuses, organizations and site dashboard pages.
It uses hook logic based on udata-front hooks.
We feed these views with data from:
    * an optional metrics API for traffic (views, download, external links)
    * mongo for stock values (with an aggregation pipeline)
A job can be scheduled to inject traffic metrics in udata's objects metrics.

## Installation

Install [udata](https://github.com/opendatateam/udata).  

Remain in the same virtual environment (for Python).

Install **udata-metrics**:

```shell
pip install udata-metrics
```

Modify your local configuration file of **udata** (typically, `udata.cfg`) as following:

```python
PLUGINS = ['metrics']
METRICS_API = 'http://localhost:8005/api'
```

# Changelog

## Current (in progress)

- Nothing yet

## 2.0.4 (2025-03-14)

- Compute dataservices metrics in update-metrics job [#16](https://github.com/opendatateam/udata-metrics/pull/16)

## 2.0.3 (2024-05-28)

- Migrate to Python 3.11 following `udata` dependencies upgrade [#14](https://github.com/opendatateam/udata-metrics/pull/14)
- Add `resources_downloads` to datasets metrics and refactor `update_metrics_for_models` task [#15](https://github.com/opendatateam/udata-metrics/pull/15)

## 2.0.2 (2024-03-20)

- Update translations [#13](https://github.com/opendatateam/udata-metrics/pull/13)

## 2.0.1 (2023-12-01)

- Improve metrics layout [#11](https://github.com/opendatateam/udata-metrics/pull/11)
    - Specify that statistics are for the year
    - Move datasets graph on the second row in dashboard stats
    - Use current month value (and not variation)
    - Prevent upper or lowercasing by removing any text transformation


## 2.0.0 (2023-11-21)

- :warning: New metrics logic [#8](https://github.com/opendatateam/udata-metrics/pull/8)
    - Add metrics views (using template hook)
    - Use optional metrics API (with job to update metrics on objects)
    - Remove Influx logic
- Replace mongo legacy image in CI [#6](https://github.com/opendatateam/udata-metrics/pull/6)

## 1.0.2 (2020-07-01)

- Add time condition in the queries to retrieve only last 24 hours results [#4](https://github.com/opendatateam/udata-metrics/pull/4)

## 1.0.1 (2020-05-13)

- Nothing yet

## 1.0.0 (2020-05-12)

Initial release

