Skip to main content

Import analytics from 3rd-party provider (Matomo) into InvenioRDM instance.

Project description

README

CLI tool to retrieve and ingest analytics from a provider into current InvenioRDM instance.

For now, only Matomo is supported. If other provider added, slight refactor to support them will be planned.

Install

pip install invenio-analytics-importer

Usage

Retrieve analytics

pipenv run invenio analytics_importer retrieve [--views|--downloads] --from <YYYY-MM> --to <YYYY-MM> --output-dir <path>/<to>/<data>/

If neither --views nor --downloads is passed, views will be the default. If both are passed, the last one on the CLI will be chosen. --from and --to are inclusive year-month dates.

This downloads analytics into files corresponding to each year-month. The structure of each file is e.g.,:

{
    "2024-08-01": [
        {
            // 1 "raw" analytics entry from provider
            // corresponding to 1 URL
        },
        // ...
    ],
    "2024-08-02": [
    // ...
    ],
    // ...
}

Ingest

pipenv run invenio analytics_importer ingest [--views|--downloads] -f <analytics file 1> -f <analytics file 2> ...

Analytics files are of the shape described above, although there is no requirements for 1 file to correspond to 1 month. However, there is an assumption/requirement that each file's date (YYYY-MM-DD) in "YYYY-MM-DD": [...analytics...] is unique across all files.

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

invenio_analytics_importer-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

invenio_analytics_importer-0.2.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file invenio_analytics_importer-0.2.0.tar.gz.

File metadata

File hashes

Hashes for invenio_analytics_importer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0b7ba736b7e91ded1062a5ce67112c63158b0460cf86e4ee0e60d290c012b7a8
MD5 062a1000e70e16b2bc8cae5af4de9fb8
BLAKE2b-256 4fd17d7da9f4bd27732ff4c423c4c9be5fbb92bdab7e625f9c9913e54ae5c281

See more details on using hashes here.

Provenance

The following attestation bundles were made for invenio_analytics_importer-0.2.0.tar.gz:

Publisher: publish-to-pypi.yml on galter-dmt/invenio-analytics-importer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file invenio_analytics_importer-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for invenio_analytics_importer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 721017a37b5e7568f9c65cc05d9ef5dff8c661e4daec87c623bbefcd00b59839
MD5 a63f1ad48bafee902dc2212bac6f5e34
BLAKE2b-256 876f1ffe2b0fb264bbc543a7fcf5707c51fa6c2f96e929e34b65c7528705a37c

See more details on using hashes here.

Provenance

The following attestation bundles were made for invenio_analytics_importer-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on galter-dmt/invenio-analytics-importer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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