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

Python Bytes: #281 ohmyzsh + ohmyposh + mcfly + pls + nerdfonts = wow

$
0
0
<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=Wkqyecv49Ic' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored: <a href="https://pythonbytes.fm/compiler"><strong>RedHat: Compiler Podcast</strong></a></p> <p>Special guest: <a href="https://twitter.com/AmaMidzu"><strong>Anna Astori</strong></a></p> <p><strong>Michael #1:</strong> <a href="https://dev.to/eludadev/take-your-github-repository-to-the-next-level-17ge"><strong>Take Your Github Repository To The Next Level 🚀️</strong></a></p> <ul> <li>Step 0. Make Your Project More Discoverable</li> <li>Step 1. Choose A Name That Sticks</li> <li>Step 2. Display A Beautiful Cover Image</li> <li>Step 3. Add Badges To Convey More Information</li> <li>Step 4. Write A Convincing Description</li> <li>Step 5. Record Visuals To Attract Users 👀</li> <li>Step 6. Create A Detailed Installation Guide (if needed)</li> <li>Step 7. Create A Practical Usage Guide 🏁</li> <li>Step 8. Answer Common Questions</li> <li>Step 9. Build A Supportive Community</li> <li>Step 10. Create Contribution Guidelines</li> <li>Step 11. Choose The Right License</li> <li>Step 12. Plan Your Future Roadmap</li> <li>Step 13. Create Github Releases (know <a href="https://github.com/release-drafter/release-drafter">release drafter</a>)</li> <li>Step 14. Customize Your Social Media Preview</li> <li>Step 15. Launch A Website</li> </ul> <p><strong>Brian #2:</strong> <a href="https://fastero.readthedocs.io/en/latest/index.html"><strong>Fastero</strong></a></p> <ul> <li>“Python timeit CLI for the 21st century.”</li> <li>Arian Mollik Wasi, <a href="https://twitter.com/wasi_master">@wasi_master</a></li> <li>Colorful and very usable benchmarking/comparison tool</li> <li>Time or Compare one ore more <ul> <li>code snippet</li> <li>python file</li> <li>mix and match, even</li> </ul></li> <li>Allows setup code before snippets run</li> <li>Multiple output export formats: markdown, html, csv, json, images, …</li> <li>Lots of customization possible</li> <li>Takeaway <ul> <li>especially for comparing two+ options, this is super handy</li> </ul></li> </ul> <p><strong>Anna</strong> <strong>#3:</strong> </p> <ul> <li>langid vs langdetect</li> </ul> <p>langdetect</p> <ul> <li>This library is a direct port of Google's language-detection library from Java to Python</li> <li>langdetect supports 55 languages out of the box (ISO 639-1 codes):</li> <li>Basic usage: detect() and detect_langs()</li> <li>great to work with noisy data like social media and web blogs</li> <li>being statistical, works better on larger pieces of text vs short posts</li> </ul> <p>langid</p> <ul> <li>hasn't been updated for a few years</li> <li>97 languages</li> <li>can use Python's built-in wsgiref.simple_server (or fapws3 if available) to provide language identification as a web service. To do this, launch python langid.py -s, and access http://localhost:9008/detect . The web service supports GET, POST and PUT.</li> <li>the actual calculations are implemented in the log-probability space but can also have a "confidence" score for the probability prediction between 0 and 1: &gt; from langid.langid import LanguageIdentifier, model &gt; identifier = LanguageIdentifier.from_modelstring(model, norm_probs=True) &gt; identifier.classify("This is a test") &gt; ('en', 0.9999999909903544) - minimal dependencies - relatively fast - NB algo, can train on user data.</li> </ul> <p><strong>Michael #4:</strong> <a href="https://watchfiles.helpmanual.io"><strong>Watchfiles</strong></a></p> <ul> <li>by Samual Colvin (of Pydantic fame)</li> <li>Simple, modern and high performance file watching and code reload in python.</li> <li>Underlying file system notifications are handled by the <a href="https://github.com/notify-rs/notify">Notify</a> rust library.</li> <li>Supports sync watching but also async watching</li> <li>CLI example</li> <li>Running and restarting a command¶ <ul> <li>Let's say you want to re-run failing tests whenever files change. You could do this with watchfiles using</li> <li>Running a command: <code>watchfiles 'pytest --lf``'</code> </li> </ul></li> </ul> <p><strong>Brian #5:</strong> <a href="https://github.com/plasma-umass/slipcover"><strong>Slipcover: Near Zero-Overhead Python Code Coverage</strong></a></p> <ul> <li>From coverage.py twitter account, which I’m pretty sure is Ned Bachelder</li> <li>coverage numbers with “3% or less overhead”</li> <li>Early stages of the project.</li> <li>It does seem pretty zippy though. </li> <li>Mixed results when trying it out with a couple different projects <ul> <li>flask: <ul> <li>just pytest: 2.70s</li> <li>with slipcover: 2.88s</li> <li>with coverage.py: 4.36s</li> </ul></li> <li>flask with xdist n=4 <ul> <li>pytest: 2.11 s</li> <li>coverage: 2.60s</li> <li>slipcover: doesn’t run (seems to load pytest plugins)</li> </ul></li> </ul></li> <li>Again, still worth looking at and watching. It’s good to see some innovation in the coverage space aside from Ned’s work.</li> </ul> <p><strong>Anna #6:</strong> </p> <ul> <li>scrapy vs robox</li> </ul> <p>scra-py</p> <ul> <li>shell to try out things: fetch url, view response object, response.text</li> <li>extract using css selectors or xpath</li> <li>lets you navigate between levels e.g. the parent of an element with id X</li> <li>crawler to crawl websites and spider to extract data</li> <li>startproject for project structure and templates like settings and pipelines</li> <li>some advanced features like specifying user-agents etc for large scale scraping.</li> <li>various options to export and store the data</li> <li>nice features like LinkExtractor to determine specific links to extract, already deduped.</li> <li>FormRequest class</li> </ul> <p>robox</p> <ul> <li>layer on top of httpx and beautifulsoup4</li> <li>allows to interact with forms on pages: check, choose, submit</li> </ul> <p><strong>Extras</strong> </p> <p>Michael:</p> <ul> <li><a href="https://ohmyz.sh"><strong>ohmyzsh</strong></a> + <a href="https://ohmyposh.dev"><strong>ohmyposh</strong></a> + <a href="https://github.com/cantino/mcfly"><strong>mcfly</strong></a> + <a href="https://iterm2.com"><strong>iterm2</strong></a> + <a href="https://dhruvkb.github.io/pls/"><strong>pls</strong></a> + <a href="https://www.nerdfonts.com/font-downloads"><strong>nerdfonts</strong></a> = wow</li> <li><strong><a href="https://youtu.be/Qlx4yP7y0fI">Watch the video we discussed here</a></strong></li> </ul> <p><strong>Joke:</strong> </p> <ul> <li><a href="https://www.reddit.com/r/ProgrammerHumor/comments/u72sli/hello_i_am_your_server_for_today/"><strong>Out for a byte</strong></a></li> </ul>

Viewing all articles
Browse latest Browse all 24363

Trending Articles



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