<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on Datengraben</title>
    <link>https://datengraben.com/tags/python/</link>
    <description>Recent content in Python on Datengraben</description>
    <generator>Hugoo -- gohugo.io</generator>
    <language>de-DE</language>
    <lastBuildDate>Fri, 21 Jun 2024 16:29:34 +0200</lastBuildDate><atom:link href="https://datengraben.com/tags/python/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>IPython can query or export command statement history</title>
      <link>https://datengraben.com/til/tools/ipython-history/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      
      <guid>https://datengraben.com/til/tools/ipython-history/</guid>
      <description>&lt;p&gt;Today i learned that you can use the &amp;ldquo;magic&amp;rdquo; &lt;code&gt;%history&lt;/code&gt; command in &lt;a href=&#34;https://ipython.org/ipython-doc/2/api/generated/IPython.core.magics.history.html&#34;&gt;IPython&lt;/a&gt; to query the command history of the active session but also all the recorded past sessions.&lt;/p&gt;
&lt;p&gt;For example you can go like &lt;code&gt;%history 999/1-500 -f /tmp/outfile&lt;/code&gt; to write the lines 1 to 500 of the recorded session 999 to the file at tmp directory.&lt;/p&gt;
&lt;p&gt;There are other ways of retrieving the history, but this seems the most elegant to me.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Extract Arcgis Geodatabase format with Python</title>
      <link>https://datengraben.com/notes/extract-arcgis-geodatabase/</link>
      <pubDate>Fri, 21 Jun 2024 16:29:34 +0200</pubDate>
      
      
      <guid>https://datengraben.com/notes/extract-arcgis-geodatabase/</guid>
      <description>&lt;p&gt;If you want to know how to extract the individual layers programmatically from a &lt;a href=&#34;&#34;&gt;GeoDatabase&lt;/a&gt;-&lt;a href=&#34;&#34;&gt;ArcGIS&lt;/a&gt; archive, then this is for you.&lt;/p&gt;
&lt;p&gt;Geo data is often times provided in &lt;a href=&#34;&#34;&gt;Geodatabase&lt;/a&gt; format. This format provides a container for several layers of data, which then can be rendered using software like &lt;a href=&#34;&#34;&gt;ArcGIS&lt;/a&gt; or &lt;a href=&#34;&#34;&gt;QGIS&lt;/a&gt;, which have already plugins to process this file format. But if you work on a lower level, you maybe need to process these files in their format programmatically.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>In-memory reading of GML-format data with geopandas</title>
      <link>https://datengraben.com/til/geopandas-inmemory-gml-format/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      
      <guid>https://datengraben.com/til/geopandas-inmemory-gml-format/</guid>
      <description>&lt;p&gt;Today I learned another way of parsing geo data formats in-memory, using &lt;a href=&#34;&#34;&gt;geopandas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As part of a running django web service, I wanted to request and parse a &lt;a href=&#34;https://www.ogc.org/standard/wfs/&#34;&gt;WFS&lt;/a&gt; respose, which comes back in &lt;a href=&#34;https://en.wikipedia.org/wiki/Geography_Markup_Language&#34;&gt;GML&lt;/a&gt; format.&lt;/p&gt;
&lt;p&gt;The solution to this is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gpd&lt;span style=&#34;color:#666&#34;&gt;.&lt;/span&gt;GeoDataFrame&lt;span style=&#34;color:#666&#34;&gt;.&lt;/span&gt;from_features(fiona&lt;span style=&#34;color:#666&#34;&gt;.&lt;/span&gt;BytesCollection(bytes_str))
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This was pointed out by &lt;a href=&#34;https://gis.stackexchange.com/a/416126/243170&#34;&gt;sal in this stackoverflow answer&lt;/a&gt;. Since I could not find it in the documentation, either in fiona and not in &lt;a href=&#34;https://geopandas.org/en/stable/docs/user_guide/io.html&#34;&gt;geopandas&lt;/a&gt;.
I want to try now to add this there.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Mit git-history und Github Actions einen Scraper bauen</title>
      <link>https://datengraben.com/posts/2021-12-12-git-history-ffm-parking/</link>
      <pubDate>Mon, 30 Jan 2023 16:20:23 +0100</pubDate>
      
      
      <guid>https://datengraben.com/posts/2021-12-12-git-history-ffm-parking/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://de.wikipedia.org/wiki/Screen_Scraping&#34;&gt;Web-Scraping&lt;/a&gt; setzt oft voraus, dass ein eigener Rechner verfügbar ist, welcher bestenfalls 24h online &amp;#x1f310; ist und die Abfragen für das Scrapen absenden kann.
Wenn wir das vermeiden wollen, beöntigen wir entsprechende Infrakstruktur.
Simon Willison beschreibt in seinem &lt;a href=&#34;https://simonwillison.net/2021/Dec/7/git-history/&#34;&gt;Blogpost git-history&lt;/a&gt; ein Python Tool, welches aus einer Historie an git commits zu einer Datei, eine Zeitreihe erstellt.
Diese Serie von git commits basieren auf einer &lt;a href=&#34;https://simonwillison.net/2020/Oct/9/git-scraping/&#34;&gt;speziellen Art zu scrapen&lt;/a&gt;.
Dieses Pattern vereinfacht Web-Scraping, indem als Infrastruktur kein eigener Rechner genutzt werden muss, sondern &lt;a href=&#34;https://github.com/features/actions&#34;&gt;Github actions&lt;/a&gt;.
Die Github actions speichern jede neue unterschiedliche Version einer gescrapten Datei als eigenen commit im Repository.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
