Re: [O] Parsing Org-mode in Python

2014-01-09 Thread Brett Viren
Hi Daniel, Daniel Clemente writes: > Are there already Python parsers for it? Parsing generic JSON is fairly trivial in Python. import json data = json.dumps(open('file.json').read()) The resulting "data" is then a bunch of Python lists and/or dicts matching whatever structure was outpu

Re: [O] Parsing Org-mode in Python

2014-01-08 Thread Daniel Clemente
El Wed, 08 Jan 2014 10:42:17 -0500 Brett Viren va escriure: > > http://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00415.html > > In any case, here is the salient chunk: > > #+BEGIN_SRC elisp > (require 'json) > (let* ((tree (org-element-parse-buffer 'object nil))) > (org-eleme

Re: [O] Parsing Org-mode in Python

2014-01-08 Thread François Pinard
2014/1/8 Brett Viren Huh, maybe a transient failure? It's there for me right now. Here is > the same message from GNU's archive: > > http://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00415.html Got it, thanks! :-) -- François Pinard http://pinard.progiciels-bpi.ca

Re: [O] Parsing Org-mode in Python

2014-01-08 Thread Brett Viren
François Pinard writes: > Brett Viren writes: > >> http://permalink.gmane.org/gmane.emacs.orgmode/79838 > > This yields: > > , > | Not Found > | > | The requested URL /gmane.emacs.orgmode/79838 was not found on this server. > ` Huh, maybe a transient failure? It's there for me right

Re: [O] Parsing Org-mode in Python

2014-01-08 Thread François Pinard
Brett Viren writes: > I'm also (slowly) working toward some Python-based org processing. My > strategy is to produce an intermediate file in JSON format which is > designed to capture the full org document structure. I am calling > this a "shunt" export as it is meant to do as little interpreta

Re: [O] Parsing Org-mode in Python

2014-01-07 Thread Brett Viren
Hi Karl, Karl Voit writes: > Hi! > > * Daniel Clemente wrote: >>> >>> I dream of having a general Python parser for Org mode files, knowing >>> every bit about the current syntax for Org files, surrounded by enough >>> Python machinery to make it useful. > > Oh, this would be great since there

Re: [O] Parsing Org-mode in Python

2014-01-06 Thread François Pinard
Karl Voit writes: > I did not get the impression that [ply] is a parsing engine that is > done the Python way. PLY has pros and cons. SPARK[1] always attracted me as being more elegant. While it accepts a wider set of grammars than PLY, SPARK can become quite slow on grammars which are less "n

[O] Parsing Org-mode in Python (was: Implementing Org-mode tools in languages other than ELISP)

2014-01-06 Thread Karl Voit
Hi! * Daniel Clemente wrote: >> >> I dream of having a general Python parser for Org mode files, knowing >> every bit about the current syntax for Org files, surrounded by enough >> Python machinery to make it useful. Oh, this would be great since there are way more Python-coders out there as E