Skip to main content

A package and command-line utility to collect data from Digital Matter trackers.

Project description

fair-software.nl recommendations

Badges

1. Code repository

GitHub Badge

2. License

License Badge

3. Community Registry

PyPI Badge

4. Enable Citation

Zenodo Badge

DM-Report

This is a package and command-line utility to collect data from Digital Matter trackers.

Installation

  1. Clone or download the source code:

    git clone https://github.com/ITC-CRIB/dm-report.git
  2. Go to the root directory:

    cd dm-report/
  3. Compile and install using pip:

    pip install .

CLI Usage

Usage: dmreport [OPTIONS] {assets|telemetry}

  Retrieves tracker reports.

Options:
  -u, --username TEXT             Account user name.  [required]
  -p, --password TEXT             Account password.  [required]
  -g, --organisation TEXT         Organisation id.
  --asset TEXT                    Asset code.
  --date [%Y-%m-%d]               Telemetry date.  [default: 2025-02-17]
  --days INTEGER RANGE            Number of days.  [default: 1; x>=1]
  -o, --output PATH               Path to store the output.
  -f, --format [csv|json|text|markdown]
                                  Output format.  [default: text]
  -d, --debug                     Enable debug mode.
  -v, --version                   Show the version and exit.
  -h, --help                      Show this message and exit.

Instead of passing arguments to command-line utility, you can also use the following environment variables:

  • DM_USERNAME: Username.

  • DM_PASSWORD: Password.

  • DM_ORGANISATION_ID: Organisation id.

If a .env file exists in the working directory, the command-line utility automatically reads environment variables from the file.

Basic example to retrieve information about the assets as CSV:

dmreport assets --format csv --output assets.csv

Basic example to retrieve telemetry information of an asset for a specified number of days starting from a starting date as CSV:

dmreport telemetry --asset my_asset --date 2025-01-02 --days 15 --format csv --output telemetry.csv

Package Usage

Basic example to retrieve information about the assets:

from dmreport.client import Client

# Create a client
client = Client('username', 'password', organisation_id = 'organisation_id')

# Retrieve assets report
assets = client.get_assets()

Basic example to retrieve telemetry data of an asset for a specific date:

from dmreport.client import Client
from datatime import datetime

# Create a client
client = Client('username', 'password', organisation_id = 'organisation_id')

# Get asset telemetry
telemetry = client.get_telemetry(
    client.get_asset_id('asset_code'),
    datetime.strptime('yyyy-mm-dd', '%Y-%m-%d')
)

Acknowledgements

This software was developed as part of the research project SmartAvocado funded by the Dutch Research Council (NWO) Open Competition Domain Science XS 2023.

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

dm_report-0.1.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

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

dm_report-0.1.1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file dm_report-0.1.1.tar.gz.

File metadata

  • Download URL: dm_report-0.1.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for dm_report-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3548fd157934ca1c1f1d7ee33907e468e95b88257244f27b82f815803552f631
MD5 b5cab92bcbfa5dc832a61441f61e859b
BLAKE2b-256 1d33a7da6266637fa17de4f58f2069806603341ab46c06edc008e7458ba4e46b

See more details on using hashes here.

File details

Details for the file dm_report-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dm_report-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for dm_report-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5141eca16ff6210bb2ccde117a187454be390a6b6c627c3964263f6a220a35a1
MD5 ae268c51069d309825003a5aa9b2f1f9
BLAKE2b-256 11aec0fc12ba5ad625ef9f230c3b5fb1f8f5a7670ed0774c9cd4c82da2523417

See more details on using hashes here.

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