<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adam Kariv on Medium]]></title>
        <description><![CDATA[Stories by Adam Kariv on Medium]]></description>
        <link>https://medium.com/@adam.kariv?source=rss-3722ab0c6039------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GVv8x1JlXucAZjsLNcSLVg.jpeg</url>
            <title>Stories by Adam Kariv on Medium</title>
            <link>https://medium.com/@adam.kariv?source=rss-3722ab0c6039------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:30:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adam.kariv/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Announcing datapackage-pipelines version 2.0]]></title>
            <link>https://medium.com/@adam.kariv/announcing-datapackage-pipelines-version-2-0-40123c859ea9?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/40123c859ea9</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Tue, 23 Oct 2018 08:13:05 GMT</pubDate>
            <atom:updated>2018-10-23T08:13:05.938Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we’re releasing a major version for <a href="https://github.com/frictionlessdata/datapackage-pipelines"><em>datapackage-pipelines</em></a>, version 2.0.0.</p><p>This new version marks a big step forward in realizing the <a href="http://okfnlabs.org/blog/2018/08/29/data-factory-data-flows-introduction.html">Data Factory</a> concept and framework. We integrated <em>datapackage-pipelines</em> with its younger sister <a href="https://github.com/datahq/dataflows"><em>dataflows</em></a>, and created a set of common building blocks you can now use interchangeably between the the two frameworks.</p><p>It’s now possible to bootstrap and develop flows using <em>dataflows</em>, and then run these flows as-is on a <em>datapackage-pipelines</em> server - or effortlessly convert them to the declarative yaml syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*Qc1crBvmE0QigCbKtYim9Q.png" /></figure><p>Install <em>datapackage-pipelines</em> using pip:</p><pre>pip install datapackage-pipelines</pre><h3>What Changed?</h3><h4>New Low-level API and stdout Redirect</h4><p>One big change (and a long time request) is that processors are now <em>allowed</em> to print from inside their processing code, without interfering with the correct operation of the pipeline. All prints are automatically converted to logging.info(...) calls.This behaviour is enabled when using the new low-level API. The main change we&#39;ve introduced is that ingest() is now a context manager. This means that you now should run:</p><pre># New style for ingest and spew<br>with ingest() as ctx:<br> # Do stuff with datapackage and resource_iterator<br> spew(ctx.datapackage, <br> ctx.resource_iterator, <br> ctx.stats)</pre><p>Backward compatibility is maintained for the old way of using ingest(), so you don’t have to update all your code immediately.</p><pre># This still works, but won’t handle print()s<br>parameters, datapackage, resource_iterator = ingest()<br>spew(datapackage, resource_iterator)</pre><h4>Dataflows integration</h4><p>There’s a new integration with <em>dataflows</em> which allows running Flows directly from the pipeline-spec.yaml file.</p><p>You can integrate dataflows within pipeline specs using the flow attribute instead of run. For example, given the following flow file, saved under my-flow.py:</p><pre>from dataflows import Flow, dump_to_path, load, update_package<br>​<br>def flow(parameters, datapackage, resources, stats):<br>  stats[‘multiplied_fields’] = 0<br> ​<br>  def multiply(field, n):<br>    def step(row):<br>      row[field] = row[field] * n<br>      stats[‘multiplied_fields’] += 1<br>      return step<br>​<br>    return Flow(update_package(name=’my-datapackage’),<br>                load((datapackage, resources),<br>                multiply(‘my-field’, 2))</pre><p>And a pipeline-spec.yaml in the same directory:</p><pre>my-flow:<br> pipeline:<br>   — run: load_resource<br> parameters:<br>   url: <a href="http://example.com/my-datapackage/datapackage.json">http://example.com/my-datapackage/datapackage.json</a><br>   resource: my-resource<br>     — flow: my-flow<br>     — run: dump.to_path</pre><p>You can run the pipeline using dpp run my-flow.</p><p>If you want to wrap a flow inside a processor, you can use the spew_flow helper function:</p><pre>from dataflows import Flow<br>from datapackage_pipelines.wrapper import ingest<br>from datapackage_pipelines.utilities.flow_utils import spew_flow<br>​<br>def flow(parameters):<br> return Flow(<br> # Flow processing comes here<br> )<br>​<br>​<br>if __name__ == ‘__main__’:<br> with ingest() as ctx:<br> spew_flow(flow(ctx.parameters), ctx)</pre><h4>Standard Processor Refactoring</h4><p>We refactored all standard processors to use their counterparts from dataflows, thus removing code duplication and allowing us to move forward quicker. As a result, we’re also introducing a couple of <strong>new</strong> processors:</p><ul><li>load - Loads and streams a new resource (or resources) into the data package. It&#39;s based on the dataflows processor with the same name, so it supports loading from local files, remote URL, data packages, locations in environment variables etc.For more info consult the <a href="https://github.com/datahq/dataflows/blob/master/PROCESSORS.md#load">dataflows documentation</a>.</li><li>printer - Smart printing processor for displaying the contents of the stream - comes in handy for development or monitoring a pipeline.It will not print all rows, but an logarithmically sparse sample - in other words, it will print rows 1-20, 100-110, 1000-1010 etc. It also prints the last 10 rows of the dataset.</li></ul><h3>Deprecations</h3><p>We’re <strong>deprecating</strong> a few processors — you can still use them as usual but they will be removed in the next major version (3.0):</p><ul><li>add_metadata - was renamed to update_package for consistency</li><li>add_resourceand stream_remote_resources - are being replaced by the load</li><li>dump.to_path, dump.to_zip, dump.to_sql - are being deprecated - you should use dump_to_path, dump_to_zip and dump_to_sql instead. <br>Note that dump_to_path and dump_to_zip lack some features that exist in the current processors — for example, custom file formatters and non-tabular file support. We might introduce some of that functionality into the new processors as well in the next versions - please let us know what you think about these features and how badly you need them...</li></ul><h3>The Road Ahead</h3><p>In the next versions we’re planning to further the integration of dataflows and datapackage-pipelines. We’re going to work on streamlining development and deployment as well as taking care of naming and documentation to harmonize all aspects of the dataflows ecosystem.</p><p>We’re also working on de-composing datapackage-pipelines into smaller, self contained components. In this version we took apart the standard processor code and some supporting libraries (e.g. kvstore) and delegated it to external libraries.</p><h3>Links and References</h3><ul><li>Read more on datapackage-pipelines here: <a href="https://github.com/frictionlessdata/datapackage-pipelines">https://github.com/frictionlessdata/datapackage-pipelines</a></li><li>Read more on dataflows here: <a href="https://github.com/datahq/dataflows">https://github.com/datahq/dataflows</a></li><li>Read more on Data Factory here: <a href="http://okfnlabs.org/blog/2018/08/29/data-factory-data-flows-introduction.html">http://okfnlabs.org/blog/2018/08/29/data-factory-data-flows-introduction.html</a></li></ul><h3>Contributors</h3><p>Thanks to <a href="https://github.com/OriHoch">@OriHoch</a> for contributing code and other invaluable assistance with this release.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40123c859ea9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Factory & DataFlows]]></title>
            <link>https://medium.com/@adam.kariv/data-factory-dataflows-a8f801321291?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8f801321291</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[open-data]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Fri, 10 Aug 2018 21:43:01 GMT</pubDate>
            <atom:updated>2018-08-10T21:43:01.472Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I’d like to introduce a new library we’ve been working on — dataflows. DataFlows is a part of a larger conceptual framework for data processing.</p><p>We call it ‘<strong>Data Factory</strong>’ —</p><blockquote>an open framework for building and running lightweight data processing workflows quickly and easily.</blockquote><blockquote>LAMP for data wrangling!</blockquote><p>Most of you already know what <em>Data Packages</em> are. In short, it’s a portable format for packaging different resources (tabular or otherwise) in a standard way that takes care of most interoperability problems (e.g. <em>“what’s the character encoding of the file?”</em> or <em>“what is the data type for this column?”</em> or <em>“which date format are they using?”</em>). It also provides rich and flexible metadata, which users can then use to validate the data or understand its context (take a look at <a href="https://frictionlessdata.io/">https://frictionlessdata.io</a> to learn more!).</p><p><em>Data Factory</em> complements the <em>Data Package</em> concepts by adding dynamics to the mix.</p><p>While Data Packages are a great solution for describing data sets, these data sets are always <em>static</em> — located in one place. <em>Data Factory</em> is all about transforming Data Packages — modifying their data or meta-data and transmitting them from one location to another.</p><p><em>Data Factory</em> defines standard interfaces for building <em>processors</em> — software modules for mutating a Data Package — and protocols for streaming the contents of a Data Package for efficient processing.</p><h3>Philosophy and Goals</h3><p><em>Data Factory</em> is more pattern/convention than library.</p><p>An analogy is with web frameworks. Web frameworks were more about a core pattern plus a set of ready to use components than a library themselves. For example, python frameworks were built around WSGI e.g. Pylons, Flask etc. Or consider ExpressJS for Node.</p><p>In this sense these frameworks were about convention over configuration. They attempted to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility.</p><p>Like web frameworks, Data Factory uses convention over configuration with the aim of decreasing the number of decisions that a data developer is required to make without necessarily losing flexibility.</p><p>By following a standard scheme, developers are able to use a large and growing library of existing, reusable processors. This also increases readability and maintainability of data processing code.</p><p><strong>Our focus is on:</strong></p><ul><li>Small to medium sized data (KBs to GBs)</li><li>Desktop wrangling — people who start on their desktop</li><li>Easy transition from desktop to “cloud”</li><li>Heterogeneous data sources</li><li>Process using basic building blocks that are extensible</li><li>Less technical audience</li><li>Limited resources — limit on memory, CPU, etc.</li></ul><p>What are we <strong>not</strong>?</p><ul><li>Big data processing and machine learning. e.g. if you want to wrangle TBs of data in a distributed setup or want to train a machine learning model with GBs of data, you probably don’t want this.</li><li>Processing real-time event data.</li><li>Technical know-how <strong><em>is</em></strong> needed: we aren’t a fancy ETL UI — you probably need a bit of technical sophistication</li></ul><h3>Architecture</h3><p>This new framework is built on the foundations of the Frictionless Data project — both conceptually as well as technically. This project provided us the definition of <em>Data Packages</em> and the software to read and write these packages.</p><p>Based on the Frictionless Data basis, we’re introducing a few new concepts: the “<em>Data Stream</em>” — essentially a <em>Data Package</em> in transit — and the “<em>Data Processor</em>”, which manipulates a Data Package, receiving one <em>Data Stream</em> as its input and producing a new <em>Data Stream</em> as its output.</p><p><strong>A chain of Data Processors is what we call a “<em>Data Flow</em>”.</strong></p><p>We will be providing a library of such processors: some for loading data from various sources, some for storing data in different locations, services or databases, and some for doing common manipulation and transformation on the processed data.</p><p>On top of all that we’re building a few integrated services:</p><ul><li>dataflows-server (formerly known as datapackage-pipelines) - a server side multi-processor runner for Data Flows.</li><li>dataflows-cli - a client library for building and running Data Flows locally</li><li>dataflows-blueprints - ready made flow generators for common scenarios (e.g. &#39;I want to regularly pull all my analytics from these X services and dump them in a database&#39;)</li></ul><p>and more to come.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrKXvlzbBSkAiOLz7FmyXQ.png" /></figure><h3>On Data Wrangling</h3><p>In our experience, data processing starts simple — downloading and inspecting a CSV, deleting a column or a row. We wanted something that was as fast as the command line to get started but would also provide a solid basis as your pipeline grows. We also wanted something that provided some standardization and conventions over completely bespoke code.</p><p>With integration in mind, DataFlows comes with very little environmental requirements, and can be embedded in your existing data processing setup.</p><p>In short, DataFlows provides a simple, quick and easy-to-setup, and extensible way to build lightweight data processing pipelines.</p><h3>Introducing DataFlows</h3><p>The first piece of software we’re introducing today is dataflows and its standard library of processors.</p><p>dataflows introduces the concept of a Flow - a chain of data processors, reading, transforming and modifying a stream of data and writing it to any location (or loading it to memory for further analysis).</p><p>dataflows also comes with a rich set of built-in data processors, ready to do most of the heavy-lifting you&#39;ll need to reduce boilerplate code and increase your productivity.</p><h3>A demo is worth a thousand words</h3><p>Most data processing starts simple: getting a file and having a look.</p><p>With dataflows you can do this in a few seconds <em>and</em> you&#39;ll have a solid basis for whatever you want to do next.</p><p><strong><em>Bootstrapping a data processing script</em></strong></p><pre>$ pip install dataflows<br>$ dataflows init <a href="https://rawgit.com/datahq/demo/_/first.csv">https://rawgit.com/datahq/demo/_/first.csv</a><br>Writing processing code into first_csv.py<br>Running first_csv.py<br>first:<br>  #  Name        Composed    DOB<br>     (string)    (string)    (date)<br>---  ----------  ----------  ----------<br>  1  George      22          1943-02-25<br>  2  John        90          1940-10-09<br>  3  Richard     2           1940-07-07<br>  4  Paul        88          1942-06-18<br>  5  Brian       n/a         1934-09-19<br>​<br>Done!<br>​</pre><p>dataflows init actually does 3 things:</p><ul><li>Analyzes the source file</li><li>Creates a processing script for reading it</li><li>Runs that script for you</li></ul><p>In our case, a script named first_csv.py was created - here&#39;s what it contains:</p><pre># ...<br>​<br>def first_csv():<br>    flow = Flow(<br>        # Load inputs<br>        load(&#39;https://rawgit.com/datahq/demo/_/first.csv&#39;,<br>             format=&#39;csv&#39;, ),<br>        # Process them (if necessary)<br>        # Save the results<br>        add_metadata(name=&#39;first_csv&#39;, title=&#39;first.csv&#39;),<br>        printer(),<br>    )<br>    flow.process()<br>​<br>if __name__ == &#39;__main__&#39;:<br>    first_csv()</pre><p>The flow variable contains the chain of processing steps (i.e. the processors). In this simple flow, load loads the source data, add_metadata modifies the file&#39;s metadata and printer outputs the contents to the standard output.</p><p>You can run this script again at any time, and it will re-run the processing flow:</p><pre>$ python first_csv.py<br>first:<br>  #  Name        Composed    DOB<br>     (string)    (string)    (date)<br>---  ----------  ----------  ----------<br>  1  George      22          1943-02-25<br>...</pre><p>This is all very nice, but now it’s time for some real data wrangling. By editing the processing script it’s possible to add more functionality to the flow — dataflows provides a simple, solid basis for building up your pipeline quickly, reliably and repeatedly.</p><p><strong><em>Fixing some bad data</em></strong></p><p>Let’s start by getting rid of that annoying n/a in the last line of the data.</p><p>We edit first_csv.py and add to the flow two more steps:</p><pre>def removeNA(row):<br>    row[&#39;Composed&#39;] = row[&#39;Composed&#39;].replace(&#39;n/a&#39;, &#39;&#39;)<br>​<br>f = Flow(<br>        load(&#39;https://rawgit.com/datahq/demo/_/first.csv&#39;),<br>        # added here custom processing:<br>        removeNa, <br>        # now parse column as Integer:<br>        set_type(&#39;Composed&#39;, type=&#39;integer&#39;),<br>        printer()<br>    )</pre><p>removeNa is a simple function which modifies each row it sees, replacing n/as with the empty string. After it we call set_type, which declares the Composedcolumn should be an integer - and verifies it&#39;s indeed an integer while processing data.</p><p><strong><em>Writing the cleaned data</em></strong></p><p>Finally, let’s write the output to a file using the dump_to_path processor:</p><pre>def removeNA(row):<br>    row[&#39;Composed&#39;] = row[&#39;Composed&#39;].replace(&#39;n/a&#39;, &#39;&#39;)<br>​<br>f = Flow(<br>        load(&#39;https://rawgit.com/datahq/demo/_/first.csv&#39;),                        add_metadata(<br>            name=&#39;beatles_infoz&#39;,<br>            title=&#39;Beatle Member Information&#39;,<br>        ),<br>        removeNa,<br>        set_type(&#39;Composed&#39;, type=&#39;integer&#39;),<br>        dump_to_path(&#39;first_csv/&#39;)<br>    )</pre><p>Now, we re-run our modified processing script…</p><pre>$ python first_csv.py<br>...</pre><p>we get a valid Data Package which we can use…</p><pre>$ tree<br>├── first_csv<br>│   ├── datapackage.json<br>│   └── first.csv</pre><p>which contains a normalized and cleaned-up CSV file…</p><pre>$ head out/out.csv<br>Name,Composed,DOB<br>George,22,1943-02-25<br>John,90,1940-10-09<br>Richard,2,1940-07-07<br>Paul,88,1942-06-18<br>Brian,,1934-09-19</pre><p>datapackage.json, a JSON file containing the package&#39;s metadata...</p><pre>$ cat first_csv/datapackage.json    # Edited for brevity<br>{<br>  &quot;count_of_rows&quot;: 5,<br>  &quot;name&quot;: &quot;beatles_infoz&quot;,<br>  &quot;title&quot;: &quot;Beatle Member Information&quot;,<br>  &quot;resources&quot;: [<br>    {<br>      &quot;name&quot;: &quot;first&quot;,<br>      &quot;path&quot;: &quot;first.csv&quot;,<br>      &quot;schema&quot;: {<br>        &quot;fields&quot;: [<br>          {&quot;name&quot;: &quot;Name&quot;,     &quot;type&quot;: &quot;string&quot;},<br>          {&quot;name&quot;: &quot;Composed&quot;, &quot;type&quot;: &quot;integer&quot;},<br>          {&quot;name&quot;: &quot;DOB&quot;,      &quot;type&quot;: &quot;date&quot;}<br>        ]<br>      }<br>    }<br>  ]<br>}</pre><p>and is very simple to use in Python (or JS, Ruby, PHP and many other programming languages) -</p><pre>$ python<br>&gt;&gt;&gt; from datapackage import Package<br>&gt;&gt;&gt; p = Package(&#39;first_csv/datapackage.json&#39;)<br>&gt;&gt;&gt; list(p.resources[0].iter())<br>[[&#39;George&#39;, 22, datetime.date(1943, 2, 25)],<br> [&#39;John&#39;, 90, datetime.date(1940, 10, 9)],<br> [&#39;Richard&#39;, 2, datetime.date(1940, 7, 7)],<br> [&#39;Paul&#39;, 88, datetime.date(1942, 6, 18)],<br> [&#39;Brian&#39;, None, datetime.date(1934, 9, 19)]]<br>&gt;&gt;&gt;</pre><h3>More ….</h3><p>Lots, lots more — there is a whole suite of processors built in plus you can quickly add your own with a few lines of python code.</p><h3>Dig in at the project’s <a href="https://github.com/datahq/dataflows">GitHub Page</a>!</h3><h3>Or continue reading the in-depth tutorial <a href="https://medium.com/@adam.kariv/dataflows-tutorial-f6f6ea44ccdd">here</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8f801321291" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DataFlows Tutorial]]></title>
            <link>https://medium.com/@adam.kariv/dataflows-tutorial-f6f6ea44ccdd?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6f6ea44ccdd</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Fri, 10 Aug 2018 21:42:02 GMT</pubDate>
            <atom:updated>2018-08-10T21:42:02.304Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Learn how to write your own processing flows</blockquote><p>[dataflows is a Python library for quickly writing data processing flows — I strongly recommend reading this short intro first — click <a href="https://medium.com/@adam.kariv/data-factory-dataflows-a8f801321291">here</a> ]</p><p>Let’s start with the traditional ‘hello, world’ example:</p><pre>from dataflows import Flow<br>​<br>data = [<br>  {&#39;data&#39;: &#39;Hello&#39;},<br>  {&#39;data&#39;: &#39;World&#39;}<br>]<br>​<br>def lowerData(row):<br>    row[&#39;data&#39;] = row[&#39;data&#39;].lower()<br>​<br>f = Flow(<br>    data,<br>    lowerData<br>)<br>data, *_ = f.results()<br>​<br>print(data)<br>​<br># --&gt;<br># [<br>#   [<br>#     {&#39;data&#39;: &#39;hello&#39;}, <br>#     {&#39;data&#39;: &#39;world&#39;}<br>#   ]<br># ]</pre><p>This very simple flow takes a list of dicts and applies a row processing function on each one of them.</p><p>We can load data from a file instead:</p><pre>from dataflows import Flow, load<br>​<br># beatles.csv:<br># name,instrument <br># john,guitar<br># paul,bass<br># george,guitar<br># ringo,drums<br>​<br>def titleName(row):<br>    row[&#39;name&#39;] = row[&#39;name&#39;].title()<br>​<br>f = Flow(<br>    load(&#39;beatles.csv&#39;),<br>    titleName<br>)<br>data, *_ = f.results()<br>​<br>print(data)<br>​<br># --&gt;<br># [<br>#   [<br>#     {&#39;name&#39;: &#39;John&#39;, &#39;instrument&#39;: &#39;guitar&#39;}, <br>#     {&#39;name&#39;: &#39;Paul&#39;, &#39;instrument&#39;: &#39;bass&#39;}, <br>#     {&#39;name&#39;: &#39;George&#39;, &#39;instrument&#39;: &#39;guitar&#39;}, <br>#     {&#39;name&#39;: &#39;Ringo&#39;, &#39;instrument&#39;: &#39;drums&#39;}<br>#   ]<br># ]</pre><p>The source file can be a CSV file, an Excel file or a Json file. You can use a local file name or a URL for a file hosted somewhere on the web.</p><p>Data sources can be generators and not just lists or files. Let’s take as an example a very simple scraper:</p><pre>from dataflows import Flow<br>​<br>from xml.etree import ElementTree<br>from urllib.request import urlopen<br>​<br># Get from Wikipedia the population count for each country<br>def country_population():<br>    # Read the Wikipedia page and parse it using etree<br>    page = urlopen(&#39;https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population&#39;).read()<br>    tree = ElementTree.fromstring(page)<br>    # Iterate on all tables, rows and cells<br>    for table in tree.findall(&#39;.//table&#39;):<br>        if &#39;wikitable&#39; in table.attrib.get(&#39;class&#39;, &#39;&#39;):<br>            for row in table.findall(&#39;tr&#39;):<br>                cells = row.findall(&#39;td&#39;)<br>                if len(cells) &gt; 3:<br>                    # If a matching row is found...<br>                    name = cells[1].find(&#39;.//a&#39;).attrib.get(&#39;title&#39;)<br>                    population = cells[2].text<br>                    # ... yield a row with the information<br>                    yield dict(<br>                        name=name,<br>                        population=population<br>                    )<br>​<br>f = Flow(<br>      country_population(),<br>)<br>data, *_ = f.results()<br>​<br>print(data)<br># ---&gt; <br># [<br>#   [<br>#     {&#39;name&#39;: &#39;China&#39;, &#39;population&#39;: &#39;1,391,090,000&#39;}, <br>#     {&#39;name&#39;: &#39;India&#39;, &#39;population&#39;: &#39;1,332,140,000&#39;}, <br>#     {&#39;name&#39;: &#39;United States&#39;, &#39;population&#39;: &#39;327,187,000&#39;},<br>#     {&#39;name&#39;: &#39;Indonesia&#39;, &#39;population&#39;: &#39;261,890,900&#39;},<br>#     ...<br>#   ]<br># ]</pre><p>This is nice, but we do prefer the numbers to be actual numbers and not strings.</p><p>In order to do that, let’s simply define their type to be numeric:</p><pre>from dataflows import Flow, set_type<br>​<br>def country_population():<br>    # same as before<br>    ...<br>​<br>f = Flow(<br>    country_population(),<br>    set_type(&#39;population&#39;, type=&#39;number&#39;, groupChar=&#39;,&#39;)<br>)<br>data, *_ = f.results()<br>​<br>print(data)<br># --&gt;<br># [<br>#   [<br>#     {&#39;name&#39;: &#39;China&#39;, &#39;population&#39;: Decimal(&#39;1391090000&#39;)}, <br>#     {&#39;name&#39;: &#39;India&#39;, &#39;population&#39;: Decimal(&#39;1332140000&#39;)}, <br>#     {&#39;name&#39;: &#39;United States&#39;, &#39;population&#39;: Decimal(&#39;327187000&#39;)}, <br>#     {&#39;name&#39;: &#39;Indonesia&#39;, &#39;population&#39;: Decimal(&#39;261890900&#39;)},<br>#     ...<br>#   ]<br># ]<br>​</pre><p>Data is automatically converted to the correct native Python type.</p><p>Apart from data-types, it’s also possible to set other constraints to the data. If the data fails validation (or does not fit the assigned data-type) an exception will be thrown — making this method highly effective for validating data and ensuring data quality.</p><p>What about large data files? In the above examples, the results are loaded into memory, which is not always preferrable or acceptable. In many cases, we’d like to store the results directly onto a hard drive — without having the machine’s RAM limit in any way the amount of data we can process.</p><p>We do it by using <em>dump</em> processors:</p><pre>from dataflows import Flow, set_type, dump_to_path<br>​<br>def country_population():<br>    # same as before<br>    ...<br>​<br>f = Flow(<br>    country_population(),<br>    set_type(&#39;population&#39;, type=&#39;number&#39;, groupChar=&#39;,&#39;),<br>    dump_to_path(&#39;country_population&#39;)<br>)<br>*_ = f.process()<br>​</pre><p>Running this code will create a local directory called county_population, containing two files:</p><pre>├── country_population<br>│   ├── datapackage.json<br>│   └── res_1.csv</pre><p>The CSV file — res_1.csv - is where the data is stored. The datapackage.json file is a metadata file, holding information about the data, including its schema.</p><p>We can now open the CSV file with any spreadsheet program or code library supporting the CSV format — or using one of the <strong>data package</strong> libraries out there, like so:</p><pre>from datapackage import Package<br>pkg = Package(&#39;country_population/res_1.csv&#39;)<br>it = pkg.resources[0].iter(keyed=True)<br>print(next(it))<br># prints:<br># {&#39;name&#39;: &#39;China&#39;, &#39;population&#39;: Decimal(&#39;1391110000&#39;)}</pre><p>Note how using the data package meta-data, data-types are restored and there’s no need to ‘re-parse’ the data. This also works with other types too, such as dates, booleans and even lists and dicts.</p><p>So far we’ve seen how to load data, process it row by row, and then inspect the results or store them in a data package.</p><p>Let’s see how we can do more complex processing by manipulating the entire data stream:</p><pre>from dataflows import Flow, set_type, dump_to_path<br>​<br># Generate all triplets (a,b,c) so that 1 &lt;= a &lt;= b &lt; c &lt;= 20<br>def all_triplets():<br>    for a in range(1, 20):<br>        for b in range(a, 20):<br>            for c in range(b+1, 21):<br>                yield dict(a=a, b=b, c=c)<br>​<br># Yield row only if a^2 + b^2 == c^1<br>def filter_pythagorean_triplets(rows):<br>    for row in rows:<br>        if row[&#39;a&#39;]**2 + row[&#39;b&#39;]**2 == row[&#39;c&#39;]**2:<br>            yield row<br>​<br>f = Flow(<br>    all_triplets(),<br>    set_type(&#39;a&#39;, type=&#39;integer&#39;),<br>    set_type(&#39;b&#39;, type=&#39;integer&#39;),<br>    set_type(&#39;c&#39;, type=&#39;integer&#39;),<br>    filter_pythagorean_triplets,<br>    dump_to_path(&#39;pythagorean_triplets&#39;)<br>)<br>_ = f.process()<br>​<br># --&gt;<br># pythagorean_triplets/res_1.csv contains:<br># a,b,c<br># 3,4,5<br># 5,12,13<br># 6,8,10<br># 8,15,17<br># 9,12,15<br># 12,16,20</pre><p>The filter_pythagorean_triplets function takes an iterator of rows, and yields only the ones that pass its condition.</p><p>The flow framework knows whether a function is meant to hande a single row or a row iterator based on its parameters:</p><ul><li>if it accepts a single row parameter, then it&#39;s a row processor.</li><li>if it accepts a single rows parameter, then it&#39;s a rows processor.</li><li>if it accepts a single package parameter, then it&#39;s a package processor.</li></ul><p>Let’s see a few examples of what we can do with a package processors.</p><p>First, we’ll add a field to the data:</p><pre>from dataflows import Flow, load, dump_to_path<br>​<br>​<br>def add_is_guitarist_column_to_schema(package):<br>    # Add a new field to the first resource<br>    package.pkg.resources[0]<br>               .descriptor[&#39;schema&#39;][&#39;fields&#39;]<br>               .append(dict(<br>            name=&#39;is_guitarist&#39;,<br>            type=&#39;boolean&#39;<br>    ))<br>    # Must yield the modified datapackage<br>    yield package.pkg<br>    # And its resources<br>    yield from package<br>​<br>def add_is_guitarist_column(row):<br>    row[&#39;is_guitarist&#39;] = row[&#39;instrument&#39;] == &#39;guitar&#39;<br>    return row<br>​<br>f = Flow(<br>    # Same one as above<br>    load(&#39;beatles.csv&#39;),<br>    add_is_guitarist_column_to_schema,<br>    add_is_guitarist_column,<br>    dump_to_path(&#39;beatles_guitarists&#39;)<br>)<br>_ = f.process()<br>​</pre><p>In this example we create two steps — one for adding the new field (is_guitarist) to the schema and another step to modify the actual data.</p><p>We can combine the two into one step:</p><pre>from dataflows import Flow, load, dump_to_path<br>​<br>​<br>def add_is_guitarist_column(package):<br>​<br>    # Add a new field to the first resource<br>    package.pkg.resources[0].descriptor[&#39;schema&#39;][&#39;fields&#39;].append(dict(<br>        name=&#39;is_guitarist&#39;,<br>        type=&#39;boolean&#39;<br>    ))<br>    # Must yield the modified datapackage<br>    yield package.pkg<br>​<br>    # Now iterate on all resources<br>    resources = iter(package)<br>    # Take the first resource<br>    beatles = next(resources)<br>​<br>    # And yield it with with the modification<br>    def f(row):<br>        row[&#39;is_guitarist&#39;] = row[&#39;instrument&#39;] == &#39;guitar&#39;<br>        return row<br>​<br>    yield map(f, beatles)<br>​<br>f = Flow(<br>    # Same one as above<br>    load(&#39;beatles.csv&#39;),<br>    add_is_guitarist_column,<br>    dump_to_path(&#39;beatles_guitarists&#39;)<br>)<br>_ = f.process()</pre><p>The contract for the package processing function is simple:</p><p>First modify package.pkg (which is a Package instance) and yield it.</p><p>Then, yield any resources that should exist on the output, with or without modifications.</p><p>In the next example we’re removing an entire resource in a package processor — this next one filters the list of Academy Award nominees to those who won both the Oscar and an Emmy award:</p><pre>from dataflows import Flow, load, dump_to_path<br>​<br>    def find_double_winners(package):<br>​<br>        # Remove the emmies resource - <br>        #    we&#39;re going to consume it now<br>        package.pkg.remove_resource(&#39;emmies&#39;)<br>        # Must yield the modified datapackage<br>        yield package.pkg<br>​<br>        # Now iterate on all resources<br>        resources = iter(package)<br>​<br>        # Emmies is the first - <br>        # read all its data and create a set of winner names<br>        emmy = next(resources)<br>        emmy_winners = set(<br>            map(lambda x: x[&#39;nominee&#39;], <br>                filter(lambda x: x[&#39;winner&#39;],<br>                       emmy))<br>        )<br>​<br>        # Oscars are next - <br>        # filter rows based on the emmy winner set<br>        academy = next(resources)<br>        yield filter(lambda row: (row[&#39;Winner&#39;] and <br>                                  row[&#39;Name&#39;] in emmy_winners),<br>                     academy)<br>​<br>    f = Flow(<br>        # Emmy award nominees and winners<br>        load(&#39;emmy.csv&#39;, name=&#39;emmies&#39;),<br>        # Academy award nominees and winners<br>        load(&#39;academy.csv&#39;, encoding=&#39;utf8&#39;, name=&#39;oscars&#39;),<br>        find_double_winners,<br>        dump_to_path(&#39;double_winners&#39;)<br>    )<br>    _ = f.process()<br>​<br># --&gt; <br># double_winners/academy.csv contains:<br># 1931/1932,5,Actress,1,Helen Hayes,The Sin of Madelon Claudet<br># 1932/1933,6,Actress,1,Katharine Hepburn,Morning Glory<br># 1935,8,Actress,1,Bette Davis,Dangerous<br># 1938,11,Actress,1,Bette Davis,Jezebel<br># ...</pre><h3>Builtin Processors</h3><p>DataFlows comes with a few built-in processors which do most of the heavy lifting in many common scenarios, leaving you to implement only the minimum code that is specific to your specific problem.</p><p>A complete list, which also includes an API reference for each one of them, can be found in the <a href="https://medium.com/PROCESSORS.md">Built-in Processors</a> page.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6f6ea44ccdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Successful Volunteer-based Software Projects]]></title>
            <link>https://medium.com/@adam.kariv/successful-volunteer-based-software-projects-fad6d294ad07?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/fad6d294ad07</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[community-engagement]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Wed, 27 Sep 2017 06:02:39 GMT</pubDate>
            <atom:updated>2017-09-27T06:02:39.295Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introducing the “TOFFEE Metric” and community-oriented software architecture</h4><p>A well-known myth of the open-source world is that in an open-source project, anyone can contribute. While theoretically possible, in reality, most contributions to open-source projects are made by someone who’s being paid to do so — either by a commercial entity or an academic institution.</p><p>However, there are some open-projects who solely rely on contributions from volunteers. In the past 7 years I’ve been working on many of such projects in varying capacities. Most of that work was under the roof of the <a href="http://www.hasadna.org.il/en">Public Knowledge Workshop</a> — a non-profit (of which I’m a proud co-founder) which builds tools and web-sites to make government data (and other public data) more accessible and understandable to the greater public.</p><p>During this time I saw many of these projects starting — but not all of them reaching the finish line. Some were abandoned by their own developers; some were just neglected until they stopped functioning. Some were functional for a few years until their end, while others never gained the initial momentum to take off.</p><p>It should be obvious that the key ingredient for any volunteer-based project is the volunteers — and in the context of an open-source project, we’re usually talking about having a community of developers maintaining and improving the source code.</p><p>One would think that keeping such a community alive and well is a job for community managers or developer advocates, while developers have little to none to do with it — but the truth of the matter is that it’s quite the opposite. In my experience, the technical aspects of a project tend to affect the most on the viability of the developer community surrounding it.</p><p>This post will describe these technical aspects, and what can be done by developers and software architects to help their project’s community to grow and prosper.</p><p>Before diving into the nitty-gritty details, it’s important to understand one thing about software architecture — good architecture comes from having some constraints. Constraints are what guides us whenever there’s a trade-off between two implementation routes, and we need to choose the best one.</p><p>Just as an example, imagine that you are required to implement a software module. In one scenario, you have a team of one developer and a deadline of one year from today. In another scenario, you get a team of 12 developers but only one month to complete the project. The different sets of constraints would dictate different architectures to compensate for the lack of time or to effectively use the larger team. The resulting implementations in these two scenarios would be very different, in spite the identical functional requirements.</p><p>With volunteer-based projects, developers often get the feeling that there are no constraints — you can do whatever you want, and there are no deadlines and no budget. In some cases, constraints are ‘made-up’ in an attempt to replicate something familiar from a work environment (e.g. by self-imposing ‘fake’ milestones to invigorate the team). However, having no constraints (or fake constraints) is a bad idea, as without them development tends to wander off into the wrong places — or you end up optimizing the wrong parameters.</p><p>So, what constraints volunteer-based projects <em>do</em> have? It’s definitely not a resource constraint — as most of them start with no expectation of budget, no deadlines, nor a fixed, dedicated team. The answer is <em>the community — </em>the actual constraint that is inherent for these kind of projects. Just as a commercial project can’t exist without a budget, a volunteer-based software project without a community will simply die.</p><p><strong>Therefore, a software architect’s job in a community-based open-source project is to ensure a live and thriving community.</strong></p><p>Now, I know — you can’t optimize for something that can’t be measured. Also, even if you could measure the liveliness of a community, it’s not intuitive to understand how it’s affected by purely technical decisions (e.g. choice of JavaScript framework or hosting provider).</p><p>One way to bridge this gap is to use this simpler and more tangible metric:</p><p><strong>”How long does it take for a new contributor to fix a simple bug in the code and for the fix to be deployed?”</strong></p><p>We call this metric the <strong><em>TOFFEE Metric</em></strong> —<em> </em><strong><em>T</em></strong><em>ime of </em><strong><em>O</em></strong><em>nboarding, </em><strong><em>F</em></strong><em>inding &amp; </em><strong><em>F</em></strong><em>ixing an issue </em><strong><em>E</em></strong><em>nd to </em><strong><em>E</em></strong><em>nd</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ri2fzjnzfyRgU6Rq1BTx4A.jpeg" /></figure><p>Although it might not encompass all of its aspects, in my experience, there is a very good correlation between a happy community and the ease of contribution. If you think about it, it makes lots of sense — there’s nothing that makes a contributor happier than seeing her code get used.</p><p>So let’s try to break this metric down into pieces:</p><ol><li>As a new contributor, I open the project’s home page for the first time.<br>How long does it take me to <strong>understand</strong> what the project does?</li><li>I decide I want to contribute. <br>Can I quickly <strong>find an open task</strong> that’s suited for my skills and expertise?</li><li>I found a proper task.<br>How fast can I understand <strong>what exactly needs to be done</strong> here?</li><li>I know what needs to be done.<br>How easy it is to <strong>get the code</strong>, find the location that needs to be changed and fix it?</li><li>I made a modification to the code.<br>How much time do I spend in creating a <strong>development environment</strong> to try it out? <br>How simple is it to add verification tests?</li><li>I verified my change and want to submit it.<br>How long does it take me to figure out how to do it?<br>How long do I wait for that <strong>change to be approved</strong>?</li><li>My change was approved.<br>When will I see it used / released / <strong>deployed</strong>?</li></ol><p>We want to try and reduce the time it takes to complete each of these individual steps. If you’re anything like me, you can already begin to see how this seemingly vague constraint we defined a few paragraphs above is already starting to take shape into very concrete action items.</p><p>Before we dive into the details, it’s important to notice one recurring theme, common to nearly all of these steps: removing bottlenecks from the process. The inconvenient truth is that the biggest bottleneck of any open-source project is almost always the core developer team. By removing core developer involvement from the steps above (as much as reasonably possible) we’re not only improving the basic contribution experience, but we’re also freeing time for these core developers to do actual coding.</p><p>You will see that in order to unclog the ‘core-developer’ bottleneck, we will employ different kinds of solutions. Some are <em>technical solutions</em>, in which we find a tool that automates work for us or reduces complexity. Others are <em>workflow solutions</em>, in which we change the processes we use to adapt better to community needs. Finally, the hardest kind of solution is for <em>expanding the core developer pool</em> — and the processes and means we might employ to make that happen more easily and transparently.</p><p>So, let’s dive in —</p><p><strong>Step (1)</strong> is all about <em>documentation</em>.</p><ul><li>It’s important to remember that good documentation does not necessarily mean long documentation — we all know how it is to get into a project’s home page and find ourselves exploring through a vast corpus of documentation just to find out what this project is actually about.<br>Make sure you keep it short and to the point. Clearly separate the parts of documentation which are meant for new contributors from the ones that are meant for users or for general reference.</li><li>One important piece of information to state in the documentations is “where you should ask questions”. Although our aim is to create a smooth as possible experience, without the need for human interaction (as humans are not always available to help), sometimes asking someone a question is the simplest solution out of a problem. Having a link to a forum, gitter/slack/.. channel or a simple email address for support could be invaluable at this point.</li><li>Documentation should always be up-to-date. Make sure it’s updated by keeping it lean, making sure that any code change also contains the accompanying documentation change in the same change request. Use tools to auto-generate documentation for code and APIs as much as possible.</li><li>Newcomers are the best critics of your documentation. Encourage them to open issues on documentation problems and make sure they are fixed.</li></ul><p><strong>Step (2)</strong> is about <em>issue management</em>.</p><ul><li>Make sure the project’s issues are publicly visible and viewable in a single location. It should be clearly documented where that is. <br>If you’re using more than one repository on GitHub, you should use any of the numerous services that allow managing issues from many sources in a single place.</li><li>Make sure the priority of issues is clear and understandable. If there are specific milestones to be aware of, make sure they are mentioned in the issue itself. If there’s a CCB / Kanban / Scrum / Other project management system that you’re using to decide what needs to be worked on and when, make sure it’s transparent to everyone.</li><li>Some issues are meant for the core developers and are not suitable for a newcomer. That’s perfectly fine, as long as you mark these issues clearly as such.</li><li>If something is not important or not ready to be implemented, move it to the backlog. You don’t want someone putting time and effort on an issue that will never be used.</li><li>The backlog can get very long very quickly. Make sure you clearly mark what’s in the real backlog (“This is something that we’re planning to do sometime in the future”) and what’s not (“This is an interesting hypothetical idea that has no chance of being implemented any time soon”).</li></ul><p>Which issues are good for newcomers? Here are a few tips:</p><ul><li>You should choose simple to explain and self-contained tasks. Nothing that requires many integrations with different parts of the code.</li><li>Don’t choose anything that’s on your critical path or a dependency of other future developments etc.</li><li>In case there’s a recurring task that you find that has a good fit for newcomers, consider creating a ‘contribution endpoint’ for that task.</li></ul><p><em>What are Contribution Endpoints?</em></p><p>In many projects you often have sets of code changes which follow a very similar process. The classic example of such tasks would be to localise your project to a new language —the process of adding a new language is pretty much the same, regardless of the actual language. This is the reason that you would often find specific processes and tools for adding translations to a project, which are different than the regular contribution flow. Other examples for such tasks would be adding a new codec to a video player, adding a new effect to a graphic editor or adding support for a new file type in a file manager — you get the gist.</p><p>You should try and identify if your project has such tasks . If so, make sure that the contribution process for that specific sort of task is frictionless, and requires as little boilerplate as possible. If there’s any tooling that might make these specific tasks even easier to accomplish, you should consider that as well.</p><p><strong>Step (3)</strong> is also about issues — and what’s in them.</p><ul><li>Make sure you state clearly what’s the required outcome of this issue.</li><li>Provide a few guidance tips on where to start, which module needs modification etc.</li><li>Use a standard template for these sort of issues. Make sure that template includes a footer with links to relevant documentation, style guide, tutorials or sample code.</li><li>Avoid having strict checklists (e.g. ‘[ ] Write tests’). Instead have a link in the footer to the project’s workflow and conventions documentation.</li></ul><p><strong>Step (4)</strong> is mostly focused on managing <em>complexity</em>.</p><p>The time it takes for a newcomer to understand your code and find the correct place to make a fix, depends greatly on the complexity of the code itself and its environment.</p><p><strong>One of the most important tasks of a software architect in these sort of projects is to make sure complexity doesn’t rise over a certain limit — and take corrective actions in case that it does.</strong></p><p>Complexity can arise out of many factors:</p><ul><li>There is too much code: sometimes it’s best to split the code into multiple loosely-linked components to manage complexity.</li><li>There are too many tightly-coupled components, with too little functionality. Same as above, only the other way round.</li><li>The code is too tangled, abstract or self-referencing: It could be the neatest trick in the programming book or just messy code — for a newcomer it will look the same. Keep it simple and organised, and refactor the troublesome piece of code.</li><li>The choice of tooling or framework is esoteric, too cutting edge or obsolete. Don’t reinvent the wheel — use industry standards for your frameworks, build scripts etc. so that newcomers know how to work with your codebase without having to learn irrelevant stuff too.</li></ul><p>As an aside, separating into stand-alone components has other benefits as well. By giving more experienced contributors permission to review and merge code changes in these components you’re starting to build trust with these contributors (which might end up in expanding the core-developers team) and reduce workload off the core developers.<br>In case something goes wrong, the risk of damage is confined within one component only. The contributors receiving these new permissions will feel empowered, have more autonomy — and will overall be more committed to the project and its goals.</p><p><strong>Step (5)</strong> is, I think, the most neglected subject — the <em>development environment</em>.</p><p>Being able to run the code locally on a developer’s machine is a requirement for getting any proper contribution — but when facing a custom install of dependencies and tools is often the point where most contributors give up and never come back.</p><ul><li>Plan for multi-platform support. Having a development environment which works well on a wide variety of user machines is not something you get by chance.<br>The exact solution varies greatly depending on the nature of your product, but there are quite a few technical solutions today for managing this — vagrant, Docker for ‘virtualisation’ on the user machine, online IDEs (such as c9.io and others), just to name a few examples. Avoiding native libraries (or providing alternatives for development purposes) can also help in some cases.</li><li>Managing constrained environments on a user machine is also a must — npm does it, Python has virtual environments etc.</li><li>Aim for a state where contributors can develop only one component of your product without having to install a fully working system. For example, if you have website consisting of a front-end and a back-end components, don’t require running the back-end locally for developing the front-end.<br>Providing good stubs (or working with online services instead) could help in removing these sort of requirements.</li><li>If there are any data fixtures that are needed to bootstrap the local development environment, make sure they are always up-to-date and usable.</li></ul><p><strong>Step (6)</strong> is about <em>automatic verification</em> of code.</p><p>You have reached the point where new code is about to be merged to the common code base. This step is the first one where a core developer involvement might actually be required. Therefore, it’s important to keep this involvement to the bare minimum.</p><ul><li>Avoid using written style guides — most languages today can rely on linters to make sure that the code conforms to a specific style guide.</li><li>Rely on unit-tests to make sure that no functionality was broken. Make sure that unit-tests were added to test new functionality by having coverage reports and seeing that the proposed change maintains or increases code coverage.<br>Any other conventions that need to be checked should also be added here (e.g. commit messages).</li><li>Make sure that you integrate the execution of unit-tests, coverage and linting within the acceptance criteria of any code change. This is very easy to do nowadays (GitHub, travis-ci, and coveralls are some of the services that I’ve been using).</li><li>Code reviews should focus on the modified logic itself, and not on anything else. Teach the core developers to trust the automation, and make sure it works for you — it is saving everybody’s time, after all.</li></ul><p>Finally, <strong>step (7)</strong> is about <em>infrastructure</em>.</p><ul><li>Any code that passes the verification steps so far should be ‘production ready’. This means that at the very least you should be able to deploy it to your staging environment / nightly builds etc. <br>If it’s possible, it’s even better to push it directly to production — push it to the live website, deploy a version on npm/pypi etc. — depending on your use case.</li><li>This deployment should be automatic — no need to wait for someone to push a button.</li></ul><p>Infrastructure should be as visible as possible to everyone:</p><ul><li>Make production databases world-readable (apart from tables containing private information)</li><li>Make production server logs world-visible.</li><li>Allow anyone to see the status of your servers, the load or individual service status.</li></ul><p>Providing this transparency will allow contributors to debug problems occurring on the live servers independently, and might provide you with insights you weren’t aware of.</p><p>To sum up — the software architecture of a project which relies on voluntary contributions of code is very different from a ‘regular’ commercial project. The set of constraints and considerations is different and you should optimize your architecture on a different metric — namely, the liveliness of your community.</p><p>I’ve introduced the <em>TOFFEE Metric</em> — a metric which we use to measure our ability to add new contributors. This simple metric correlates very well with the overall liveliness of your project’s contributor community.</p><p>Finally, I’ve included some practical implementation tips on how to minimize your <em>TOFFEE Metric</em> and make your code and processes more agreeable to newcomers.</p><p>Here’s to many pull requests to come!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fad6d294ad07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Letting Data Speak for Itself]]></title>
            <link>https://medium.com/@adam.kariv/letting-data-speak-for-itself-80f1625a8ad1?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/80f1625a8ad1</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[data-journalism]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Tue, 27 Jun 2017 13:12:55 GMT</pubDate>
            <atom:updated>2017-06-27T13:12:55.890Z</atom:updated>
            <content:encoded><![CDATA[<h4>Or: what is Visualisation Metadata and why do we need it?</h4><p>Everybody knows that a visualisation is a visual representation of data. Well, that’s the theory, at least.</p><p>In practice, the process of creating a visualisation is a bit different. Let’s say you’re a journalist in a newsroom, and you’re writing a story. The editor told you that you should add some data to your article so that it looks more professional — but everybody knows that you can’t just throw all the numbers inside your text, as it will turn away the readers. What you need is a nice and easy, colorful visualisation.</p><p>But how do you get there?</p><p>Most people creating visualisations are trying to make a point — or support a certain claim. However, data itself doesn’t tell a story. And in order to make the data talk, you would often need to choose the data you want to show.</p><p>This means:</p><ul><li>You might select a specific time range in which the phenomenon you’re describing is most noticeable</li><li>You might decide to show a sample of the data instead of all the data points</li><li>You could choose specific indicators that most support your claim</li><li>You might need to do some processing on the data — for example, average some similar data points if the original data is too detailed.</li></ul><p>As an aside — there’s nothing un-ethical about this process. This is a simple case of editing — choosing what to tell the readers and what to omit. It only becomes a problem if you intentionally decide to omit data contradicting your claim with the sole purpose of misleading your readers.</p><p>Now that you have your data sorted out, you need to think on how you want to visualise the data. There are many kinds of visualisations, each telling a slightly different story. A pie chart is different than a line chart in many ways, and not all visualisation will serve your claims the same way.</p><p>This is usually the time for your trusted graphic designer to join in. They would take your Excel sheet with your mock-up visualisation, and convert it into a visually appealing chart. The final output will have the specified chart, annotated, with relevant context — all packaged nicely in a high-resolution image, ready to be printed, broadcasted or embedded in a website.</p><p>So the output is visually stunning. However, in this process we lost track of the original data and the changes it underwent to make the visualisation.</p><p>And this is a problem.</p><h3>What do we need?</h3><p>I propose that we should have a standard way of attaching to a visualisation image:</p><ul><li>The original data (or where it came from)</li><li>The processing steps</li><li>The resulting data</li><li>Visualisation hints</li><li>Annotations, context etc.</li></ul><p>Then we need to build specialised software (i.e. a web browser) for using this information and rendering a visualisation from scratch — alongside the pre-rendered image which the publisher prepared.</p><p>Next I’ll tell you why this is worth the bother. After that — how it can be done.</p><h3>So why all the hassle?</h3><h4>Avoiding Bias and Maintaining Credibility</h4><p>We all know that visualisations are an easy target for manipulation and deceit — by carefully choosing the time ranges and chart properties you could engineer your chart to give the opposite impression of what an unbiased inspection of the data might give.</p><p>However, even the most honest reporter could fall into these dis-information traps — either due to her own internal biases or by simple mistake.</p><p>A good way to maintain credibility in such cases is to provide the raw data along the visualization. However, “the raw data” usually means two things here — both the original data as well as the processed one. Without the former the reader has no way of validating the source of the data or the processing it underwent. Without the latter, we leave the reader with the task of cleaning, processing and extracting the exact same data-set that was used in the visualisation.</p><p>The solution here is to supply both — and also thoroughly explain the process and methodology that was used in getting from the raw data to the final data that is used in the visualisation.</p><h4>Accessibility</h4><p>Graphic visualisation of data works quite well for the most of us — but not all.</p><p>Visually impaired readers will have a hard time understanding the visualisation if they can’t properly see it. There are some good practices to somewhat circumvent this problem — for example, more aware designers will know to choose color schemes which are more friendly to the relatively large population having some variant of color blindness. Obviously, it’s impossible to similarly work around all kinds of vision loss.</p><p>By having the source data for each visualisation attached to it, we could allow different rendering engines to present the same data. In some cases they might allow selecting a different color scheme. In others, the data could be presented in a completely different manner (for example. a few projects <a href="http://spartanideas.msu.edu/2015/06/26/representing-data-with-sound-sonification/">representing data with sound sonification</a>).</p><p>But we can see that the data itself is not enough — we also need some information regarding the meaning of the data. In many cases it’s impossible to know the meaning of each column and what’s the best way to present its information without some sort of guideline.</p><p>Such guidelines might include the type of the data (numeric/textual), units (kg/USD) or preferred axis (temporal/logarithmic) etc.</p><h4>Exploration</h4><p>Allowing readers to explore the data beyond the limits of the visualisation itself is very important.</p><p>Not only it allows the user to see the same data in different perspectives (e.g. group by another dimension / variable) or using different visualisations, it also allows the reader to select a different part of the original data set to convince herself with your claim — or prove it wrong.</p><p>It makes sense to me that as time passes, it’s going to be less and less common for readers to accept a claim at face value without any scrutiny. Providing the ability to inspect the raw data independently and reach the same conclusion will only strengthen the power of good research (and will eventually help fighting misleading presentation of data).</p><h4>Provenance</h4><p>As we’ve seen, knowing the exact source of where data came from is very important in building credibility as well as allowing the same analysis of data to be reproduced. Usually, a link to a data portal or a website holding the data is sufficient.</p><p>But what if the source of data is constantly changing? What if someone decides to take down the website (out of malice or incompetence — or a combination of both)? And worse of all of these — what if the publisher of data decides to retroactively falsify the published data?</p><p>These are not unimaginable scenarios, and in order to circumvent them we need to provide some sort of proof for the authenticity of data. One way of doing this would be by digitally signing the data at the time of collection — by a trusted 3rd party. The same way that websites today prove their identity by using a certificate, digitally signed by a “certificate authority”, data might be signed with a similar certificate — proving that the exact same data existed on the exact same date.</p><h3>How can it be done?</h3><p>Let’s try and list what we need in order to make this work — turns out that most of it already exists and simply needs to be gathered together to a single umbrella spec.</p><h4>Portable data</h4><ul><li>There is some very nice work done in <a href="https://medium.com/frictionlessdata.io">frictionlessdata.io</a> on the concept of ‘Data Packages’ — providing a specification for packaging data in a portable format, documentation and schema.</li><li>We could use the emerging JOSE framework (<a href="http://jose.readthedocs.io/en/latest/#id8">Javascript Object Signing and Encryption</a>), for digitally signing the data itself. This framework was built for the web and is described in more than one RFCs.</li></ul><h4>What data should be shown?</h4><p>How do we specify which columns or value ranges to show — or which filters to apply? The <a href="https://vega.github.io/">Vega</a> framework contains some grammar for doing exactly this (and much more). For example:</p><pre>{<br>  &quot;data&quot;: [<br>    {<br>      &quot;name&quot;: &quot;table&quot;,<br>      &quot;transform&quot;: [<br>        { &quot;type&quot;: &quot;filter&quot;, &quot;expr&quot;: &quot;datum.value &gt; 5&quot; },<br>        { &quot;type&quot;: &quot;stack&quot;, &quot;field&quot;: &quot;val&quot;, &quot;groupby&quot;: [&quot;category&quot;] }<br>      ]<br>    }<br>  ]<br>}</pre><h4>How should it be presented?</h4><p>When describing presentation parameters we refer to selecting the chart type (bar or pie?), the axis types (dates or logarithmic?), chart titles, legend and annotations.</p><p>A variant of the aforementioned Vega allows to define charts in a high level language:</p><pre>{<br>  &quot;$schema&quot;: &quot;https://vega.github.io/schema/vega-lite/v2.json&quot;,<br>  &quot;data&quot;: {&quot;url&quot;: &quot;data/seattle-temps.csv&quot;},<br>  &quot;mark&quot;: &quot;bar&quot;,<br>  &quot;encoding&quot;: {<br>    &quot;x&quot;: {<br>      &quot;timeUnit&quot;: &quot;month&quot;,<br>      &quot;field&quot;: &quot;date&quot;,<br>      &quot;type&quot;: &quot;temporal&quot;<br>    },<br>    &quot;y&quot;: {<br>      &quot;aggregate&quot;: &quot;mean&quot;,<br>      &quot;field&quot;: &quot;temp&quot;,<br>      &quot;type&quot;: &quot;quantitative&quot;<br>    }<br>  }<br>}</pre><h3>Making it work with the Web</h3><p>In order for something to work on the web, we first need an agreed upon standard that guides different implementors and guarantees compatibility between different implementations.</p><p>But we don’t need to reinvent the wheel — we already have an HTML tag for showing plain images: &lt;img&gt;.</p><p>HTML5 introduced the &lt;picture&gt; tag, allowing for multiple alternative sources for a single image:</p><pre>&lt;picture&gt;<br>    &lt;source srcset=&quot;<strong>vis.svg</strong>&quot; type=&quot;image/svg+xml&quot;&gt;<br>    &lt;img src=&quot;<strong>vis.png</strong>&quot; alt=&quot;Population growth&quot;&gt;<br>&lt;/picture&gt;</pre><p>The &lt;picture&gt; tag in the above example will attempt to show the user the image vis.svg, and if that fails (due to device incompatibility or other error), will fall back to vis.png.</p><p>Similarly we might imagine an extension of this tag:</p><pre>&lt;picture&gt;<br>    &lt;source srcset=&quot;<strong>vis.json</strong>&quot; <br>            type=&quot;<strong>application/vnd.vegalite.v1+json</strong>&quot;&gt;<br>    &lt;img src=&quot;<strong>vis.png</strong>&quot;&gt;<br>&lt;/picture&gt;</pre><p>in which the browser would show the image first, but will provide a user interface for viewing the data via the interactive visualisation described in the Vega-Lite description file. Different browsers might provide different rendering engines for such visualisations — from supporting aids for visually impaired individuals all through a powerful data exploration engine.</p><h4>Where is the data?</h4><p>In the above example, the data is embedded inside the visualisation spec. However, a more elegant solution in my mind would be to separate both concerns.</p><p>HTML5 has a &lt;data&gt; tag which allows you to attach data to an element:</p><pre>&lt;p&gt;New Products&lt;/p&gt;<br>&lt;ul&gt;<br> &lt;li&gt;&lt;<strong>data</strong> value=&quot;<strong>398</strong>&quot;&gt;Mini Ketchup&lt;/data&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;<strong>data</strong> value=&quot;<strong>399</strong>&quot;&gt;Jumbo Ketchup&lt;/data&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;<strong>data</strong> value=&quot;<strong>400</strong>&quot;&gt;Mega Jumbo Ketchup&lt;/data&gt;&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>Let’s try to reimagine the above visualisation example, now with the data element.</p><pre>&lt;data value=&quot;<strong>http://data.gov/population-growth/datapackage.json</strong>&quot;&gt;<br>    &lt;picture&gt;<br>        &lt;source srcset=&quot;<strong>vis.json</strong>&quot; <br>                type=&quot;application/vnd.vegalite.v1+json&quot;&gt;<br>        &lt;img src=&quot;vis.png&quot;&gt;<br>    &lt;/picture&gt;<br>&lt;/data&gt;</pre><p>Here the visualisation is actually inside a data-bound element, so theoretically we don’t need to provide the data as part of the visualisation specification.</p><p>We could go even one step further — there’s no reason that a publisher of the data wouldn’t supply a few sample visualisations of the data:</p><pre>&lt;data value=&quot;<strong>http://data.gov/pop-growth/datapackage.json</strong>&quot;&gt;<br>    &lt;picture&gt;<br>        &lt;source srcset=&quot;<strong>http://data.gov/pop-growth/barchart.json</strong>&quot; <br>                type=&quot;application/vnd.vegalite.v1+json&quot;&gt;<br>        &lt;img src=&quot;vis.png&quot;&gt;<br>    &lt;/picture&gt;<br>&lt;/data&gt;</pre><p>And we might even provide a visualisation without an accompanying image, as data could be presented in other ways too:</p><pre>&lt;data value=&quot;<strong>http://data.gov/pop-growth/datapackage.json</strong>&quot;<br>      <strong>data-visualisation</strong>=&quot;<strong>http://data.gov/pop-growth/barchart.json</strong>&quot;<br>      &gt;<br>    &lt;h3&gt;<strong>Population Growth</strong>&lt;/h3&gt;<br>    &lt;table&gt;<br>      &lt;thead&gt;...&lt;/thead&gt;<br>      &lt;tbody&gt;...&lt;/tbody&gt;<br>  &lt;/table&gt;<br>&lt;/data&gt;</pre><p>Or even like this — as a neat way for backing a claim in a classic, textual, news article with the source data and a visualisation:</p><pre>&lt;data value=&quot;<strong>http://data.gov/pop-growth/datapackage.json</strong>&quot;<br>      data-visualisation=&quot;<strong>http://data.gov/pop-growth/JP/trend.json</strong>&quot;<br>      &gt;<br>    &lt;p&gt;<strong>The average annual population growth rate in Japan in the past 5 year has been around -0.17%</strong>&lt;/p&gt;<br>&lt;/data&gt;</pre><h3>Summary</h3><p>We got used to being able to verify claims made on the Internet by following a link to a respectable source. As the saying goes: “Link or it didn’t happen!”. But times are changing and even respectable sources are not what they used to be.</p><ul><li>We need to be able to link directly to the source data itself — and verify it in the process.</li><li>We need to be able to visually show data and allow its interactive exploration — because no one needs another CSV file.</li><li>We need data to be more accessible to a larger audience — and make sure it’s presented with little bias as possible.</li></ul><p>The time has come for letting the data speak for itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80f1625a8ad1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Misconceptions about Data Journalism]]></title>
            <link>https://medium.com/@adam.kariv/some-misconceptions-about-data-journalism-8c911e743ef8?source=rss-3722ab0c6039------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c911e743ef8</guid>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[advocacy]]></category>
            <category><![CDATA[data-journalism]]></category>
            <category><![CDATA[hacktivism]]></category>
            <category><![CDATA[journalism]]></category>
            <dc:creator><![CDATA[Adam Kariv]]></dc:creator>
            <pubDate>Wed, 19 Oct 2016 08:20:53 GMT</pubDate>
            <atom:updated>2016-10-26T12:14:32.188Z</atom:updated>
            <content:encoded><![CDATA[<p>In the past few years, a new discipline in journalism is slowly getting more and more followers — a discipline commonly known as ‘data journalism’.</p><p>These so-called ‘data journalists’ are usually envisioned as the younger, tech savvy journalists, ones that are not afraid to analyse data, understand how computer code works and simply love these colourful and detailed visualisations.</p><p>On the other end of the scale are the non-data-journalists . We usually imagine them, still using a phone and Rolodex as they simply don’t get email — and the last technological leap they made was when the mechanical typewriters were replaced by computerised word processors.</p><p>Moving away from these simplistic (even stereotypical) dichotomies into a better understanding of what a data journalist actually looks like, will do justice to the actual hard-working data-journalists out there as well as take this movement forward and make it more open and inclusive.</p><blockquote>The Python vs. Rolodex dilemma</blockquote><p>Let’s begin with the ground truth about the journalism trade: <strong>Journalism is all about telling a story</strong>, and the best stories are ones that revolve around humans, not numbers.</p><p>This basic fact was true a hundred years ago, and is not about to change — even if technology does. For this reason, the best journalists will always be the masters of words; those who have the best understanding of people and what makes them tick. It is the unfortunate truth that the benefit of knowing how to work with data will <em>always</em> come after that.</p><p>Don’t get me wrong, there’s certainly a place for all the ‘visualisation-oriented journalists’ (or “visi-journalists”). That’s because sometimes <em>the data </em><strong><em>is</em></strong><em> the story</em>. Sometimes, the fact that some new data is available to the public is newsworthy. Sometimes, some hard-to-find, hidden links in a large dataset are the scoop. Sometimes, a subject is too technical and complex that only a super-interactive visualisation is the only way to actually explain it. But <em>most times</em>, this is not the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TarOkKlYMjFKB5acxb0nUQ.jpeg" /></figure><p>So we have on one end of the spectrum, that old school journalist with her Rolodex, holding a precious network of high-ranking sources. On the other extreme, a journalist that also codes and wrangles data, trying to find a corruption case by sifting through publicly available data using a custom made Python script. But in between these two extremes, lies a vast range of hard-working journalists, reporting on the day to day happenings in politics, economy, foreign affairs and domestic issues. These journalists don’t have any sources in any high places, and have never heard of Python.</p><p>Yet, this majority of journalists is mostly ignored by the data journalism movement — which is a shame, as these are the ones most likely to benefit from it and advance it the most.</p><blockquote>A website is not a source</blockquote><p>Flashback to five years ago — I’m one of the few founding-volunteers of an open-data NGO in Israel, “The Public Knowledge Workshop”. One of our first projects was called “The Open Budget” — a website who took the publicly available (but hard-to-understand) national budget data and presented it in a feature-rich, user friendly website.</p><p>At that time, we tried to meet with as many journalists as we could to tell them about the new budget website — and not many would spare an hour of their busy schedules for some geeks from an unknown NGO. We would show them how easy it was to find information and visualise it in an instant. Then we would ask them whether they might consider using our website by themselves for their work.</p><p>A common answer that took me by quite a surprise always went along the lines of “That is very nice indeed but I don’t need your website as I have my sources in the Ministry of Finance and they get me any data I need”. The fact that the data was lying there, within a mouse-click’s reach, and they still wouldn’t use it — simply baffled me. It took me some time to understand why it made perfect sense.</p><p>Nevertheless, we would offer ourselves to these journalists as domain experts in understanding and analysing government data (or even knowing where to find that data) — and as volunteer ‘data wranglers’. In theory, it was supposed to be a mutually beneficial relationship: they needed help with getting the right data in their stories, and we were a young NGO, hungry for some media spotlight. In practice, this situation resulted in too many articles where we would do the work but would not be credited for it. Journalists would ask for some budget related data analysed for an article with a tight deadline. We would do our part, only to find the data attributed in the printed paper to the Ministry of Finance. As annoying as it was, they would always claim that they cannot give us credit as “No one knows who you are. We need someone with some credibility”…</p><blockquote>Getting an answer is a human thing</blockquote><p>So what is the reason, really, that journalists will not use an official government open-data web-site to get data and for fact-checking?</p><p>I remember one time a journalist calling me with a very simple question:</p><blockquote>- ‘Can you tell me the total size of this year’s national budget?’</blockquote><blockquote>- ’Sure, but did you try our website? It’s the one single big number right there on the homepage.’</blockquote><blockquote>- ‘Umm… there are a few other numbers there. Can you please copy-paste the correct one and send it to me in an email?’</blockquote><p>And so I did.</p><p>Was that reporter lazy? Perhaps. But it wasn’t just that. As it turns out, it’s not just a matter of credibility — it’s also a matter of attribution. Journalistic reporting is a delicate art of telling a narrative using only “facts”, not the journalist’s own personal opinions. Journalistic facts (which may be just someone else’s opinion) need to always be attributed to someone, be it a person or an organisation.</p><p>So you’d get sayings similar to this: ‘according to this NGO, spending on health in the national budget is 20%’. This sort of wording leaves room for other parties to claim the analysis was wrong and the actual number is different. It keeps journalists free from biases — and from accusations of such biases — while still promoting a specific world view.</p><p>The only catch is that this only works if they are solely <em>reporting</em> these interpretations — not <em>making</em> them.</p><blockquote>Getting the right answer is also a human thing</blockquote><p>As time passed and the number of journalists seeking our help constantly grew, a new understanding slowly emerged. We were no longer just the geeks with the best budget data in town, but we became also the geeks that know the most about the intricacies of the budgeting cycle, tenders and procurement processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*fTfrGH87YNIJhqhtgkMPdQ.png" /><figcaption>Geeks in action</figcaption></figure><p>All of a sudden we were able to answer more vague questions from journalists. Take this question as an example - “how much money is a specific company getting from the government?”. To answer that, you first need to know what options there are to ‘get money from the government’ (there are at least three or four). Then you need to know how to query the data correctly to find the actual data rows that answer the question. You might find that a single company is in fact more than one legal entity. You could discover that it’s being called differently in different data sources. Some data sources might contain data that’s partly overlapping. And after all that work you still need to produce an answer that is (most likely) correct and you can wholeheartedly stand behind it.</p><p>Getting to such a level of expertise is not something that happens in a day. This is another reason why open-data portals are simply not that useful for journalists. Even if the journalist has a clue as to which dataset contains an answer to her question — which is rarely the case, nor that a single dataset will hold the answer — it’s not enough to see the data, you need to make sense out of it. You need to understand the context. You need to know what it <em>really means — </em>and for that, you need an expert.</p><blockquote>When Open Data takes the Lead</blockquote><p>With deep knowledge of data, arrive interesting findings. Most are standard cases of negligence with public funds. Some are interesting insights regarding money flows that are only visible when analysing the ‘big picture’. Only rarely you find small acts of corruption. We believed that each of these findings was newsworthy, and we would try to find journalists that might take our leads and develop them into a complete story.</p><p>But hard as we tried, our efforts were in vain — none of the methods we tried seemed to be working. We tweeted our findings, wrote about them in our blog, pushed them hard through facebook — we even got a Telegram bot pushing algorithmically detected suspicious procurements in real time! But journalists were not impressed.</p><p>On other instances, we managed to get a specific journalist interested in a story. The only problem was that sometimes they would hold on that piece of information for weeks without doing anything with it until it became irrelevant — thus losing our chance to use it anywhere else.</p><p>At that point we decided to get some help from an expert, and hired a PR manager to help our efforts to get the message across. Seeing him work with journalists left me in awe: his ability to match the right story to the correct person, ensure we were always credited properly, that stories were written promptly was something we’d never seen. And the best part was how he was leveraging his many connections to make journalists come to us for the next story instead of the other way round.</p><p>But he also made us change our ways a little bit — as good leads needed to be kept secret until a good match was found. Exclusivity and patience bought us larger media coverage and a wider reach — but with the price of compromising on our open-data and transparency ideologies.</p><blockquote>Data <strong>is</strong> a Source</blockquote><p>Back to present day.</p><p>We still meet journalists on a regular basis. and although it’s now easier to get their attention, most of them would still start our meetings with a skeptical approach. They look as if they wonder ‘what are they trying to sell me?’ and ‘how on earth these geeks could have anything to do with my work?’.</p><p>But then we start talking — first we tell them about our different projects and areas of expertise, and the conversation flows to what they’re interested in: what are the ideas they’re trying to promote? which big projects they’ve always dreamt of doing but never had the data? They tell us about all their attempts to get data from the government through FOIA requests that ended in hitting brick walls.</p><p>That’s usually the point where I take out my laptop. They seem baffled when I start typing a few SQL commands on my terminal, and utterly surprised when after two or three minutes I present them with a graph of what they were looking for. “Wow, I didn’t know it was even possible… and all of that just from data that’s out there?” they say, with a smile and a new sparkle in their eyes. And that’s when I know — a new data-journalist was born.</p><p>Every once in a while, a beautifully interactive data visualisation project is published by one of the media outlets. Everybody applauds the “innovative use of the medium” and the “fine example of data-journalism” — and I’m also impressed! — but to me this is simply forgetting all these other journalists who made that leap into the world of data.</p><p>These journalists understand that leads come not just from sources in the government, but also from algorithms analysing CSV files. They cautiously learn to link to the government data portals as proof for their claims. They take data and make it a part of their story.</p><p>These are the true heroes of the data-journalism revolution. And the motto of this revolution cannot be ‘Visualise More!’ or ‘Use Big Data!’ — it must be: ‘<strong>Data is a Source’</strong>.</p><p>Thanks to <a href="https://medium.com/u/6ca19a727498">Paul Walsh</a> for the encouragement and to <a href="https://medium.com/u/7c3fe56935da">Nir Hirshman</a> for being that awesome PR guy…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c911e743ef8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>