<?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>DEV Community: Daniel Townsend</title>
    <description>The latest articles on DEV Community by Daniel Townsend (@dantownsend).</description>
    <link>https://dev.to/dantownsend</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%2F557287%2F63a9dd67-8405-48a4-a661-bfeda61bc0d5.jpeg</url>
      <title>DEV Community: Daniel Townsend</title>
      <link>https://dev.to/dantownsend</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dantownsend"/>
    <language>en</language>
    <item>
      <title>Piccolo, an async query builder and ORM for Python</title>
      <dc:creator>Daniel Townsend</dc:creator>
      <pubDate>Mon, 11 Jan 2021 00:32:41 +0000</pubDate>
      <link>https://dev.to/dantownsend/piccolo-an-async-query-builder-and-orm-for-python-4n07</link>
      <guid>https://dev.to/dantownsend/piccolo-an-async-query-builder-and-orm-for-python-4n07</guid>
      <description>&lt;p&gt;I'm happy to introduce &lt;a href="https://github.com/piccolo-orm/piccolo" rel="noopener noreferrer"&gt;Piccolo&lt;/a&gt;, an async query builder and ORM for Python, which works with Postgres and SQLite.&lt;/p&gt;

&lt;p&gt;Some of it's standout features:&lt;/p&gt;

&lt;h2&gt;
  
  
  Support for asyncio
&lt;/h2&gt;

&lt;p&gt;Asyncio makes a lot of sense when you want high throughput applications. Piccolo is built on top of &lt;a href="https://docs.python.org/3/library/asyncio.html" rel="noopener noreferrer"&gt;asyncio&lt;/a&gt; and a fast database adapter called &lt;a href="https://github.com/MagicStack/asyncpg" rel="noopener noreferrer"&gt;asyncpg&lt;/a&gt;. You can also use Piccolo within a traditional synchronous app too.&lt;/p&gt;

&lt;h2&gt;
  
  
  An admin GUI
&lt;/h2&gt;

&lt;p&gt;Most users of Django will tell you that the admin interface is one of its greatest strengths. It saves developers lots of time, compared to building one from scratch for each project. Piccolo has its own &lt;a href="https://github.com/piccolo-orm/piccolo_admin" rel="noopener noreferrer"&gt;admin&lt;/a&gt;, which is clean and modern, built using Vue JS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgdwqnv3tnvc56pkjrm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgdwqnv3tnvc56pkjrm5.png" alt="Piccolo admin GUI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A backend framework
&lt;/h2&gt;

&lt;p&gt;There are thousands of web frameworks out there, but often they just focus on the view layer, and don't think about the database or security.&lt;/p&gt;

&lt;p&gt;Piccolo was designed the other way around - focusing on the data layer first, meaning you can use it with any routing library you wish. Piccolo has out of the box support for &lt;a href="https://www.starlette.io/" rel="noopener noreferrer"&gt;Starlette&lt;/a&gt; and &lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI&lt;/a&gt;. Other ASGI frameworks integrate with Piccolo really easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrations
&lt;/h2&gt;

&lt;p&gt;No ORM is complete without &lt;a href="https://piccolo-orm.readthedocs.io/en/latest/piccolo/migrations/index.html" rel="noopener noreferrer"&gt;migrations&lt;/a&gt; - Piccolo ships with them right out of the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project templates
&lt;/h2&gt;

&lt;p&gt;Piccolo makes &lt;a href="https://piccolo-orm.readthedocs.io/en/latest/piccolo/asgi/index.html" rel="noopener noreferrer"&gt;creating a new web app&lt;/a&gt; really simple. Just use &lt;code&gt;piccolo asgi new&lt;/code&gt;, and a web app template is created for you automatically. Starlette and FastAPI are currently supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  Playground
&lt;/h2&gt;

&lt;p&gt;Piccolo makes learning the query syntax as easy as possible, using a &lt;a href="https://piccolo-orm.readthedocs.io/en/latest/piccolo/getting_started/playground.html" rel="noopener noreferrer"&gt;playground&lt;/a&gt;. Use &lt;code&gt;piccolo playground run&lt;/code&gt;, and it'll launch an iPython shell, and a test SQLite database, allowing you to practice querying with Piccolo without having to set anything up first.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL inspired
&lt;/h2&gt;

&lt;p&gt;Piccolo's syntax for queries is &lt;a href="https://piccolo-orm.readthedocs.io/en/latest/piccolo/features/syntax.html" rel="noopener noreferrer"&gt;as close as possible to SQL&lt;/a&gt;. Anyone with SQL experience should find it very natural to use.&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="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Movie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Movie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Movie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;George Lucas&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Star Wars&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Modular code
&lt;/h2&gt;

&lt;p&gt;Piccolo allows you to separate your models into &lt;a href="https://piccolo-orm.readthedocs.io/en/latest/piccolo/projects_and_apps/index.html" rel="noopener noreferrer"&gt;apps&lt;/a&gt;, making your code more maintainable, and meaning you can share them with other people on Github, or PyPI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;Piccolo has a bunch of associated &lt;a href="https://github.com/piccolo-orm/piccolo_api" rel="noopener noreferrer"&gt;middleware, endpoints, and tables&lt;/a&gt; to help build a secure web app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give it a go!
&lt;/h2&gt;

&lt;p&gt;Give Piccolo a go. It is already being used in production, and is improving at a rapid pace. If you have any feedback or questions, let us know on &lt;a href="https://github.com/piccolo-orm/piccolo" rel="noopener noreferrer"&gt;Github&lt;/a&gt;. Thanks!&lt;/p&gt;

</description>
      <category>python</category>
      <category>postgres</category>
      <category>fastapi</category>
      <category>asyncio</category>
    </item>
  </channel>
</rss>
