Skip to content

scieloorg/access-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

access-counter

Gera relatórios em formato COUNTER R5.

Como instalar

Criar ambiente virtual para python 3.6+

virtualenv -p python3.6 .venv

Acessar ambiente virtual

source .venv/bin/activate

Instalar dependências e pacotes

apt install libmysqlclient-dev
pip install -r requirements.txt
python setup.py install

Como usar

Criar banco de dados e tabelas

create database matomo
initialize_database -u STRING_CONNECTION

Popular tabela de periódicos

populate_journals -u STRING_CONNECTION

Calcular métricas COUNTER

É preciso setar as variáveis de ambiente listadas ao final deste README.md

calculate_metrics \
    -c COLLECTION_ACRONYM \
    -u mysql://user:pass@host:port/database \
    --dict_date YYYY-MM-DD \
    --use_pretables

Exportar dados para tabelas SUSHI

É preciso setar as variáveis de ambiente listadas ao final deste README.md

export_to_database \
    -c COLLECTION_ACRONYM \
    -u mysql://user:pass@host:port/database \
    --auto

Agregar tabelas

usage: aggregate [-h] [-c COLLECTION] [-p PERIOD]
                 [-t {aggr_article_language_year_month_metric,aggr_journal_language_year_month_metric,aggr_journal_geolocation_year_month_metric,aggr_journal_language_yop_year_month_metric,aggr_journal_geolocation_yop_year_month_metric}]

optional arguments:
  -h, --help            show this help message and exit
  -c COLLECTION, --collection COLLECTION
                        Acrônimo de coleção
  -p PERIOD, --period PERIOD
                        Período de datas a serem agregadas (YYYY-MM-DD,YYYY-
                        MM-DD)
  -t {aggr_article_language_year_month_metric,aggr_journal_language_year_month_metric,aggr_journal_geolocation_year_month_metric,aggr_journal_language_yop_year_month_metric,aggr_journal_geolocation_yop_year_month_metric}, --tables {aggr_article_language_year_month_metric,aggr_journal_language_year_month_metric,aggr_journal_geolocation_year_month_metric,aggr_journal_language_yop_year_month_metric,aggr_journal_geolocation_yop_year_month_metric}
                        Tabelas a serem preenchidas

Variáveis de ambiente

  • COLLECTION
  • MATOMO_ID_SITE
  • ARTICLEMETA_DATABASE_STRINGorg:27017/articlemeta.articles?authSource
  • LOG_FILE_DATABASE_STRING
  • MATOMO_DATABASE_STRING
  • DIR_DATA
  • DIR_PRETABLES
  • DIR_SUMMARY
  • DIR_R5_HITS
  • DIR_R5_METRICS
  • LOGGING_LEVEL
  • MATOMO_API_TOKEN
  • MATOMO_DB_IP_COUNTER_LIMIT
  • MATOMO_FIX_DATABASE_COLUMNS
  • MATOMO_URL
  • MIN_YEAR
  • PRETABLE_DAYS_N
  • COMPUTING_DAYS_N
  • COMPUTING_TIMEDELTA

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages