Friday, May 29, 2020

Python Bytes: #183 Need a beautiful database editor? Look to the Bees!

<p>Sponsored by DigitalOcean: <a href="http://pythonbytes.fm/digitalocean"><strong>pythonbytes.fm/digitalocean</strong></a></p> <p>Special guest: Calvin Hendryx-Parker <a href="https://twitter.com/calvinhp">@calvinhp</a></p> <hr /> <p><strong>Brian #1:</strong> <a href="https://github.com/fastai/fastpages"><strong>fastpages: An easy to use blogging platform, with enhanced support for Jupyter Notebooks.</strong></a> </p> <ul> <li>Uses GH actions to Jekyll blog posts on GitHub Pages.</li> <li>Create posts with code, output of code, formatted text, directory from Jupyter Notebooks.</li> <li>Altair interactive visualizations</li> <li>Collapsible code cells that can be open or closed by default.</li> <li>Metadata like title, summary, in special markdown cells.</li> <li>twitter cards and YouTube videos</li> <li>tags support</li> <li>Support for pure markdown posts </li> <li>and even MS Word docs for posts. (but really, don’t).</li> <li>Documentation and introduction written in fastpages itself, <a href="https://fastpages.fast.ai/">https://fastpages.fast.ai/</a></li> </ul> <hr /> <p><strong>Michael #2:</strong> <a href="https://www.beekeeperstudio.io"><strong>BeeKeeper Studio Open Source SQL Editor and Database Manager</strong></a></p> <ul> <li>Use Beekeeper Studio to query and manage your relational databases, like <strong>MySQL</strong>, <strong>Postgres</strong>, <strong>SQLite</strong>, and <strong>SQL Server</strong>.</li> <li>Runs on all the things (Windows, Linux, macOS)</li> <li>Features <ul> <li>Autocomplete SQL query editor with syntax highlighting</li> <li>Tabbed interface, so you can multitask</li> <li>Sort and filter table data to find just what you need</li> <li>Sensible keyboard-shortcuts</li> <li>Save queries for later</li> <li>Query run-history, so you can find that one query you got working 3 days ago</li> <li>Default dark theme</li> </ul></li> <li>Connect: Alongside normal connections you can encrypt your connection with SSL, or tunnel through SSH. Save a connection password and Beekeeper Studio will make sure to encrypt it to keep it safe.</li> <li>SQL Auto Completion: Built-in editor provides syntax highlighting and auto-complete suggestions for your tables so you can work quickly and easily.</li> <li>Open Lots of Tabs: Open dozens of tabs so you can write multiple queries and tables in tandem without having to switch windows.</li> <li>Save queries</li> <li>View Table Data: Tables get their own tabs too! Use our table view to sort and filter results by column.</li> </ul> <hr /> <p><strong>Calvin #3:</strong> <strong>2nd Annual</strong> <a href="https://2020.pythonwebconf.com/"><strong>Python</strong></a> <a href="https://2020.pythonwebconf.com/"><strong>Web</strong></a> <a href="https://2020.pythonwebconf.com/"><strong>Conference</strong></a> <a href="https://2020.pythonwebconf.com/"></a></p> <ul> <li>The most in-depth Python conference for web developers <ul> <li>Targeted at production users of Python</li> <li>Talks on Django, Flask, Twisted, Testing, SQLAlchemy, Containers, Deployment and more</li> </ul></li> <li>June 17th-19th — One day of tutorials and two days of talks in 3 tracks</li> <li>Keynote talks by <ul> <li>Lorena Mesa</li> <li>Hynek Schlawack</li> <li>Russell Keith-Magee</li> <li>Steve Flanders</li> </ul></li> <li>Fireside Chat with Carl Meyer about Instragram’s infrastructure, best practices</li> <li>Participate in 40+ presentations and 6 tutorials</li> <li>Fun will be had and connections made <ul> <li>Virtual cocktails</li> <li>Online gaming</li> <li>Board game night</li> </ul></li> <li>Tickets are $199 and $99 for Students <ul> <li>As a bonus, for every <strong>Professional</strong> ticket purchased, we'll donate a ticket to an attendee in a <a href="https://unstats.un.org/unsd/methodology/m49/">developing country.</a> </li> <li>As a Python Bytes listener you can get a 20% discount with the code PB20</li> </ul></li> </ul> <hr /> <p><strong>Brian #4:</strong> <a href="https://mimesis.name/"><strong>Mimesis - Fake Data Generator</strong></a></p> <ul> <li>“…helps generate big volumes of fake data for a variety of purposes in a variety of languages.”</li> <li>Custom and generic data providers</li> <li>&gt;33 locales</li> <li>Lots of locale dependent providers, like address, Food, Person, …</li> <li>Locale independent providers. </li> <li>Super fast. Benchmarking with 10k full names was like <a href="https://mimesis.name/foreword.html#advantages">60x faster than Faker</a>.</li> <li>Data generation by schema. Very cool</li> </ul> <pre><code> &gt;&gt;&gt; from mimesis.schema import Field, Schema &gt;&gt;&gt; _ = Field('en') &gt;&gt;&gt; description = ( ... lambda: { ... 'id': _('uuid'), ... 'name': _('text.word'), ... 'version': _('version', pre_release=True), ... 'timestamp': _('timestamp', posix=False), ... 'owner': { ... 'email': _('person.email', domains=['test.com'], key=str.lower), ... 'token': _('token_hex'), ... 'creator': _('full_name'), ... }, ... } ... ) &gt;&gt;&gt; schema = Schema(schema=description) &gt;&gt;&gt; schema.create(iterations=1) </code></pre> <pre><code>- Output: [ { "owner": { "email": "aisling2032@test.com", "token": "cc8450298958f8b95891d90200f189ef591cf2c27e66e5c8f362f839fcc01370", "creator": "Veronika Dyer" }, "name": "widget", "version": "4.3.1-rc.5", "id": "33abf08a-77fd-1d78-86ae-04d88443d0e0", "timestamp": "2018-07-29T15:25:02Z" } ] </code></pre> <hr /> <p><strong>Michael #5:</strong> <a href="https://github.com/kiwicom/schemathesis"><strong>Schemathesis</strong></a></p> <ul> <li>A tool for testing your web applications built with Open API / Swagger specifications.</li> <li><strong>Supported specification versions</strong>: <ul> <li>Swagger 2.0</li> <li>Open API 3.0.x</li> </ul></li> <li>Built with: <ul> <li><a href="https://hypothesis.works/">hypothesis</a></li> <li><a href="https://github.com/Zac-HD/hypothesis-jsonschema">hypothesis_jsonschema</a></li> <li><a href="http://pytest.org/en/latest/">pytest</a></li> </ul></li> <li>It reads the application schema and generates test cases which will ensure that your application is compliant with its schema.</li> <li>Use: There are two basic ways to use Schemathesis: <ul> <li><a href="https://github.com/kiwicom/schemathesis#command-line-interface">Command Line Interface</a></li> <li><a href="https://github.com/kiwicom/schemathesis#in-code">Writing tests in Python</a></li> </ul></li> <li>CLI supports passing options to <code>hypothesis.settings</code>.</li> <li>To speed up the testing process Schemathesis provides <code>-w/--workers</code> option for concurrent test execution</li> <li>If you'd like to test your web app (Flask or AioHTTP for example) then there is <code>--app</code> option for you</li> <li>Schemathesis CLI also available as a docker image</li> <li>Code example:</li> </ul> <pre><code> import requests import schemathesis schema = schemathesis.from_uri("http://0.0.0.0:8080/swagger.json") @schema.parametrize() def test_no_server_errors(case): # `requests` will make an appropriate call under the hood response = case.call() # use `call_wsgi` if you used `schemathesis.from_wsgi` # You could use built-in checks case.validate_response(response) # Or assert the response manually assert response.status_code &lt; 500 </code></pre> <hr /> <p><strong>Calvin #6:</strong> <a href="https://blog.jse.li/posts/pyc/">Finding secrets by decompiling Python bytecode in public repositories</a></p> <ul> <li>Jesse’s initial research revealed that <strong>thousands of GitHub repositories contain secrets hidden inside their bytecode.</strong></li> <li>It has been common practice to store secrets in Python files that are typically ignored such as <code>settings.py</code>, <code>config.py</code> or <code>secrets.py</code>, but this is potentially insecure</li> <li>Includes a nice crash course on Python byte code and cached source</li> <li>This post comes with a small capture-the-flag style lab for you to try out this style of attack yourself. <ul> <li>You can find it at <a href="https://github.com/veggiedefender/pyc-secret-lab/">https://github.com/veggiedefender/pyc-secret-lab/</a></li> </ul></li> <li>Look through your repositories for loose <code>.pyc</code> files, and delete them</li> <li>If you have <code>.pyc</code> files and they contain secrets, then revoke and rotate your secrets</li> <li>Use a standard <a href="https://github.com/github/gitignore/blob/master/Python.gitignore">gitignore</a> to prevent checking in <code>.pyc</code> files</li> <li>Use JSON files or environment variables for configuration</li> </ul> <hr /> <p><strong>Extras:</strong></p> <p>Michael:</p> <ul> <li><a href="https://pycoders.com/link/4164/yrq2q8ogch">Python 3.9.0b1 Is Now Available for Testing</a></li> <li><a href="https://pycoders.com/link/4141/yrq2q8ogch">Python 3.8.3 Is Now Available</a></li> <li>Ventilators and Python: Some particle physicists put some of their free time to design and build a low-cost ventilator for covid-19 patients for use in hospitals. https://ift.tt/3gCmLXe Search of the PDF for Python: <ul> <li>"Target computing platform: Raspberry Pi 4 (any memory size), chosen as a trade-off between its computing power over power consumption ratio and its wide availability on the market; • Target operating: Raspbian version 2020-02-13; • Target programming language: Python 3.5; • Target PyQt5: version 5.11.3."</li> <li>"The MVM GUI is a Python3 software, written using the PyQt5 toolkit, that allows steering and monitoring the MVM equipment."</li> </ul></li> </ul> <p>Brian: </p> <ul> <li><a href="https://pyfound.blogspot.com/2020/05/call-for-volunteers-python-github.html">Call for Volunteers! Python GitHub Migration Work Group</a> <ul> <li>migration from bugs.python.org to GitHub</li> </ul></li> </ul> <p>Calvin:</p> <ul> <li><a href="https://www.humblebundle.com/books/learn-you-some-python-no-starch-press-books">Learn Python Humble Bundle</a> <ul> <li>Pay $15+ and get an amazing set of Python books to start learning at all levels</li> <li>Book Industry Charitable Foundation</li> <li>The No Starch Press Foundation</li> </ul></li> </ul> <hr /> <p><strong>Joke:</strong></p> <p>More O’Really book covers</p> <p><img src="https://ift.tt/2yOk4Ru" alt="" /></p> <p><img src="https://ift.tt/2Ap3HLK" alt="" /></p> <p><img src="https://ift.tt/3gDqVOu" alt="" /></p> <p><img src="https://ift.tt/3gzVJ2F" alt="" /></p>

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...