<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: aschenbecherwespe</title>
    <description>The latest articles on Forem by aschenbecherwespe (@aschenbecherwespe).</description>
    <link>https://forem.com/aschenbecherwespe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F952099%2F2610a6be-108e-4505-b392-e45edc85915e.jpeg</url>
      <title>Forem: aschenbecherwespe</title>
      <link>https://forem.com/aschenbecherwespe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aschenbecherwespe"/>
    <language>en</language>
    <item>
      <title>Reduct Storage Python Client Release v1.0.0</title>
      <dc:creator>aschenbecherwespe</dc:creator>
      <pubDate>Sat, 22 Oct 2022 14:10:13 +0000</pubDate>
      <link>https://forem.com/reductstore/reduct-storage-python-client-release-v100-4062</link>
      <guid>https://forem.com/reductstore/reduct-storage-python-client-release-v100-4062</guid>
      <description>&lt;p&gt;Hello dev.to, &lt;/p&gt;

&lt;p&gt;This post is an announcement for the release of v1.0.0 of our Python client for Reduct Storage.&lt;/p&gt;

&lt;p&gt;The client has ben updated for compatibility with v1.0.0 of the storage engine's API, which is described &lt;a href="https://github.com/reduct-storage/reduct-storage/releases/tag/v1.0.0"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The released package and release notes can be found on &lt;a href="https://github.com/reduct-storage/reduct-py/releases/tag/v1.0.0"&gt;Github&lt;/a&gt; or to use it right away you can:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;reduct-py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This version drops the &lt;code&gt;bucket.read_by&lt;/code&gt; method in favour of &lt;code&gt;bucket.query&lt;/code&gt; and a newly improved &lt;code&gt;bucket.read&lt;/code&gt; method. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bucket.read&lt;/code&gt; now returns an &lt;em&gt;asynchronous context&lt;/em&gt;, within which data can be loaded from the storage at the desired point with the &lt;code&gt;Record.read()&lt;/code&gt; or &lt;code&gt;Record.read_all()&lt;/code&gt; methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"entry-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The perviously deprecated &lt;code&gt;bucket.list()&lt;/code&gt; method has also been removed, it's functionality having been replaced by &lt;code&gt;bucket.query()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Record&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;record&lt;/span&gt;
        &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"entry-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think that's all for this post!&lt;/p&gt;

&lt;p&gt;May your data storage be robust 🫡&lt;/p&gt;

</description>
      <category>reductstorage</category>
      <category>python</category>
      <category>database</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
