Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22462

Python Bytes: #289 Textinator is coming for your text, wherever it is

$
0
0
<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=UP2JK6ISB9I' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <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 &amp; Code</strong></a> Podcast</li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p>Special guest: <a href="https://twitter.com/foosel"><strong>Gina Häußge</strong></a>, creator &amp; maintainer of <a href="https://octoprint.org"><strong>OctoPrint</strong></a></p> <p><strong>Michael #1:</strong> <a href="https://github.com/roman-right/beanita"><strong>beanita</strong></a></p> <ul> <li>Local MongoDB-like database prepared to work with Beanie ODM</li> <li>So, you know <a href="https://github.com/roman-right/beanie"><strong>Beanie</strong></a> - Pydantic + async + MongoDB</li> <li>And you know <a href="https://github.com/scottrogowski/mongita"><strong>Mongita</strong></a> - Mongita is to MongoDB as SQLite is to SQL </li> <li>Beanita lets you use Beanie, but against Mongita rather than a server-based MongoDB server</li> </ul> <p><strong>Brian #2:</strong> <a href="https://goodresearch.dev/index.html"><strong>The Good Research Code Handbook</strong></a></p> <ul> <li>Patrick J Mineault</li> <li>“for grad students, postdocs and PIs (principle investigator) who do a lot of programming as part of their research.”</li> <li>lessons <ul> <li>setup <ul> <li>git, virtual environments, project layout, packaging, cookie cutter</li> </ul></li> <li>style <ul> <li>style guides, keeping things clean</li> </ul></li> <li>coding <ul> <li>separating concerns, separating pure functions and those with side effects, pythonic-ness</li> </ul></li> <li>testing <ul> <li>unit testing, testing with side effects, …</li> <li>(incorrect definition of end-to-end tests, but a good job at covering the other bits)</li> </ul></li> <li>documentation <ul> <li>comments, tests, docstrings, README.md, usage docs, tutorials, websites</li> <li>documenting pipelines and projects</li> </ul></li> <li>social aspects <ul> <li>various reviews, pairing, open source, community </li> </ul></li> <li>sample project</li> <li>extras <ul> <li>testing example</li> <li>good tools to use</li> </ul></li> </ul></li> </ul> <p><strong>Gina</strong> <strong>#3:</strong> <a href="https://cadquery.readthedocs.io/en/latest/"><strong>CadQuery</strong></a></p> <ul> <li>Python lib to do build parametric 3D CAD models</li> <li>Can output STL, STEP, AMF, SVG and some more</li> <li>Uses same geometry kernel as FreeCAD (OpenCascade)</li> <li>Also available: desktop editor, Jupyter extension, CLI <ul> <li>Would recommend the Jupyter extension, the app seems a bit behind latest development</li> </ul></li> <li>Jupyter extension is easy to set up on Docker and comes with a nice 3D preview pane</li> <li>Was able to create a basic parametric design of an insert for an assortment box easily</li> <li>Python 3.8+, not yet 3.11, OpenCascade related</li> </ul> <p><strong>Michael #4:</strong> <a href="https://twitter.com/RhetTurnbull/status/1535713115421089792"><strong>Textinator</strong></a></p> <ul> <li>Like <a href="https://www.textsniper.app"><strong>TextSniper</strong></a>, but in Python</li> <li>Simple MacOS StatusBar / Menu Bar app to automatically detect text in screenshots</li> <li>Built with <a href="https://github.com/jaredks/rumps">RUMPS</a>: Ridiculously Uncomplicated macOS Python Statusbar apps</li> <li>Take a screenshot of a region of the screen using ⌘ + ⇧ + 4 (<code>Cmd + Shift + 4</code>). </li> <li>The app will automatically detect any text in the screenshot and copy it to your clipboard.</li> <li>How Textinator Works <ul> <li>At startup, Textinator starts a persistent <a href="https://developer.apple.com/documentation/foundation/nsmetadataquery?language=objc">NSMetadataQuery Spotlight query</a> (using the <a href="https://pyobjc.readthedocs.io/en/latest/">pyobjc</a> Python-to-Objective-C bridge) to detect when a new screenshot is created.</li> <li>When the user creates screenshot, the <code>NSMetadataQuery</code> query is fired and Textinator performs text detection using a <a href="https://developer.apple.com/documentation/vision?language=objc">Vision</a> <a href="https://developer.apple.com/documentation/vision/vnrecognizetextrequest?language=objc">VNRecognizeTextRequest</a> call.</li> </ul></li> </ul> <p><strong>Brian #5:</strong> <a href="https://hakibenita.com/django-concurrency"><strong>Handling Concurrency Without Locks</strong></a></p> <ul> <li>"How to not let concurrency cripple your system”</li> <li>Haki Benita</li> <li>“…common concurrency challenges and how to overcome them with minimal locking.”</li> <li>Starts with a Django web app</li> <li>A url shortener that generates a unique short url and stores the result in a database so it doesn’t get re-used.</li> <li>Discussions of <ul> <li>collision with two users checking, then storing keys at the same time.</li> <li>locking problems in general </li> <li>utilizing database ability to make sure some items are unique, in this case PostgreSQL</li> <li>updating your code to take advantage of database constraints support to allow you to do less locking within your code</li> </ul></li> </ul> <p><strong>Gina</strong> <strong>#6:</strong> <a href="https://tatsu.readthedocs.io/en/stable/"><strong>TatSu</strong></a></p> <ul> <li>Generates parsers from EBNF grammars (or ANTLR)</li> <li>Can compile the model (similar to regex) for quick reuse or generate python source</li> <li>Many examples provided</li> <li>Active development, Python 3.10+</li> </ul> <p><strong>Extras</strong> </p> <p>Michael:</p> <ul> <li><a href="https://pythonbytes.fm/episodes/show/285/where-we-talk-about-uis-and-python"><strong>Back on 285</strong></a> we spoke about PEP 690. Now there is a <a href="https://developers.facebook.com/blog/post/2022/06/15/python-lazy-imports-with-cinder"><strong>proper blog post</strong></a> about it.</li> <li><a href="https://pythonweekly.us2.list-manage.com/track/click?u=e2e180baf855ac797ef407fc7&amp;id=34c7bf229c&amp;e=e4bde12891"><strong>Expedited release of Python3.11.0b3</strong></a> - Due to a known incompatibility with pytest and the previous beta release (<a href="https://pythonweekly.us2.list-manage.com/track/click?u=e2e180baf855ac797ef407fc7&amp;id=254cb29852&amp;e=e4bde12891"><strong>Python 3.11.0b2</strong></a>) and after some deliberation, Python release team have decided to do an expedited release of Python 3.11.0b3 so the community can continue testing their packages with pytest and therefore testing the betas as expected. (via Python Weekly)</li> <li><a href="https://kagi.com"><strong>Kagi search</strong></a> <ul> <li>via Daniel Hjertholm</li> <li>Not really python related, but if I know Michael right, he'll love the new completely ad free and privacy-respecting search engine kagi.com. I've used kagi.com since their public beta launched, mainly to search for solutions to Python issues at work. The results are way better than DuckDuckGo's results, and even better than Googles! Love the Programming-lens and the ability to up/down prioritize domains in the results.</li> <li>Their FAQ explains everything you need to know: <strong><a href="https://kagi.com/faq">https://kagi.com/faq</a></strong></li> <li>Looks great but not sure about the pricing justification (32 sec of compute = $1), that’s either 837x more than all of Talk Python + Python Bytes or more than 6,700x more than just one of our sites/services. (We spend about $100/mo on 8 servers.) But they <em>may</em> be buying results from Google and Bing, and that could be the cost.</li> <li>Here's <strong><a href="https://twitter.com/vladquant/status/1538559700593156102?s=21&amp;t=YSBQS2lP3oWVA9YDlZt1OA">a short interview</a></strong> with the man who started kagi.</li> </ul></li> </ul> <p>Gina: </p> <ul> <li><a href="https://github.com/rfinnie/rdserialtool"><strong>rdserialtool</strong></a>: Reads out low-cost USB power monitors (UM24C, UM25C, UM34C) via BLE/pybluez. Amazing if you need to monitor the power consumption/voltage/current of some embedded electronics on a budget. Helped me solve a very much OctoPrint development specific problem. Python 3.4+</li> <li><a href="https://pypi.org/project/nodejs-bin/"><strong>nodejs-bin</strong></a>: <ul> <li>by Sam Willis: <a href="https://twitter.com/samwillis/status/1537787836119793667">https://twitter.com/samwillis/status/1537787836119793667</a></li> <li>Install nodejs via pypi/as dependency, still very much an Alpha but looks promising</li> <li>Makes it easier to obtain a full stack environment</li> <li>Very interesting for end to end testing with JS based tooling, or packaging a frontend with your Python app</li> <li>See also nodeenv, which does a similar thing, but with additional steps</li> </ul></li> </ul> <p><strong>Joke:</strong> <a href="https://twitter.com/btskinn/status/1535605341446098946"><strong>Rejected Github Badges</strong></a></p>

Viewing all articles
Browse latest Browse all 22462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>