<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Free Your Data]]></title><description><![CDATA[Libérer les données des contraintes. Développer des solutions et produits efficaces.]]></description><link>https://blog.bolablg.com</link><image><url>https://substackcdn.com/image/fetch/$s_!lsDD!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cab9a7b-34e4-4b28-ab99-c17edb4cb225_512x512.png</url><title>Free Your Data</title><link>https://blog.bolablg.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 07 May 2026 08:25:21 GMT</lastBuildDate><atom:link href="https://blog.bolablg.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Bolaji BALOGOUN]]></copyright><language><![CDATA[fr]]></language><webMaster><![CDATA[blog@bolablg.com]]></webMaster><itunes:owner><itunes:email><![CDATA[blog@bolablg.com]]></itunes:email><itunes:name><![CDATA[Bolaji BALOGOUN]]></itunes:name></itunes:owner><itunes:author><![CDATA[Bolaji BALOGOUN]]></itunes:author><googleplay:owner><![CDATA[blog@bolablg.com]]></googleplay:owner><googleplay:email><![CDATA[blog@bolablg.com]]></googleplay:email><googleplay:author><![CDATA[Bolaji BALOGOUN]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Beyond standard Google Dataform: Smart templates to save BigQuery costs & Dev time]]></title><description><![CDATA[An extended all-in-one data modeling framework with Google Cloud Dataform]]></description><link>https://blog.bolablg.com/p/beyond-standard-google-dataform-smart</link><guid isPermaLink="false">https://blog.bolablg.com/p/beyond-standard-google-dataform-smart</guid><dc:creator><![CDATA[Bolaji BALOGOUN]]></dc:creator><pubDate>Mon, 06 Oct 2025 12:23:42 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/28ade0b6-27bf-4a25-808d-e5239bc75c03_520x350.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today&#8217;s fast-moving world of analytics engineering, the tools you choose can make or break your project, both in terms of success and cost. While <strong>dbt</strong> has gained widespread popularity, as a Google Cloud user and a<em> </em>believer in keeping a minimum providers stack, I opted for <strong>Dataform</strong>, fully integrated into the BigQuery ecosystem and generally available since 2023.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G00f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G00f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!G00f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!G00f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!G00f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G00f!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7af94734-6c48-432e-886c-51ba45f6523e_1200x600.png&quot;,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:105782,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af94734-6c48-432e-886c-51ba45f6523e_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!G00f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!G00f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!G00f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!G00f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfe46964-09d9-4432-a6c4-84f46604b349_1200x600.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>From legacy queries to Dataform models</h2><p>Between mid-2024 and early-2025 at <strong><a href="https://gozem.co/en/">GOZEM</a></strong>, my team and I migrated all our legacy scheduled queries into Dataform models. The improvements were immediate:</p><ul><li><p>Better dependency management, especially in models execution hierarchy.</p></li><li><p>More maintainable modeling patterns.</p></li><li><p>A stronger and more scalable foundation for our data transformations, with dependency integrity, CI/CD integration, and modular modeling that grows with our data volume.</p></li></ul><p>It was a major step forward, but also the beginning of new challenges.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DpNT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DpNT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 424w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 848w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 1272w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DpNT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif" width="374" height="374" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:374,&quot;width&quot;:374,&quot;resizeWidth&quot;:374,&quot;bytes&quot;:2870334,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DpNT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 424w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 848w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 1272w, https://substackcdn.com/image/fetch/$s_!DpNT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10f5c73-49e1-4f2e-b5aa-cf9c3c70995e_374x374.gif 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>The limits of the basic implementation</h2><p>Even though Dataform was a huge relief for our SQL pipelines, some pain points soon became apparent:</p><ul><li><p><strong>Full-table assertions on large datasets.</strong> Most of the time we only needed to validate recently updated or created partitions, but the built-in model assertions scan the entire table; an unnecessary cost hit.</p></li><li><p><strong>Partition-aware merges.</strong> BigQuery MERGE statements only support explicit partition filters in the ON clause. Dataform doesn&#8217;t automatically detect or fetch partitions from source data. While updatePartitionFilter reduced unnecessary scans, it couldn&#8217;t dynamically handle composed filters or subqueries due to BigQuery&#8217;s constraints.</p></li><li><p><strong>Schema evolution headaches.</strong> Before version <strong>3.0.3</strong> introduced the onSchemaChange property in early 2025, every new column in a source table had to be manually added to the target. That meant extra dev time and more room for human error.</p></li></ul><p></p><h2>The trade-offs before the light</h2><p>At that point, we survived through workarounds; long pre_operations blocks in some models, and even <strong>external Python scripts orchestrated in Airflow</strong> to prepare partition variables and handle schema quirks. They worked, but came at a cost: <strong>more development time, more complexity, </strong>and<strong> higher maintenance.</strong></p><p>Our goal was simple: <strong>solve all of this directly in Dataform, and make it automatic.</strong> </p><p>In the sections below, I&#8217;ll explain how we extended basic Dataform into an advanced framework that could:</p><ul><li><p>Reduce repetitive model code.</p></li><li><p>Cut assertion costs by scanning only updated partitions.</p></li><li><p>Handle schema changes intelligently and safely.</p></li><li><p>Remove external orchestration dependencies.</p></li></ul><p>All while staying <strong>100% native to BigQuery</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ojIB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ojIB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 424w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 848w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 1272w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ojIB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif" width="498" height="498" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:498,&quot;width&quot;:498,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1220857,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ojIB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 424w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 848w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 1272w, https://substackcdn.com/image/fetch/$s_!ojIB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa515000b-4fa7-479b-9e14-cc1c3f1be8c9_498x498.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/subscribe?&quot;,&quot;text&quot;:&quot;Abonnez-vous maintenant&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/subscribe?"><span>Abonnez-vous maintenant</span></a></p><h2>The power of Dataform templating </h2><p>We realized what we needed was <strong>full control over incremental model execution flow</strong>. Dataform&#8217;s operations models offered flexibility, but rewriting the same logic in every model wasn&#8217;t practical. So we built our own <strong>custom template</strong>, leveraging Dataform&#8217;s <strong>includes</strong> mechanism for repository-wide code reuse (functions, constants, and shared helpers).</p><p>That meant coding in JavaScript &#8212; a programming language I wasn&#8217;t fully comfortable with at first &#8212; and even rewriting parts of Dataform&#8217;s built-in logic to fit our workflow.</p><div class="pullquote"><blockquote><p><em><strong>If you know what you want, know how to debug, understand logic, and love learning while building&#8230; you can build incredible systems with (AI) coding agents</strong>.</em></p></blockquote></div><h3>Our smart incremental custom flow</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9NQO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9NQO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 424w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 848w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 1272w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9NQO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png" width="520" height="350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e7bb42f-0a7b-4d69-9f9a-3ba95bc03077_520x350.png&quot;,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:350,&quot;width&quot;:520,&quot;resizeWidth&quot;:520,&quot;bytes&quot;:31104,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e7bb42f-0a7b-4d69-9f9a-3ba95bc03077_520x350.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!9NQO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 424w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 848w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 1272w, https://substackcdn.com/image/fetch/$s_!9NQO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79064c29-4cd4-450e-85c5-5cae670ac698_520x350.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Our template follows this flow:</p><pre><code>Check if the target table exists.

1. If not, create it like a non-incremental full refresh from the model query output and stop.

2. If yes, create a staging table from the model query output.

2.1. Compare the staging columns to the target.

2.1.1. If new columns are found, alter the target to add them.

2.2. Extract distinct partition values from the staging table.

2.3. Build a merge query with the ON clause scanning only those partitions: ON staging.key = target.key <strong>AND target.partition_column IN (partition_values)</strong>.

3. Execute the merge.

4. Create assertion views filtered on those same partition values.

5. Assert the views instead of the entire table.</code></pre><p><strong>That&#8217;s it. Simple. Dynamic. Efficient.</strong></p><p>The built-in <strong>updatePartitionFilter</strong> (eg: <em>partitionColumn &gt;= xPeriod</em>) helped reduce merge costs, but it wasn&#8217;t flexible enough for our data changes. Our template dynamically identifies all updated partitions from the staging table and limits the merge to those areas only. This gives us <strong>fully refreshed data</strong> without manual runs, without external scripts, and without wasteful costs.</p><p>In addition to asserting only recently updated partitions, we have reduced more BigQuery costs and improved development speed &#8212; achieving smarter, faster, and fully native transformations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9KFO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9KFO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 424w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 848w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 1272w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9KFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif" width="454" height="640" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:454,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:418446,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9KFO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 424w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 848w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 1272w, https://substackcdn.com/image/fetch/$s_!9KFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adf3347-0e9d-496d-a80b-485b2290e3e2_454x640.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Some additional nice-to-have features</h3><h4>Smarter ON clauses</h4><p>Instead of relying on a dedicated transformed partition column, we directly integrate expressions like FUNCTION(target.partitionColumn) IN (partition_values) for greater simplicity and no additional column than needed, avoiding the target.FUNCTION error with updatePartitionFilter.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nBzv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nBzv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 424w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 848w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 1272w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nBzv!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png" width="1200" height="357.18654434250766" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/972103b1-b40a-48e9-93c8-65bdbc3af000_981x292.png&quot;,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:292,&quot;width&quot;:981,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:59584,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972103b1-b40a-48e9-93c8-65bdbc3af000_981x292.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nBzv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 424w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 848w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 1272w, https://substackcdn.com/image/fetch/$s_!nBzv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d2f40a4-a103-4fdb-9d85-ca41374f0c6a_981x292.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Template</strong> - DATE() found in partition DATE(creationDate), used in merge condition</figcaption></figure></div><h4>Advanced tables replacement</h4><p>When partition or clustering columns change, BigQuery normally requires manual drops and recreations. Our framework automatically handles these updates. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9L0C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9L0C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 424w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 848w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 1272w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9L0C!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png" width="1200" height="424.4963738920226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34ef57db-ff65-4c86-8940-dd89209928dd_1241x439.png&quot;,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:439,&quot;width&quot;:1241,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:85831,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ef57db-ff65-4c86-8940-dd89209928dd_1241x439.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9L0C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 424w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 848w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 1272w, https://substackcdn.com/image/fetch/$s_!9L0C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2ce9cf-a2e3-481e-9413-43c0aa2fa642_1241x439.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>BigQuery</strong> - Table replacement error: clusters and partitions differ</figcaption></figure></div><h4>Extended assertions</h4><p>We went beyond the built-in data quality rules (uniqueKey, nonNull) to include checks like accepted_values, relationship, freshness, row_count, and percentage. Initially defined manually via rowConditions, they are now templated for faster and cleaner development.</p><h4>Limited columns in assertions reports</h4><p>Instead of using a wildcard in the assertions views, which shows all table columns when run, we add a property to specify only the columns we want to display in the assertions (views), reducing cost by leveraging BigQuery&#8217;s column-oriented capabilities.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MgHA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MgHA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 424w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 848w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 1272w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MgHA!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png" width="1200" height="250.5091649694501" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e8986c8-b263-436e-b00b-2eccab906dfa_982x205.png&quot;,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:205,&quot;width&quot;:982,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:65730,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/174872565?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e8986c8-b263-436e-b00b-2eccab906dfa_982x205.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MgHA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 424w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 848w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 1272w, https://substackcdn.com/image/fetch/$s_!MgHA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4f0edab-48cf-4b00-af94-e443f1995e43_982x205.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Template - Assertion columns: ID, CreatedDate, plus rule_name.</figcaption></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/subscribe?&quot;,&quot;text&quot;:&quot;S'abonner&quot;,&quot;language&quot;:&quot;fr&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Free Your Data! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Tapez votre e-mail&#8230;" tabindex="-1"><input type="submit" class="button primary" value="S'abonner"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><p>We have significantly improved our SQL workflows using Dataform. With the right templates, it has everything needed to serve as a true all-in-one modeling engine within the BigQuery ecosystem. Our custom template showcased just how powerful Dataform&#8217;s operations models can be, and how much potential lies beyond the basics.</p><p><strong>If you&#8217;re already using Dataform for advanced use cases, I&#8217;d love to learn from your experience</strong>.</p><p><em>You can explore the full template on GitHub: <a href="https://github.com/bolablg/gcp-dataform-modeling-lab">github.com/bolablg/gcp-dataform-modeling-lab</a>. Although it is tailored to some specific needs now, I believe it can be extended to achieve more.</em></p>]]></content:encoded></item><item><title><![CDATA[Google Sheets + Python: créer et partager automatiquement des rapports de données]]></title><description><![CDATA[Finis les longs process manuels ! Automatise la cr&#233;ation, l'&#233;dition et le partage de tes fichiers Google Sheets avec Python (ou R)]]></description><link>https://blog.bolablg.com/p/google-sheets-python-creer-et-partager</link><guid isPermaLink="false">https://blog.bolablg.com/p/google-sheets-python-creer-et-partager</guid><dc:creator><![CDATA[Bolaji BALOGOUN]]></dc:creator><pubDate>Sat, 31 May 2025 23:29:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dknc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><strong><a href="https://docs.google.com/spreadsheets">Google Sheets</a></strong> est un tableur en ligne simple, et gratuitement accessible via un compte <strong>Gmail</strong>. Il offre l&#8217;essentiel des fonctionnalit&#233;s de <strong>Microsoft Excel</strong>, sans installation pr&#233;alable ni achat de licence d&#8217;usage, ce qui en fait un excellent outil de <strong>travail collaboratif</strong> pour de nombreuses &#233;quipes.</em></p><p><em>Mais d&#232;s qu&#8217;il s&#8217;agit d&#8217;importer des donn&#233;es depuis une source externe sans connecteur natif (comme une base de donn&#233;es produit), la t&#226;che manuelle peut vite devenir r&#233;p&#233;titive et chronophage. Dans cette note, je montre comment <strong>automatiser</strong>, avec <strong>Python</strong>, la cr&#233;ation, le remplissage, le formatage, le partage, et l&#8217;archivage d&#8217;un fichier Google Sheets. Une <strong>solution</strong> gratuite, efficace, et facile &#224; mettre en place, pour <strong>se concentrer sur ce qui compte</strong> vraiment.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/subscribe?&quot;,&quot;text&quot;:&quot;Abonnez-vous maintenant&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/subscribe?"><span>Abonnez-vous maintenant</span></a></p><p></p><h1>Mise en situation</h1><h2>R&#233;pondre &#224; un besoin m&#233;tier&#8230; sans coder une usine &#224; gaz</h2><p>Tu accompagnes une PME qui vient de lancer une campagne ponctuelle d&#8217;acquisition et d&#8217;activation de clients via des agents commerciaux sur le terrain. </p><p><em><strong>Principes d&#8217;enregistrement des donn&#233;es op&#233;rationnelles</strong>: </em></p><ul><li><p><em>Chaque nouveau compte cr&#233;&#233; chez un agent commercial est accompagn&#233; de l&#8217;identifiant unique de l&#8217;agent.</em></p></li><li><p><em>Tout premier d&#233;p&#244;t d&#8217;argent sur le compte client effectu&#233; chez un agent commercial est accompagn&#233; de l&#8217;identifiant unique de l&#8217;agent. </em></p></li></ul><p>La PME veut r&#233;mun&#233;rer les agents selon leurs performances. Le probl&#232;me ? Aucun outil interne ne permet pour le moment de calculer et payer tout &#231;a convenablement, et les d&#233;veloppeurs sont occup&#233;s sur une autre mission.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dknc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dknc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!dknc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!dknc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!dknc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dknc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png" width="728" height="485.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e05229f7-830a-4a84-98f4-08000a454430_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:1914288,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/161748107?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dknc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!dknc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!dknc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!dknc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe05229f7-830a-4a84-98f4-08000a454430_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Tu es charg&#233; de mettre en place un syst&#232;me simple: r&#233;cup&#233;rer les donn&#233;es d&#8217;activit&#233; de la base de donn&#233;es MongoDB, croiser avec les seuils de configuration, calculer les r&#233;mun&#233;rations, et g&#233;n&#233;rer deux rapports; un pour la compta (salaire par agent), un pour le service support (r&#233;capitulatif de performance par agent). Le tout doit &#234;tre fourni au quotidien, et envoy&#233; aux bonnes &#233;quipes.</p><div class="pullquote"><p>Si tu dois t&#8217;en occuper tous les jours, c&#8217;est que le probl&#232;me se pose toujours.</p></div><p><em><strong>R&#232;gles de r&#233;mun&#233;ration</strong>: </em></p><ul><li><p><em>Tout nouveau compte cr&#233;&#233; donne droit &#224; 2.99 ECO</em></p></li><li><p><em>Toute nouvelle recharge de compte donne droit &#224; 1.99 ECO</em></p></li><li><p><em>Un nouveau compte suivi d&#8217;une premi&#232;re recharge dans la m&#234;me journ&#233;e donne droit &#224; u bonus de 0.99 ECO</em></p></li></ul><h2>Approche de solution</h2><p>L&#8217;id&#233;e est simple: automatiser chaque &#233;tape du reporting, de l&#8217;extraction des donn&#233;es jusqu&#8217;&#224; l&#8217;envoi des rapports aux &#233;quipes.</p><ul><li><p><strong>Extraire les donn&#233;es</strong> de la p&#233;riode cible directement depuis la base.</p></li><li><p><strong>Nettoyer, filtrer et structurer</strong> les donn&#233;es sous forme de tableaux pr&#234;ts &#224; l&#8217;emploi.</p></li><li><p><strong>Cr&#233;er automatiquement les fichiers Google Sheets</strong> dans les bons dossiers via l&#8217;API Google Drive.</p></li><li><p><strong>Remplir et formater les fichiers</strong> avec les bonnes donn&#233;es via l&#8217;API Google Sheets.</p></li><li><p><strong>Notifier les &#233;quipes concern&#233;es par email</strong>, une fois les rapports pr&#234;ts.</p></li><li><p><strong>Automatiser l&#8217;ensemble</strong> dans un seul programme Python, ex&#233;cut&#233; de mani&#232;re planifi&#233;e (quotidienne, etc.).</p></li></ul><p></p><h1>Impl&#233;mentation de la solution</h1><h2>Quelques bonnes pratiques&#8230;</h2><ol><li><p>Se mettre d&#8217;accord avec les &#233;quipes sur:</p><ol><li><p><strong>Quand livrer les rapports</strong> (par exemple, chaque jour &#224; midi)</p></li><li><p><strong>Quels &#233;l&#233;ments doivent y figurer</strong> (colonnes, kpis, formats, filtres&#8230;)</p></li></ol></li><li><p>Stocker chaque type de rapport (paiement, performance) dans un <strong>dossier Google Drive d&#233;di&#233;</strong>, servant d&#8217;espace de partage, pour simplifier le contr&#244;le des acc&#232;s.</p></li><li><p>Adopter une <strong>convention de naming claire</strong> pour facilitera l&#8217;exploitation. (ex: {NomDeCampagne}-{TypeDeRapport}-{DateDesDonn&#233;es}). Cela suffirait &#224; &#233;viter toute confusion&#8230; mais pour renforcer la fiabilit&#233;, on pourra par exemple d&#233;placer automatiquement l&#8217;ancien rapport de paiement vers un <strong>dossier d&#8217;archives</strong>, afin d&#8217;&#233;viter les traitements double, tout en gardant un historique.</p></li><li><p><strong>Cr&#233;er une base des r&#232;gles de r&#233;mun&#233;ration</strong> afin de faciliter leurs mises &#224; jour ind&#233;pendamment du code (optionnel).</p></li><li><p><strong>Cr&#233;er une base de sauvegarde des m&#233;tadonn&#233;es des rapports g&#233;n&#233;r&#233;es</strong>. (optionnel).</p></li><li><p>Faire <strong>valider manuellement le bon fonctionnement</strong> du programme (chiffres, formats, fichiers), id&#233;alement avec un second regard, avant l&#8217;automatisation.</p></li></ol><div class="pullquote"><p>Une erreur manuelle, c&#8217;est emb&#234;tant. Une erreur automatis&#233;e, c&#8217;est une catastrophe dans la cha&#238;ne de valeur.</p></div><h2>&#201;tape 1 : Pr&#233;paration de l&#8217;environnement et configuration des APIs Google</h2><p>Pour automatiser des actions sur Google Drive et Google Sheets, votre programme doit utiliser un <strong>service account</strong> de google auquel vous attribuerez les permissions n&#233;cessaires. Si vous ne savez pas comment proc&#233;der, <strong><a href="https://blog.bolablg.com/p/google-dev-service-account">ce tutoriel</a></strong> vous guidera &#233;tape par &#233;tape.</p><pre><code>import gspread
from google.oauth2 import service_account
from googleapiclient.discovery import build

scopes = [
    'https://www.googleapis.com/auth/spreadsheets',
    'https://www.googleapis.com/auth/drive'
]

sa_credentials = service_account.Credentials.from_service_account_file(chemin/vers/ta_cle.json')

creds = sa_credentials.with_scopes(scopes)
gw_client = gspread.authorize(credentials = creds)</code></pre><h2>&#201;tape 2 : Cr&#233;ation des fonctions personnalis&#233;es</h2><h3>Fonction: G&#233;n&#233;rer automatiquement un google sheets</h3><pre><code>def create_sheet_get_id(sheet_title, folder_id, service_account_creds):
    '''
    This function will create a new google sheet file within a specific doogle drive folder.
    Args:
        sheet_title (str): The title of the new Google Sheet.( E.g. Tuto - Python x Google Sheets)
        folder_id (str): The ID of the Google Drive folder where the sheet will be created. If the link of the drive folder is https://drive.google.com/drive/folders/1a2b3c4d5e6f7g8h9i0j, then the folder_id is 1a2b3c4d5e6f7g8h9i0j.
        service_account_creds (service_account.Credentials): The service account credentials to authenticate with Google Drive API.
    '''
    drive_api = build('drive', 'v3', credentials=service_account_creds)

    # Create the new Google Sheet
    file_metadata = {'name': sheet_title, 'parents': [folder_id], 'mimeType': 'application/vnd.google-apps.spreadsheet',}
    newsheet = drive_api.files().create(body=file_metadata).execute()
    sheet_id = newsheet['id']
    
    return sheet_id</code></pre><h3>Fonction: Exporter des DataFrames vers google sheets</h3><pre><code>def fill_sheet_with_pandas_dataframes(sheet_id, data_frames_dict, service_account_creds):
    '''
    This function will fill a Google Sheet with data.
    Args:
        sheet_id (str): The ID of the Google Sheet to fill with data.
        data_frames_dict (dict): The data to fill the Google Sheet with. It should be a dictionary where keys are sheet names and values are pandas DataFrames.
        service_account_creds (service_account.Credentials): The service account credentials to authenticate with Google Sheets API.
    '''
    # Authorize the Google Sheets API
    gw_client = gspread.authorize(credentials=service_account_creds)
    workbook = gw_client.open_by_key(sheet_id)
    for sheet_name, df in data_frames_dict.items():
        if not isinstance(df, pd.DataFrame):
            raise TypeError(f"Data for sheet '{sheet_name}' must be a pandas DataFrame.")
        
        # Clear the existing content of the sheet
        try:
            worksheet = workbook.worksheet(sheet_name)
            worksheet.clear()
        except gspread.WorksheetNotFound:
            worksheet = workbook.add_worksheet(title=sheet_name, rows="100", cols="20")
        
        # Set the DataFrame to the Google Sheet
        set_with_dataframe(worksheet, df, include_index=False, include_column_header=True)
        print(f"Data for sheet '{sheet_name}' has been written to the Google Sheet.")
    
    sheet_to_delete = workbook.worksheet("Sheet1") # Delete the default sheet created by Google Sheets
    workbook.del_worksheet(sheet_to_delete)  </code></pre><h3><strong>Fonction: Partager un google sheets avec un message</strong></h3><pre><code>def share_google_sheet_with_message(sheet_id, email_list, acess, service_account_creds, message=""):
    # Authenticate with service account
    drive_service = build('drive', 'v3', credentials=service_account_creds)

    for email_to_share in email_list:
        # Create permission
        permission = {
            'type': 'user',
            'role': acess, #'reader',
            'emailAddress': email_to_share
        }

        # Share the file
        drive_service.permissions().create(
            fileId=sheet_id,
            body=permission,
            sendNotificationEmail=True,
            emailMessage=message
        ).execute()

    print(f"Google Sheet shared with {email_to_share} as {acess}.")</code></pre><h2>&#201;tape 3 : Initialisation des variables globales</h2><p>Dans cette &#233;tape, on d&#233;finit des variables cl&#233;s qu&#8217;on r&#233;utilisera tout au long du script. Cela permet d&#8217;&#233;viter les r&#233;p&#233;titions et de rendre le code plus clair et plus facile &#224; maintenir. Dans notre cas, on d&#233;finit simplement les bornes de l&#8217;intervalle de la p&#233;riode &#224; traiter. Ces dates serviront aussi &#224; nommer automatiquement les fichiers g&#233;n&#233;r&#233;s plus tard.</p><h2>Etape 4: Extraction et traitement des donn&#233;es</h2><p>Ici, tu r&#233;cup&#232;res les donn&#233;es issues de la base d&#8217;activit&#233;, puis tu les analyses pour calculer les indicateurs &#224; fournir &#224; chaque &#233;quipe.<em> </em>Dans notre application, nous exploitons les donn&#233;es d&#8217;une base-test mongodb:</p><ul><li><p><em>la table des agents commerciaux</em></p></li><li><p><em>la table des comptes clients</em></p></li><li><p><em>la table des transactions</em></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mWAE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mWAE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mWAE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg" width="1016" height="329" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:329,&quot;width&quot;:1016,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47405,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/161748107?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mWAE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mWAE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17b699d9-c8a4-45c0-a35f-89a4d1ae1cdc_1016x329.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>&#201;tape 5 : Export des rapports d&#8217;analyse et notification des &#233;quipes</h2><p>Une fois les traitements de donn&#233;es termin&#233;s, tu utilises les fonctions d&#233;finies plus haut pour les exporter vers les dossiers drive des &#233;quipes concern&#233;es. La notification, bien qu&#8217;optionnelle, permet d&#8217;envoyer automatiquement un email &#224; l&#8217;adresse de ton choix pour l&#8217;informer que les rapports sont disponibles. </p><p>Deux options sont envisageables :</p><ul><li><p>Partager le fichier avec un message personnalis&#233; (via Drive API)</p></li><li><p>Envoyer un v&#233;ritable email contenant les infos utiles (via Gmail API)</p></li></ul><p>Dans cet exemple, j&#8217;ai opt&#233; pour la premi&#232;re solution, simple et rapide &#224; mettre en place. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p85u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p85u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 424w, https://substackcdn.com/image/fetch/$s_!p85u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 848w, https://substackcdn.com/image/fetch/$s_!p85u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!p85u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p85u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png" width="1280" height="1360" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1360,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:217721,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/161748107?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p85u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 424w, https://substackcdn.com/image/fetch/$s_!p85u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 848w, https://substackcdn.com/image/fetch/$s_!p85u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!p85u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F792bc0a3-e62f-4ad6-818f-4b68c44e001e_1280x1360.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><em><strong>NB</strong>: Le notebook final de ce tutoriel est accessible dans ce <a href="https://github.com/bolablg/google-workspace-python">d&#233;p&#244;t GitHub</a>. Pour automatiser l&#8217;ex&#233;cution de votre programme, convertissez votre notebook en script .py et planifier son execution sur un serveur via cron ou un orchestrateur comme Airflow.</em></p><blockquote><p>&#9888;&#65039; <strong>DISCLAIMER </strong>&#9888;&#65039;</p><ul><li><p><em>Some parts of this article have been reformulated with <a href="https://chatgpt.com/">ChatGPT</a>.</em></p></li><li><p><em>The header image has been generated with ChatGPT.</em></p></li></ul></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/p/google-sheets-python-creer-et-partager?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Partager&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/p/google-sheets-python-creer-et-partager?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Partager</span></a></p>]]></content:encoded></item><item><title><![CDATA[Débuter avec Google Dev: crée un service account pour automatiser tes opérations]]></title><description><![CDATA[Exemple: Lire automatiquement un google sheets dans un dossier google drive]]></description><link>https://blog.bolablg.com/p/google-dev-service-account</link><guid isPermaLink="false">https://blog.bolablg.com/p/google-dev-service-account</guid><dc:creator><![CDATA[Bolaji BALOGOUN]]></dc:creator><pubDate>Thu, 29 May 2025 12:35:22 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7041c69f-cbb6-46ae-be4a-68efa8feb2f6_2048x2048.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Mise en situation</strong></h2><p>Tu veux automatiser des fichiers Google Sheets ou organiser des sauvegardes sur Google Drive avec Python ou un autre langage ? Alors tu vas avoir besoin d&#8217;un <strong>Service Account</strong>. Mais si tu ne sais m&#234;me pas ce que c&#8217;est, pas de panique: cet article t&#8217;explique tout depuis z&#233;ro.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/subscribe?&quot;,&quot;text&quot;:&quot;Abonnez-vous maintenant&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/subscribe?"><span>Abonnez-vous maintenant</span></a></p><p></p><h2><strong>C&#8217;est quoi un Service Account ?</strong></h2><p>Un <strong>Service Account</strong> est un compte sp&#233;cial cr&#233;&#233; pour une application ou un script, pas pour un humain. Il peut acc&#233;der &#224; des services Google (comme Google Sheets ou Drive) <strong>de mani&#232;re automatique et s&#233;curis&#233;e</strong>, avec les droits que <strong>tu lui donnes</strong>.</p><blockquote><p>Tu peux l&#8217;imaginer comme un robot &#224; qui tu donnes une carte d&#8217;identit&#233; et une cl&#233; pour bosser &#224; ta place dans l&#8217;environnement Google.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HAk0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HAk0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HAk0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg" width="728" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1456,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:1116798,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.bolablg.com/i/164712771?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HAk0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HAk0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19934820-968a-4c8f-be23-d317056946a0_2048x2048.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2><strong>Pr&#233;requis</strong></h2><ul><li><p>Une adresse Gmail</p></li><li><p>10 minutes de ton temps</p></li></ul><p></p><h2><strong>&#201;tape 1 : Cr&#233;er un projet Google Cloud</strong></h2><ol><li><p>Va sur <a href="https://console.cloud.google.com">https://console.cloud.google.com</a> (<em>accepte les conditions d&#8217;utilisation en cas de premi&#232;re visite avant de continuer.</em>)</p></li><li><p>Clique sur le <strong>menu de s&#233;lection de projet<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></strong> en haut &#224; gauche.</p></li><li><p>Clique sur <strong>&#8220;Nouveau projet&#8221;</strong>.</p></li><li><p>Donne-lui un nom (ex : automation-project) et clique sur <strong>&#8220;Cr&#233;er&#8221;</strong>.</p></li></ol><blockquote><p>Une fois cr&#233;&#233;, <strong>s&#233;lectionne ton projet</strong> dans la liste.</p></blockquote><p></p><h2><strong>&#201;tape 2 : Cr&#233;er un Service Account</strong></h2><ol><li><p>Dans le menu de gauche, clique sur <strong>&#8220;IAM et administration&#8221; &gt; &#8220;Comptes de service&#8221;</strong>.</p></li><li><p>Clique sur <strong>&#8220;Cr&#233;er un compte de service&#8221;</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p></li><li><p>Donne-lui un nom (ex : script-automator) et clique sur <strong>&#8220;Cr&#233;er et continuer&#8221;</strong>.</p></li><li><p>Laisse les options de r&#244;le vides ou choisis &#8220;&#201;diteur&#8221; si n&#233;cessaire, puis clique sur <strong>&#8220;Terminer&#8221;</strong>.</p></li></ol><p></p><h2><strong>&#201;tape 3 : G&#233;n&#233;rer la cl&#233; du Service Account (fichier JSON)</strong></h2><ol><li><p>Dans la liste des comptes de service, clique sur les <strong>3 points &#224; droite</strong> de celui que tu viens de cr&#233;er.</p></li><li><p>Choisis <strong>&#8220;G&#233;rer les cl&#233;s&#8221;</strong>.</p></li><li><p>Clique sur <strong>&#8220;Ajouter une cl&#233;&#8221; &gt; &#8220;Cr&#233;er une cl&#233;&#8221;</strong>.</p></li><li><p>S&#233;lectionne <strong>JSON</strong> et clique sur <strong>&#8220;Cr&#233;er&#8221; ou &#8220;OK&#8221;</strong>.</p></li><li><p>Un fichier .json va &#234;tre t&#233;l&#233;charg&#233; : <strong>garde-le bien</strong> ! Tu l&#8217;utiliseras dans ton script.</p></li></ol><blockquote><p>&#9888;&#65039; <strong>Ne partage jamais ce fichier, il donne un acc&#232;s complet &#224; ton compte.</strong></p></blockquote><p></p><h2><strong>&#201;tape 4 : Activer les API Google Sheets &amp; Drive</strong></h2><ol><li><p>Dans le menu de gauche, clique sur <strong>&#8220;API et services</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><strong>&#8221; &gt; &#8220;Biblioth&#232;que&#8221;</strong>.</p></li><li><p>Recherche <strong>&#8220;Google Sheets API&#8221;</strong>, clique dessus, puis clique sur <strong>&#8220;Activer&#8221;</strong>.</p></li><li><p>Refais la m&#234;me chose avec <strong>&#8220;Google Drive API&#8221;</strong>.</p></li></ol><p></p><h2><strong>&#201;tape 5 : Donner acc&#232;s &#224; un dossier Drive au Service Account</strong></h2><ol><li><p>Ouvre ton fichier JSON, cherche la ligne "client_email" : elle contient une adresse email comme mon-compte@mon-projet.iam.gserviceaccount.com.</p></li><li><p>Va sur Google Drive, cr&#233;e un dossier (ou utilise un existant).</p></li><li><p>Clique droit dessus &gt; <strong>&#8220;Partager&#8221;</strong>.</p></li><li><p>Ajoute l&#8217;email du Service Account avec le r&#244;le <strong>&#8220;&#201;diteur&#8221;</strong>.</p></li></ol><blockquote><p>Maintenant, ton robot (Service Account) peut lire, &#233;crire et modifier dans ce dossier.</p></blockquote><p></p><h2><strong>&#201;tape 6 : Exemple d&#8217;utilisation en Python</strong></h2><p>Voici comment utiliser ton Service Account pour acc&#233;der &#224; un fichier Google Sheet<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> :</p><pre><code><code>import gspread
from google.oauth2 import service_account

scopes = [
    'https://www.googleapis.com/auth/spreadsheets',
    'https://www.googleapis.com/auth/drive'
]

sa_credentials = service_account.Credentials.from_service_account_file(chemin/vers/ta_cle.json')

creds = sa_credentials.with_scopes(scopes)
gw_client = gspread.authorize(credentials = creds)

workbook = gw_client.open("Tuto - Python x Google Sheets")
sheet1 = workbook.sheet1
print(sheet.get_all_records())</code></code></pre><p><strong>NB</strong>: <em>Si ton dossier Drive contient plusieurs fichiers ayant le m&#234;me nom, il est pr&#233;f&#233;rable d'ouvrir le fichier voulu avec gspread</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><em> en utilisant directement son lien ou son ID.</em></p><pre><code><code>sheet_by_link = gw_client.open_by_url("https://docs.google.com/spreadsheets/d/15vnGxZzLHR1LwulS-bfIg82wOwanjWm-jr9OC40BiM0").sheet1

sheet_by_key = gw_client.open_by_key("15vnGxZzLHR1LwulS-bfIg82wOwanjWm-jr9OC40BiM0").worksheet("new_sheet")</code></code></pre><blockquote><p>&#9888;&#65039; <strong>DISCLAIMER </strong>&#9888;&#65039; </p><ul><li><p><em>Some parts of this article have been generated with <a href="https://chatgpt.com/">ChatGPT</a>.</em></p></li><li><p><em>The header image has been generated with <a href="https://gemini.google.com/">Gemini</a>.</em></p></li></ul></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/p/google-dev-service-account?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Partager&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/p/google-dev-service-account?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Partager</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects">https://cloud.google.com/resource-manager/docs/creating-managing-projects</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><em><a href="https://cloud.google.com/iam/docs/creating-managing-service-accounts">https://cloud.google.com/iam/docs/creating-managing-service-accounts</a></em></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><em><a href="https://cloud.google.com/apis/docs/enable-disable-apis">https://cloud.google.com/apis/docs/enable-disable-apis</a></em> </p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><em>Ton fichier Google Sheet doit aussi &#234;tre partag&#233; avec le Service Account</em></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p><a href="https://docs.gspread.org/en/latest/user-guide.html">https://docs.gspread.org/en/latest/user-guide.html</a></p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Où trouver des données pour une étude nationale ?]]></title><description><![CDATA[Des pistes de r&#233;pertoires de donn&#233;es pour une &#233;tude &#224; &#233;chelle nationale: exemple de la R&#233;publique du B&#233;nin.]]></description><link>https://blog.bolablg.com/p/source-de-donnees-etude-nationale-exemple-benin</link><guid isPermaLink="false">https://blog.bolablg.com/p/source-de-donnees-etude-nationale-exemple-benin</guid><dc:creator><![CDATA[Bolaji BALOGOUN]]></dc:creator><pubDate>Sat, 06 Nov 2021 12:55:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Acc&#233;der &#224; des donn&#233;es de qualit&#233; est une &#233;tape aussi cruciale que la circonscription du probl&#232;me &#224; r&#233;soudre ou du ph&#233;nom&#232;ne &#224; expliquer. Pendant que des organisations disposant de ressources puisent facilement dans leurs bases ou financent des collectes de donn&#233;es &#224; grande &#233;chelle, l&#8217;exercice peut s&#8217;av&#233;rer compliqu&#233; pour les &#233;tudiants et jeunes chercheurs souvent limit&#233;s par leurs moyens.<br>A l&#8217;&#232;re o&#249; les efforts d&#8217;ouverture des donn&#233;es d&#8217;int&#233;r&#234;t g&#233;n&#233;ral ne cessent de se multiplier pour renforcer la transparence et la recherche dans des domaines vari&#233;s comme les sciences sociales, o&#249; trouver cette denr&#233;e essentielle &#224; tout projet d&#8217;analyse? Librement accessibles ou sous certaines conditions, ces donn&#233;es proviennent principalement de trois grandes cat&#233;gories:</p><ul><li><p>l&#8217;Etat (gouvernement, administrations publiques&#8230;)</p></li><li><p>les institutions priv&#233;es ind&#233;pendantes,</p></li><li><p>les organisations r&#233;gionales ou internationales.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/subscribe?&quot;,&quot;text&quot;:&quot;Abonnez-vous maintenant&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/subscribe?"><span>Abonnez-vous maintenant</span></a></p><p></p><h2><strong>Les r&#233;pertoires de donn&#233;es de l&#8217;Etat b&#233;ninois </strong></h2><p>L&#8217;INStaD* (ex INSAE*) est l&#8217;organisme national de r&#233;f&#233;rence en terme de donn&#233;e officielle en R&#233;publique du B&#233;nin. Son Directeur G&#233;n&#233;ral, qui est aussi le Secr&#233;taire du CNS*, a l&#8217;autorit&#233; de valider les enqu&#234;tes et recensements dans le pays, d&#233;livrant  un Visa statistique, garant de leur officialit&#233; sur le territoire national. L'INStaD diffuse r&#233;guli&#232;rement des donn&#233;es nationales et valid&#233;es sur ses sites web. Sur son <a href="https://instad.bj">site principal</a>, elle offre un acc&#232;s &#224; une multitude de statistiques et d'indicateurs actualis&#233;s, des r&#233;sultats d&#8217;enqu&#234;tes et des chiffres de recensements, diffus&#233;s suivant un calendrier pr&#233;&#233;tabli chaque d&#233;but d'ann&#233;e (exemple: le <a href="https://instad.bj/images/docs/Actualit%C3%A9s/Calendrier_de_diffusion_des_publications_INSAE-2021.pdf">calendrier de 2021</a>). L&#8217;INStaD partage aussi des informations valid&#233;es sur les plateformes ci-apr&#232;s:</p><h3><strong>NADA</strong></h3><p>La <strong><a href="http://nada.insae-bj.org/index.php/note-information">National Data Archive</a></strong> est un portail web con&#231;u faciliter l&#8217;acc&#232;s &#224; un vaste catalogue de donn&#233;es, en vue de permettre leur r&#233;-exploitation pour de nouveaux traitements scientifiques. Elle est pratique pour explorer, rechercher, comparer et t&#233;l&#233;charger des donn&#233;es issues de recensements ou d'enqu&#234;tes diverses. Vous y trouverez des micro et de m&#233;tadonn&#233;es soigneusement document&#233;es, avec la possibilit&#233; de contacter l'INStaD pour obtenir des d&#233;tails suppl&#233;mentaires.</p><h3>Benin Data Portal</h3><p>Il s&#8217;agit du <strong><a href="https://benin.opendataforafrica.org/">portail officiel des donn&#233;es ouvertes du B&#233;nin</a></strong>. Il offre un acc&#232;s direct aux informations class&#233;es et organis&#233;es provenant de diverses institutions nationales comme l'<a href="https://nso-benin.opendataforafrica.org">INStaD</a> et le <a href="https://finances.bj">Minist&#232;re de l&#8217;&#201;conomie et des Finances</a>. Benin Data Portal facilite l'acc&#232;s et am&#233;liore la gestion des donn&#233;es pour tous les utilisateurs. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Soye!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Soye!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 424w, https://substackcdn.com/image/fetch/$s_!Soye!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 848w, https://substackcdn.com/image/fetch/$s_!Soye!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 1272w, https://substackcdn.com/image/fetch/$s_!Soye!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Soye!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:400134,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Soye!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 424w, https://substackcdn.com/image/fetch/$s_!Soye!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 848w, https://substackcdn.com/image/fetch/$s_!Soye!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 1272w, https://substackcdn.com/image/fetch/$s_!Soye!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f655d5b-f480-4e2e-b151-60bc507dc0b1_1934x1258.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Accueil du portail des donn&#233;es ouvertes de la R&#233;publique du B&#233;nin</figcaption></figure></div><p>Il est possible de visualiser et de t&#233;l&#233;charger les donn&#233;es publi&#233;es sur ces plateformes. Cependant, le t&#233;l&#233;chargement des donn&#233;es sous licence n&#233;cessite une identification de l&#8217;usager (cr&#233;er un compte, se connecter). Pour en savoir plus sur les mentions l&#233;gales et cr&#233;dit appliqu&#233;s par l&#8217;INStaD, visiter cette <a href="https://instad.bj/mentions-legales-et-credits">page</a>.</p><h3>Etat des lieux de l&#8217;ouverture des donn&#233;es au B&#233;nin</h3><p>En 2020, dans son inventaire des donn&#233;es ouvertes, <strong><a href="https://opendatawatch.com">Open Data Watch</a></strong> a class&#233; le B&#233;nin 83&#232;me sur 187 dans le monde. Avec un score global de 52/100, une combinaison de 44 pour la couverture et 60 pour l'ouverture, le B&#233;nin a r&#233;ussi &#224; se hisser l&#233;g&#232;rement au dessus de la moyenne.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UhOl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UhOl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 424w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 848w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 1272w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UhOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png" width="1456" height="587" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:587,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:139915,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UhOl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 424w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 848w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 1272w, https://substackcdn.com/image/fetch/$s_!UhOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F876cb7f3-0058-4c3a-9047-ecded23471f3_1668x672.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">&#169; Open Data Inventory</figcaption></figure></div><p>La couverture est not&#233;e sur la base de la disponibilit&#233; des indicateurs publi&#233;s, sur le nombre d'observations disponibles au cours des dix derni&#232;res ann&#233;es et sur l'existence de donn&#233;es nationales et territoriales.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FDRq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FDRq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 424w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 848w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 1272w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FDRq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png" width="888" height="950" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6e65def-6228-4177-b386-cac89b4a0e32_888x950.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:950,&quot;width&quot;:888,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48867,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FDRq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 424w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 848w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 1272w, https://substackcdn.com/image/fetch/$s_!FDRq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6e65def-6228-4177-b386-cac89b4a0e32_888x950.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Notation des cat&#233;gories de la couverture des donn&#233;es. &#169; Open Data Inventory</figcaption></figure></div><p>Quant aux scores d'ouverture, ils sont bas&#233;s sur le format et les licences des ensembles de donn&#233;es, l'exhaustivit&#233; des m&#233;tadonn&#233;es et les options de t&#233;l&#233;chargement existantes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mI8c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mI8c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 424w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 848w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 1272w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mI8c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png" width="888" height="950" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:950,&quot;width&quot;:888,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47925,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mI8c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 424w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 848w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 1272w, https://substackcdn.com/image/fetch/$s_!mI8c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F045afb9c-8602-47e4-9ab1-8b6d9977a4ab_888x950.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Notation des cat&#233;gories de l&#8217;ouverture des donn&#233;es. &#169; Open Data Inventory</figcaption></figure></div><p>Pour en savoir plus sur la maturit&#233; du B&#233;nin en terme d&#8217;ouverture de donn&#233;es, vous pouvez consulter le <a href="https://odin.opendatawatch.com/Report/countryProfileUpdated/BEN?year=2020">portail ODIN</a> (Open Data Inventory) de Open Data Watch.</p><p></p><h2><strong>Les sources des organisations priv&#233;es: Cas des donn&#233;es d&#8217;enqu&#234;te d&#8217;Afrobarom&#232;tre</strong></h2><p>Plusieurs institutions priv&#233;es de recherche produisent des donn&#233;es sur diff&#233;rents pays. Parmi celles-ci, Afrobarom&#232;tre se distingue en menant des enqu&#234;tes de terrain et en publiant r&#233;guli&#232;rement ses analyses. En plus de diffuser les <a href="https://www.afrobarometer.org/data/merged-data">r&#233;sultats sous plusieurs formes</a>, Afrobarom&#232;tre offre &#233;galement un acc&#232;s public aux donn&#233;es brutes de ses enqu&#234;tes. Cette initiative est particuli&#232;rement utile pour les &#233;tudiants et chercheurs qui souhaitent explorer des variables sp&#233;cifiques et adopter leurs propres perspectives d'analyse. Le B&#233;nin est l'un des <a href="https://www.afrobarometer.org/countries">nombreux pays</a> o&#249; Afrobarom&#232;tre op&#232;re.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!anGs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!anGs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 424w, https://substackcdn.com/image/fetch/$s_!anGs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 848w, https://substackcdn.com/image/fetch/$s_!anGs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 1272w, https://substackcdn.com/image/fetch/$s_!anGs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!anGs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png" width="1119" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1119,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Acceuil Afrobarom&#232;tre&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Acceuil Afrobarom&#232;tre" title="Acceuil Afrobarom&#232;tre" srcset="https://substackcdn.com/image/fetch/$s_!anGs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 424w, https://substackcdn.com/image/fetch/$s_!anGs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 848w, https://substackcdn.com/image/fetch/$s_!anGs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 1272w, https://substackcdn.com/image/fetch/$s_!anGs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2920c61f-8675-45fa-bedd-7bebbf23e4b2_1119x573.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://www.afrobarometer.org/countries/benin">Les donn&#233;es du B&#233;nin</a> sont accessibles sur le site internet d&#8217;Afrobarom&#232;tre&nbsp;o&#249; une page est &#233;galement d&#233;di&#233;e aux <a href="https://www.afrobarometer.org/data/data-usage-and-access-policy">conditions d&#8217;usage</a> desdites donn&#233;es.</p><p></p><h2><strong>Les banques de donn&#233;es internationales: cas des organisations r&#233;gionales ou mondiales</strong></h2><p>Les organisations internationales telles que les Nations Unies, la Banque Mondiale, la GIZ, etc&#8230; sont connues pour financer des enqu&#234;tes pour recueillir des donn&#233;es dans diff&#233;rents pays. Elles produisent des donn&#233;es sur leurs pays membre ou les pays o&#249; elles ont des repr&#233;sentations. Ci-dessous, quelques exemples de banques de donn&#233;es internationales o&#249; vous trouverez des donn&#233;es sur le B&#233;nin (ou autre pays), de la donn&#233;e parfois indisponible m&#234;me sur les plateformes de statistiques nationales.</p><h3><strong>World Bank Data</strong></h3><p>Il s&#8217;agit d&#8217;un important <a href="https://data.worldbank.org/country/benin">catalogue de donn&#233;es ouvertes de la Banque mondiale</a>, l&#8217;un des plus grands au monde. Pour t&#233;l&#233;charger les donn&#233;es compl&#232;tes (brutes) li&#233;es aux indicateurs pays qu&#8217;on y trouve, les utilisateurs doivent cr&#233;er un compte sur la <a href="https://microdata.worldbank.org">plateforme des microdonn&#233;es</a> de la banque mondiale et fournir un motif d'utilisation, souvent sous la forme d'une br&#232;ve description de leur projet de recherche. Cette plateforme permet d'acc&#233;der gratuitement aux donn&#233;es de la Banque mondiale, ainsi que celles provenant d'autres organisations internationales, agences statistiques et divers acteurs. Elle inclut des donn&#233;es issues d'enqu&#234;tes r&#233;alis&#233;es pour des &#233;valuations d'impact et des recherches en d&#233;veloppement, ainsi que des donn&#233;es administratives.</p><h3>DHS Data</h3><p>Le gouvernement am&#233;ricain &#224; travers l&#8217;USAID se consacre aux <a href="https://dhsprogram.com/Data">enjeux d&#233;mographiques et de sant&#233;</a> &#224; travers le monde, en finan&#231;ant des enqu&#234;tes pour mieux comprendre ces questions. Parmi celles-ci, les enqu&#234;tes d&#233;mographiques et de sant&#233; (EDS), men&#233;es par l'INStaD au B&#233;nin, fournissent des donn&#233;es pr&#233;cieuses. Pour y acc&#233;der, il est n&#233;cessaire de cr&#233;er un compte et de pr&#233;senter un projet de recherche.</p><h3>ILOstat</h3><p>L'Organisation internationale du travail fournit des <a href="https://webapps.ilo.org/surveyLib/index.php/home">donn&#233;es importantes</a> sur des sujets comme l'emploi, les niveaux de revenu et le seuil de pauvret&#233; dans son catalogue. Son <a href="https://webapps.ilo.org/surveyLib/api-documentation/catalog/index.html">RestAPI NADA</a> permet de programmatiquement rechercher, de parcourir et de visualiser son catalogue de m&#233;tadonn&#233;es. </p><h3>UNdata</h3><p>Le <a href="http://data.un.org">r&#233;pertoire des donn&#233;es des Nations Unies</a> donne acc&#232;s &#224; un large &#233;ventail de statistiques touchant &#224; des sujets d&#8217;int&#233;r&#234;t g&#233;n&#233;ral. G&#233;n&#233;ralement, aucune identification ni justification n&#8217;est requise pour explorer ou t&#233;l&#233;charger les donn&#233;es de ce catalogue.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K4vK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K4vK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 424w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 848w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 1272w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K4vK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png" width="1456" height="1318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1318,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:737535,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K4vK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 424w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 848w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 1272w, https://substackcdn.com/image/fetch/$s_!K4vK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeb29dc-900d-4cb2-b069-c499355bffe6_1774x1606.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>La liste des sources de donn&#233;es mentionn&#233;es dans cet article est non exhaustive. Pour trouver des informations d&#8217;un domaine sp&#233;cifique, il est recommand&#233; de consulter les sites web d'organisations ou d'institutions sp&#233;cialis&#233;es reconnues dans le domaine. Ainsi, par exemple, la <strong><a href="https://www.who.int/data/collections">World Health Organization Data Collections</a></strong> s&#8217;av&#232;re la mieux indiqu&#233;e pour des donn&#233;es de sant&#233;, et l&#8217;on devrait commencer toute recherche de donn&#233;es sur les r&#233;fugi&#233;s par la <strong><a href="https://microdata.unhcr.org">UN Refugee Agency Microdata Library</a>.</strong> </p><p>Internet offre un acc&#232;s facile &#224; une vaste gamme de donn&#233;es, toutes &#224; port&#233;e de clic. Toutefois, il est crucial de lire attentivement les conditions d'utilisation avant de t&#233;l&#233;charger des donn&#233;es afin d'&#233;viter toute utilisation non autoris&#233;e.</p><p></p><p>_</p><p>INStaD: Institut National de la Statistique et de la D&#233;mographie</p><p>INSAE: Institut National de la Statistique et de l&#8217;Analyse Economique</p><p><a href="https://insae.bj/images/docs/cns/charte-africaine-statistique/Plaquette_loi_statistique.pdf">CNS</a>: Conseil National de la Statistique</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.bolablg.com/p/source-de-donnees-etude-nationale-exemple-benin?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Partager&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.bolablg.com/p/source-de-donnees-etude-nationale-exemple-benin?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Partager</span></a></p>]]></content:encoded></item></channel></rss>