Tool to convert data into searchable and interactive org-mode views
Orger converts your data into a hierarchical Org-mode representation to allow for quick access and search.
I write in detail about usecases and motivation for it [[https://beepb00p.xyz/orger.html][here]], this readme is mostly the setup manual!
simplest: install from [[https://pypi.org/project/orger][PyPi]]: ~pip3 install --user orger~
After that you should be able to run orger modules via =python3 -m=:
: python3 -m orger.modules.instapaper --help
This will allow you to quickly prototype and debug, the local changes to the code will be reflected immiedately.
after that you can use =python3 -m orger.modules.modulename=, same way as the previous section, or run =modules/modulename.py= directly
Please refer to the HPI install guide/documentation and make sure the corresponding data providers work (e.g. via =hpi doctor= command).
If you do have pandoc installed, but don't want the module to use it, pass =--disable-pandoc= flag to it.
Usage and examples I usually run Orger modules overnight via cron.
see [[./modules][modules]] for all available modules
Most modules are using [[https://github.com/karlicoss/HPI][HPI]] package for accessing the data. You can learn about setting it up and using [[https://github.com/karlicoss/HPI/blob/master/doc/SETUP.org#orger][here]].
several examples [[https://beepb00p.xyz/orger.html#examples][here]]
[[https://beepb00p.xyz/myinfra-roam.html#orger][demonstration]] of Roam Research module, including a [[https://www.youtube.com/watch?v=ib_PDJpTh-Q][screencast]]
[[./modules/pocketdemo.py][pocketdemo]]: documented literate demo
and a short short demo:
#+BEGINSRC python from orger import Mirror from orger.inorganic import node, link from orger.common import dtheading
import my.coding.github as github_data
class Github(Mirror): def get_items(self): for event in github_data.get_events(): yield node(dt_heading(event.dt, event.summary))
That ten line program, when run (=./modules/github.py=), results in a file =Github.org=:
#+BEGIN_SRC org # AUTOGENERATED BY /code/orger/github.py
,* [2016-10-30 Sun 10:29] opened PR Add __enter__ and __exit__ to Pool stub ,* [2016-11-10 Thu 09:29] opened PR Update gradle to 2.14.1 and gradle plugin to 2.1.1 ,* [2016-11-16 Wed 20:20] commented on issue Linker error makes it impossible to use a stack-provided ghc ,* [2016-12-30 Fri 11:57] commented on issue Fix performance in the rare case of hashCode evaluating to zero ,* [2019-09-21 Sat 16:51] commented on issue Tags containing letters outside of a-zA-Z ....
#+beginsrc python :dir src :exports results :results drawer output import orger print(orger.Mirror.doc) #+endsrc
*Mirror* (old name =StaticView=): mirrors *all data* from a source, and generated from scratch every time, hence *read only*.
You can run such module with
: ./orger_module.py --to /path/to/output.org
#+BEGINSRC python :dir src :exports results :results drawer output import orger print(orger.Queue.doc) #+ENDSRC
*Queue* (old name =InteractiveView=): works as a queue, *only previously unseen items* from the data source are added to the output org-mode file.
To keep track of previously seen iteems, it's using a separate JSON =state= file.
A typical usecase is a todo list, or a content processing queue. You can use such a module as you use any other org-mode file: schedule/refile/comment/set priorities, etc.
Typically you'd want to use these as a source of tasks for your todo list. See [[./modules/ip2org.py][ip2org]] as an example.
You can run such a module as:
: ./orger_module.py --to /path/to/output.org
This will keep the state file in your user config dir (e.g. =~/.config/orger/=).
Alternatively, you can pass the state file explicitly:
: ./orger_module.py --to /path/to/output.org --state /path/to/state.json
=Mirror= type modules output read only files, so you don't modify them by accident, they are overwritten every time.
If you want to temporary lift this restriction (e.g. to experiment with the format), you can use =chmod +w=, or =M-x toggle-read-only= in Emacs.
The main reason Orger exists is because I discovered Memacs after I wrote Orger! One day we might merge them, or at least [[https://github.com/karlicoss/orger/issues/5][reuse org-mode formatting routines]].
That said there are some differences at the moment:
Orger modules are slim and relying on [[https://github.com/karlicoss/HPI][HPI]] to encapsulate data access. But you can also use HPI with Memacs, please ping me if you set up such an integration!
Pass the =--timestamp= argument to the module, for example:
: modules/polar.py --timestamps active