<p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://testandcode.com/"><strong>Test & Code</strong></a> Podcast</li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Michael #1:</strong> <a href="https://twitter.com/mkennedy/status/1320769596832374785"><strong>fastapi-chameleon</strong></a> <strong>(and</strong> <a href="https://twitter.com/AGeekInside/status/1320926762377904129"><strong>fastapi-jinja</strong></a><strong>)</strong></p> <ul> <li>Chameleon via Michael, Jinja via Marc Brooks</li> <li>Convert a FastAPI API app to a proper web app</li> <li>Then just decorate the FastAPI view methods (works on sync and async methods):</li> </ul> <pre><code> @router.post('/') @fastapi_chameleon.template('home/index.pt') async def home_post(request: Request): form = await request.form() vm = PersonViewModel(**form) return vm.dict() # {'first':'Michael', 'last':'Kennedy', ...} </code></pre> <ul> <li>The view method should return a <code>dict</code> to be passed as variables/values to the template.</li> <li>If a <code>fastapi.Response</code> is returned, the template is skipped and the response along with status_code and other values is directly passed through. This is common for redirects and error responses not meant for this page template.</li> </ul> <p><strong>Brian #2:</strong> <a href="https://adamj.eu/tech/2020/10/15/a-single-file-rest-api-in-django/"><strong>Django REST API in a single file, without using DRF</strong></a></p> <ul> <li>Adam Johnson <ul> <li>He’s been on Test & Code a couple times, <a href="https://testandcode.com/128">128</a> & <a href="https://testandcode.com/135">135</a></li> </ul></li> <li>Not sure if you should do this, but it is possible.</li> <li>Example Django app that is a REST API that gives you information about characters from Rick & Morty. Specifically, just Rick and Morty. <ul> <li>/ - redirects to /characters/</li> <li>/characters/ - returns a JSON list</li> <li>/characters - redirects to /characters/</li> <li>/characters/1 - returns JSON info about Rick</li> <li>/characters/2 - same, but for Morty</li> </ul></li> <li>Shows off how with Django off the shelf, can do redirects and JSON output.</li> <li>Shows data using dataclasses. Hardcoded here, but easy to see how you could get this data from a database or other part of your system.</li> </ul> <p><strong>Michael #3:</strong> <a href="https://insights.stackoverflow.com/survey/2020"><strong>2020 StackOverflow survey results</strong></a></p> <ul> <li>Most Popular Technologies</li> <li>Languages: JavaScript (68%), Python (44%), Java(40%)</li> <li>Web frameworks: Just broken, jQuery? Seriously!?!</li> <li>Databases: MySQL (56%), PostgreSQL (36%), Microsoft SQL Server (33%), MongoDB (26%)</li> <li>Platforms: Windows (46%), macOS (28%), Linux(27%)</li> <li>Most loved languages: Rust, TypeScript, Python</li> <li>Most wanted languages: Python, JavaScript, Go</li> <li>Most dreaded language: VBA & ObjectiveC</li> <li>Most loved DBs: Redis (67%), PostgreSQL (64%), Elasticsearch (59%), MongoDB (56%)</li> <li>Most wanted DBs: MongoDB (19%), PostgreSQL (16%)</li> <li>Most dreaded DB: DB2</li> </ul> <p><strong>Brian #4:</strong> <a href="https://amitness.com/regex/"><strong>A Visual Guide to Regular Expression</strong></a></p> <ul> <li>Amit Chaudhary</li> <li>Gentle introduction to regex by building up correct mental models using visual highlighting.</li> <li>Goes through different patterns: <ul> <li>specific character</li> <li>white space (any whitespace \s, tab \t, newline \n)</li> <li>single-digit number \d</li> <li>word characters \w : lowercase, uppercase, digits, underscore <ul> <li>this sometimes throws me, since w seems like it might somehow be related to whitespace. It’s not.</li> </ul></li> <li>dot . : anything except newline</li> <li>pattern negations:</li> <li>\d is digits, \D is anything that is not a digit</li> <li>\s whitespace, \S not whitespace</li> <li>\w word characters, \W everything else</li> <li>character sets with square brackets [], and optionally dash - for range</li> <li>anchors</li> <li>^ beginning of line</li> <li>$ end of line</li> <li>escaping patterns with \</li> <li>repetition with {}, *, +, ?</li> </ul></li> <li>Using Python re module <ul> <li>findall</li> <li>match and match.group</li> <li>search</li> </ul></li> </ul> <p><strong>Michael #5:</strong> <a href="https://twitter.com/tim_nolet/status/1317061818574082050"><strong>Taking credit</strong></a></p> <ul> <li>by <a href="https://twitter.com/tim_nolet">Tim Nolet</a></li> <li>Oh <a href="https://twitter.com/awscloud">@awscloud</a> I really do love you! But next time you fork my OS project <a href="https://ift.tt/35zk4T7> and present it as your new service, give the maintainers a short "nice job, kids" or something. </li> <li>Not necessary as per the APLv2 license, but still, ya know?</li> <li>Amazon CloudWatch Synthetics launches Recorder to generate user flow scripts for canaries</li> <li>A Chrome browser extension, to help you create canaries more easily.</li> </ul> <p><strong>Brian #6:</strong> <a href="https://ift.tt/2IBqQPd Pi 400</strong></a></p> <ul> <li>“complete personal computer, built into a compact keyboard”</li> <li>by itself, or as a kit with mouse and power adapter and cables and such, for $100</li> <li>4 core, 64-bit processor, 4 GB RAM, wifi & LAN, can drive 2 displays, 4K video</li> <li>40-pin GPIO header, so you can still play with hardware and such.</li> <li>There’s an <a href="https://www.youtube.com/watch?v=OtotErWPEA8&feature=youtu.be">adafruit video with Limor Fried</a> where she describes this as something as close as we get today to an Apple IIe from my youth.</li> <li>For me, IIe was at school, at home I had a TRS80 plugged into an old TV and using my sisters tape deck for disk storage.</li> <li>This seems great for education use, but also as a second computer in your house, or a kids computer. </li> <li>Comes with a Beginner’s Guide that includes getting started with Python</li> </ul> <p>Extras:</p> <p>Brian: </p> <ul> <li><a href="https://vim-adventures.com/">vim-adventures.com</a> - with a dash. Practice vim key bindings while playing an adventure game. Super cool. </li> </ul> <p>Michael:</p> <ul> <li><a href="https://www.tiobe.com/tiobe-index/">TIOBE Index for November 2020</a> via Tyler Pedersen</li> </ul> <p>Joke:</p> <p><strong><a href="http://geek-and-poke.com/geekandpoke/2019/10/4/you-build-it-you-run-it">You built it, you run it.</a></strong></p>
from Planet Python
via read more
Subscribe to:
Post Comments (Atom)
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...
-
Graph traversal algorithms are used to perform various operations on a graph data structure. In this article, we will use the breadth-first ...
-
Podcasts are a great way to immerse yourself in an industry, especially when it comes to data science. The field moves extremely quickly, an...
-
In an earlier tutorial we've already covered how to open dialog windows. These are special windows which (by default) grab the focus o...
No comments:
Post a Comment