Giter Site home page Giter Site logo

databraryapi's Introduction

databraryapi

This repository contains code for the databraryapi R package.

Installation

  • Install the devtools package from CRAN: install.packages("devtools") if you have not already done so.
  • Load devtools into your local environment: library(devtools)
  • Install the databraryapi package via install_github("PLAY-behaviorome/databraryapi"). Required dependencies will be installed at this time.

Use

The package is under active development, as is the documentation. Running devtools::install_github("PLAY-behaviorome/databraryapi") regularly to get updates is strongly recommended.

Databrary credentials

Databrary (databrary.org) is a data library specialized for storing and sharing video. Access to restricted data requires registration and formal approval by an institution. The registration process involves the creation of an (email-account-based) user account and secure password. Once institutional authorization has been granted, a user may gain access to shared video, audio, and other data. Many commands in the databraryapi package return meaningful results without or prior to formal authorization.

Configuration

Once the databraryapi package has been installed, it may be loaded into the local environment via library(databraryapi). It is advisable to configure the local environment each time the user wishes to access the system:

login_db()  # Queries stored log on credentials or creates and stores new credentials.

The login_db() command uses the keyring package to create secure user name and password files using native system utilities for this purpose on Mac OS, Windows, and Linux. This is the recommended approach. The first time you log on via the databraryapi package, you will need to run config_passd(). You should only need to run this once.

Once you are an authorized user on Databrary, you may also use

login_db("[email protected]")

to log on.

Users on Mac OS and Linux systems may alternatively choose to store user account and password information in ~/api-keys/json/databrary-keys.json. This file has the following format:

{
  "email":["[email protected]"],
  "pw":["s0mEth!nGl0nGandS3CURE"]
}

This approach has risks as the credentials are stored as text. Users who choose this approach should use login_db(stored.credentials = TRUE).

If users choose to log in with their user names and passwords on each access -- stored.credentials = FALSE and there is no stored credentials file accessible by keyring -- rstudioapi package commands will query the user for both the user account and password. The rstudioapi commands work only under RStudio.

Whatever access model is chosen, the use of a password generator/manager program (e.g., LastPass, 1Password, Dashlane) is strongly recommended.

Command descriptions

get_db_stats() by default provides some data about the current number of authorized investigators, affiliates, institutions, datasets, files, and hours of stored video. Try

`get_db_stats("people")`

to see a table of newly authorized researchers. Or, try

get_db_stats('datasets')

to see a list of the latest shared datasets.

read_csv_data_as_df() by default reads a publicly shared CSV data file from Databrary's volume 1 http://databrary.org/volume/1. Try

with(read_csv_data_as_df(), plot(Auth_Investigators, Institutions))

to view a simple plot of the number of authorized investigators and institutions across time.

download_video() by default reads a short publicly shared testing video depicting a series of numbers counting up from 000.

download_csv() by default reads a CSV of the "sessions" spreadsheet from Databrary's volume 1 http://databrary.org/volume/1 and returns it as a data frame.

list_assets_by_type() by defaults lists the videos in Databrary volume 1 http://databrary.org/volume/1.

list_people() by default lists information about the two Databrary PIs, Karen Adolph and Rick Gilmore, and the Co-I, David Millman.

list_volume_owners() by default lists the volume owners for Databrary volume 1 http://databrary.org/volume/1.

logout_db() logs out of Databrary and does some simple clean up.

databraryapi's People

Contributors

rogilmore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.