A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 16KB

  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Datasette: A Developer, a Shower and a Data-Inspired Moment (archive) — David Larlet</title>
  13. <!-- That good ol' feed, subscribe :). -->
  14. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  15. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  16. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  17. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  18. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  19. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  20. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  21. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  22. <meta name="msapplication-TileColor" content="#f0f0ea">
  23. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  24. <meta name="theme-color" content="#f0f0ea">
  25. <!-- Documented, feel free to shoot an email. -->
  26. <link rel="stylesheet" href="/static/david/css/style_2020-06-19.css">
  27. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  28. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  29. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  32. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <script type="text/javascript">
  35. function toggleTheme(themeName) {
  36. document.documentElement.classList.toggle(
  37. 'forced-dark',
  38. themeName === 'dark'
  39. )
  40. document.documentElement.classList.toggle(
  41. 'forced-light',
  42. themeName === 'light'
  43. )
  44. }
  45. const selectedTheme = localStorage.getItem('theme')
  46. if (selectedTheme !== 'undefined') {
  47. toggleTheme(selectedTheme)
  48. }
  49. </script>
  50. <meta name="robots" content="noindex, nofollow">
  51. <meta content="origin-when-cross-origin" name="referrer">
  52. <!-- Canonical URL for SEO purposes -->
  53. <link rel="canonical" href="https://thenewstack.io/datasette-a-developer-a-shower-and-a-data-inspired-moment/">
  54. <body class="remarkdown h1-underline h2-underline h3-underline hr-center ul-star pre-tick">
  55. <article>
  56. <h1>Datasette: A Developer, a Shower and a Data-Inspired Moment</h1>
  57. <nav>
  58. <p class="center">
  59. <a href="/david/" title="Aller à l’accueil" tabindex="1">🏠</a>
  60. </p>
  61. </nav>
  62. <hr>
  63. <h2><a href="https://thenewstack.io/datasette-a-developer-a-shower-and-a-data-inspired-moment/">Source originale du contenu</a></h2>
  64. <p>We tend to think of open source as a community, even as an altruistic endeavor. But sometimes a project can be “aggressively open source,” as <a href="https://datasette.readthedocs.io/en/stable/" class="ext-link" rel="external ">Datasette</a> founder <a href="https://twitter.com/simonw" class="ext-link" rel="external ">Simon Willison</a> puts it, for a bunch of “very selfish reasons.” Willison has written a great deal of open source (e.g., co-creator of <a href="https://www.djangoproject.com/" class="ext-link" rel="external ">Django</a>) and proprietary (e.g., co-founder of <a href="https://en.wikipedia.org/wiki/Lanyrd" class="ext-link" rel="external ">Lanyrd</a>) software in his career, but says he turns to open source as a “creative outlet” that lets him retain a measure of independence, even as full-time employment may constrain it.</p>
  65. <p>You heard that right: Open source doesn’t always need to save the world. It’s enough if it saves an individual developer’s sanity.</p>
  66. <p>Of course, many others do benefit from Willison’s open source contributions. But even if they didn’t, Willison would continue to open source his code. Why? Because it pushes him to write better software even as it helps him keep current with the wide variety of projects — <a href="https://github.com/simonw" class="ext-link" rel="external ">285 repositories and counting </a>— to which he contributes. It’s an incredibly <a href="https://twitter.com/simonw/status/1259180306038308865" class="ext-link" rel="external ">efficient</a> way to build. Willison says that something he enjoys about open source is that for every problem he solves, he’ll never have to solve it again. “The code will be out there forever,” he says.</p>
  67. <p>Indeed, Willison’s approach to open source offers deep insights into how to set up a project for maximum community benefit — even when it’s a community of one.</p>
  68. <h2>Of Showers and Steam</h2>
  69. <p>As Willison explained in an interview, his need for Datasette, a tool for exploring and publishing data, was clear to him in 2009 while working at The Guardian, a UK newspaper. There he helped start <a href="https://www.theguardian.com/news/datablog+technology/data-visualisation" class="ext-link" rel="external ">the data blog</a>, a place to publish the data behind The Guardian’s stories. Though Willison ended up using Google Sheets as a way to publish the underlying static data sets, he longed for a better way to publish and query that data.</p>
  70. <p>Years later, he had his Datasette “shower moment.”</p>
  71. <p>“It was literally a moment and I was literally in the shower,” he says.</p>
  72. <p>First, he reasoned, cloud providers were making hosting dynamic code cheap and easy. Second, he could insert <a href="https://www.sqlite.org/index.html" class="ext-link" rel="external ">SQLite</a>, a widely used, public domain, relational database, into places normally uninhabited by databases.</p>
  73. <p>“If I get SQLite, then export the data, and I bundle it in with a Docker container with a little app that can give you an interface and stuff … Maybe that’s a really interesting space to be exploring,” he says.</p>
  74. <p>And it was. Datasette was born.</p>
  75. <p>But Datasette wasn’t merely a matter of tackling a technical problem. It was also a way for Willison to express himself and to maintain independence. Throughout his career, Willison had found himself within larger organizations. Such employment brings privilege, but it also imposes a restraint on a developer’s ability to build. He says part of his reason for starting Datasette was to have a creative outlet.</p>
  76. <p>“It was an opportunity for me to get really deep into technology again,” he explains. “I wanted a project where I got to decide what to build and have that as my own personal place. It was almost a way of blowing off steam.”</p>
  77. <h2>Open Source Maintenance Group with a Population of One</h2>
  78. <p>Today Datasette has roughly 30 contributors, but most of the work is done by Willison. He’s OK with that. In fact, it’s great, he says, because outside contributions aren’t an unalloyed good.</p>
  79. <p>“There’s a dream that you wake up one morning and there’s a beautiful, shining pull request with a new feature, but actually, if that happens, it’s kind of stressful,” Willison says. “Because you then have to go through the code and review it to make sure it fits the wider model of what you’re trying to build.”</p>
  80. <p>One alternative, he says, is a plug-in architecture, which he incorporated into Datasette almost from the start.</p>
  81. <p>“The beautiful thing about plugins is that I don’t have to give anyone permission to load your plugin, and they don’t even have to talk to me,” Willison explains. He says he could wake up one morning, and Datasette will have a brand new feature, without him doing anything. “And it doesn’t cause any harm to the core if it’s low quality or if it doesn’t quite work,” he says.</p>
  82. <p>Not only does this plug-in architecture protect the Datasette core from <em>others’</em> bad code, but it also protects the core from <em>Willison’s</em> bad code. “I have a lot of crazy ideas, and I don’t want to put those into the core because maybe they’re terrible ideas, but there’s no harm at all in me putting them into a plugin,” he says.</p>
  83. <p>The dream is to become a bit like WordPress, whose plug-in architecture he modeled for Datasette. “WordPress is a very decent CMS with 7,000 plugins that mean it can do anything. I want Datasette to be a ‘decent sort of engine’ for data analysis and exploration with 7,000 plugins that mean that if you want a map or chart or all of these different things, it’s all available to you,” Willison says.</p>
  84. <h2>Open Source for ‘Very Selfish Reasons’</h2>
  85. <p>If Willison’s plug-in approach protects himself and others from bad code, his embrace of open source is perhaps the best way he’s found to ensure he writes good code in the first place.</p>
  86. <p>“Datasette is aggressively open source for a bunch of reasons,” Willison says. “Most of them are very selfish reasons.”</p>
  87. <p>For starters, he explains, he’s written a lot of closed source in his career, including while at Lanyrd, which he and his co-founder/wife Natalie Downe <a href="https://blog.natbat.net/post/61658401806/lanyrd-from-idea-to-exit-the-story-of-our" class="ext-link" rel="external ">sold to Eventbrite</a>. Once you leave that employer, however, you don’t get to use that software again in the future, Willison says.</p>
  88. <p>He points out that even if you’re writing software on your own and not for your employer, if it’s not open source you don’t really build it with a mind to having other people use it, which means it can go stale. When working in the open, by contrast, Willison says, “It forces me to write good code. It forces me to write really good documentation.” Not to mention great unit tests.</p>
  89. <p>That documentation, including associated comments, helps to tell the story of his code. While that may prove useful for outside contributors, docs also helps Willison to pick up where he leaves off. Willison maintains 73 open source projects, and he says the only way you can maintain 73 projects is if you treat every single one of them as if you’re not a core maintainer. Each must have a ReadMe and tests and detailed issue threads discussing what he was working on. “Because then you can drop back into them after a six-month gap and be productive with them,” he says.</p>
  90. <p>“I’m an open source maintenance group with a population of one,” Willison says. “I’m taking the lessons I learned [at Eventbrite], a 600-engineer organization, and applying them to a one-engineer organization.”</p>
  91. <p>A moment of truth now looms for Willison. For the past year, he’s been a <a href="https://jsk.stanford.edu/" class="ext-link" rel="external ">John S. Knight Journalism Fellow</a> at Stanford University, getting paid to tinker with his Datasette dream. His current thought is to do freelance development using Datasette to solve interesting problems related to data journalism for a variety of organizations, which he says could be a great way to figure out what the software should do.</p>
  92. <p>Are you interested in helping Willison shape the future of data journalism? Visit the <a href="https://datasette.readthedocs.io/en/stable/" class="ext-link" rel="external ">Datasette page</a> to contribute code, thoughts, documentation, and more.</p>
  93. </article>
  94. <hr>
  95. <footer>
  96. <p>
  97. <a href="/david/" title="Aller à l’accueil">🏠</a> •
  98. <a href="/david/log/" title="Accès au flux RSS">🤖</a> •
  99. <a href="http://larlet.com" title="Go to my English profile" data-instant>🇨🇦</a> •
  100. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">📮</a> •
  101. <abbr title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340">🧚</abbr>
  102. </p>
  103. <template id="theme-selector">
  104. <form>
  105. <fieldset>
  106. <legend>Thème</legend>
  107. <label>
  108. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  109. </label>
  110. <label>
  111. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  112. </label>
  113. <label>
  114. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  115. </label>
  116. </fieldset>
  117. </form>
  118. </template>
  119. </footer>
  120. <script src="/static/david/js/instantpage-3.0.0.min.js" type="module" defer></script>
  121. <script type="text/javascript">
  122. function loadThemeForm(templateName) {
  123. const themeSelectorTemplate = document.querySelector(templateName)
  124. const form = themeSelectorTemplate.content.firstElementChild
  125. themeSelectorTemplate.replaceWith(form)
  126. form.addEventListener('change', (e) => {
  127. const chosenColorScheme = e.target.value
  128. localStorage.setItem('theme', chosenColorScheme)
  129. toggleTheme(chosenColorScheme)
  130. })
  131. const selectedTheme = localStorage.getItem('theme')
  132. if (selectedTheme !== 'undefined') {
  133. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  134. toggleTheme(selectedTheme)
  135. }
  136. }
  137. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  138. window.addEventListener('load', () => {
  139. let hasDarkRules = false
  140. for (const styleSheet of Array.from(document.styleSheets)) {
  141. let mediaRules = []
  142. for (const cssRule of styleSheet.cssRules) {
  143. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  144. continue
  145. }
  146. // WARNING: Safari does not have/supports `conditionText`.
  147. if (cssRule.conditionText) {
  148. if (cssRule.conditionText !== prefersColorSchemeDark) {
  149. continue
  150. }
  151. } else {
  152. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  153. continue
  154. }
  155. }
  156. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  157. }
  158. // WARNING: do not try to insert a Rule to a styleSheet you are
  159. // currently iterating on, otherwise the browser will be stuck
  160. // in a infinite loop…
  161. for (const mediaRule of mediaRules) {
  162. styleSheet.insertRule(mediaRule.cssText)
  163. hasDarkRules = true
  164. }
  165. }
  166. if (hasDarkRules) {
  167. loadThemeForm('#theme-selector')
  168. }
  169. })
  170. </script>
  171. </body>
  172. </html>