Giter Site home page Giter Site logo

qslang's Introduction

QSlang

Build codecov Code style: black Typechecking: Mypy

A tool to parse and analyze drug logs, for science.

Uses a domain-specific language for manual entry of drug doses and accompanying journal/plaintext entries in a flexible textual format, which can then be used to analyze use of drugs/supplements/pharmaceuticals. Input on phones/touch devices is surprisingly efficient when used with sentence-predicting keyboards (like Swiftkey etc).

Built with parsimonious (to parse notes) and pint (to handle units).

Pronounced: Q-Slang

Installation

To install, simply run:

pip install git+https://github.com/ErikBjare/QSlang.git

You should now have a qslang command available, or if you don't have your PATH configured, you can run it with python3 -m qslang.

Usage

$ qslang --help
Usage: qslang [OPTIONS] COMMAND [ARGS]...

  QSlang is a tool to parse and analyze dose logs, for science.

Options:
  -v, --verbose
  --testing      run with testing config & data
  --help         Show this message and exit.

Commands:
  effectspan       print effect spans
  events           print list of all doses
  plot             plot doses over time in a barchart
  plot-calendar    plot doses in a calendar
  plot-effectspan  plot effect spans in a barchart
  plot-influence   plot percent of time spent under effects of a substance
  substances       print list of substances
  summary          print summary of doses for each substance

For setup & configuration, copy config.example.toml to config.toml and edit as appropriate.

QSlang can read data from:

  • Directory with plaintext-files (as created by standardnotes-fs)
    • How to: Put your notes in a folder, or use standardnotes-fs (deprecated) to mount your notes the same directory. Set the data.standardnotes_export key to the file path in config.
  • Standard Notes export (unencrypted)
    • How to: create an unencrypted export and unzip the SN Archive.txt file (keep its default name). Set the data.standardnotes key to the folder path in config.
  • Evernote (enex files)
    • How to: export the notebooks you want to analyze as .enex file. Then put all the exported notebooks you want into ./data/private. Then run make data/private/Evernote to extract the .enex into markdown files (which will be put into data/private/Evernote/).

Then run qslang --help to get further usage instructions.

Input format

This is the expected format of notes, I've tried to make it lenient/flexible parser but might write a stricter one in the future to avoid ambiguous parsing.

Basic example:

# 2018-04-14

07:01 - Woke up

07:32 - 2000IU Vitamin D3 + 5g Creatine monohydrate + 200mg Magnesium (from citrate)

08:10 - ~2dl Green tea + 10g Cocoa

12:54 - ~2dl Green tea

16:30 - Started working on QSlang

qslang's People

Contributors

dependabot[bot] avatar erikbjare avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qslang's Issues

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.