Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Developers would write a function that takes an input or data (and probably the logger used by simple extractor) and returns a JSON dict with any new files, metadata, previews etc. that result from the function:

Image Modified

So here, the simple extractor would handle everything and call the configured function (configured on initialization) with the data to get a result, then parse the result in a standard way.

The result dict would have a structure that allows users to define outputs for their function:

Image Modified

So in this example response object:

...

Now we can run the following command to test the word count code:


Code Block
languagebash
themeConfluence
python -c "import wordcount; print wordcount.wordcount(\"poem.txt\")"

It will show the output as:


Code Block
languagebash
themeConfluence
{'metadata': {'lines': 5', 'characters': 182', 'words': '37'}}

Running wordcount.py as extractor

...