FLOSS Project Planets

Python Bytes: #260 It's brutally simple: made just from pickle and zip

Planet Python - Tue, 2021-11-23 03:00
<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=F7hmqiTXADQ' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by <strong>Shortcut - Get started at</strong> <a href="http://shortcut.com/pythonbytes"><strong>shortcut.com/pythonbytes</strong></a></p> <p>Special guest: Chris Patti</p> <p><strong>Brian #1:</strong> <a href="https://til.simonwillison.net/python/cog-to-update-help-in-readme"><strong>Using cog to update --help in a Markdown README file</strong></a></p> <ul> <li>Simon Willison</li> <li>I’ve wanted to have a use case for Ned Batchelder’s <a href="https://nedbatchelder.com/code/cog">cog</a> <ul> <li>Cog is a utility that looks for specially blocks</li> </ul></li> </ul> <pre><code> [[[cog some code ]]] </code></pre> <p>and </p> <pre><code> [[[end]]] </code></pre> <ul> <li>These block can be in comments, <code>[HTML_REMOVED]</code> for markdown.</li> <li>When you run cog on a file, it runs the “some code” and puts the output after the middle <code>]]]</code> and before the <code>[[[end]]]</code>.</li> <li>Simon has come up with an excellent use, running <code>--help</code> and capturing the output for a <code>README.md</code> file for a CLI project.</li> <li>He even wrote a test, pytest of course, to check if the README.md needs updated.</li> </ul> <p><strong>Michael #2:</strong> <a href="https://calpaterson.com/bank-python.html"><strong>An oral history of Bank Python</strong></a></p> <ul> <li>Bank Python implementations are effectively proprietary forks of the <em>entire</em> Python ecosystem which are in use at many (but not all) of the biggest investment banks.</li> <li>The first thing to know about Minerva is that it is built on a global database of Python objects. <ul> <li>Barbara is a simple key value store with a hierarchical key space. It's brutally simple: made just from <a href="https://docs.python.org/3/library/pickle.html">pickle</a> and <a href="https://docs.python.org/3/library/zlib.html">zip</a>.</li> </ul></li> <li>Applications also commonly store their <em>internal</em> state in Barbara - writing dataclasses straight in and out with only very simple locking and transactions (if any). </li> <li>There is no filesystem available to Minerva scripts and the little bits of data that scripts pick up has to be put into Barbara.</li> <li>Barbara also has some "overlay" features:</li> </ul> <pre><code> # connect to multiple rings: keys are 'overlaid' in order of # the provided ring names db = barbara.open("middleoffice;ficc;default") # get /Etc/Something from the 'middleoffice' ring if it exists there, # otherwise try 'ficc' and finally the default ring some_obj = db["/Etc/Something"] </code></pre> <ul> <li>Lots of info about modeling with classes (instruments, books, etc)</li> <li>If you understand excel you will be starting to recognize similarities. </li> <li>In Excel, spreadsheets cells are also updated based on their dependencies, also as a directed acyclic graph. Dagger allows people to put their Excel-style modelling calculations into Python, write tests for them, control their versioning without having to mess around with files like CDS-OF-CDS EURO DESK 20180103 Final (final) (2).xlsx. </li> <li>Dagger is a key technology to get financial models out of Excel, into a programming language and under tests and version control.</li> <li>Time to drop a bit of a bombshell: the source code is in Barbara too, not on disk. Remain composed. It's kept in a special Barbara ring called sourcecode.</li> <li>Interesting table structures, like Pandas, but closer to a DB (MnTable)</li> <li>Over time the divergence between Bank Python and Open Source Python grows. Technology churns on both sides, much faster outside than in of course, but they do not get closer.</li> <li>Minerva has its own IDE - no other IDEs work if you keep your source files in a giant global database. </li> <li>What I can't understand is why it contains its own web framework. Investment banks have a one-way approach to open source software: (some of) it can come in, but none of it can go out</li> <li>BTW, I “read” this with <a href="https://www.naturalreaders.com/"><strong>naturalreaders app</strong></a></li> </ul> <p>C<strong>hris #3:</strong> <a href="https://github.com/kitao/pyxel"><strong>Pyxel</strong></a></p> <ul> <li>Pyxel is a ‘retro gaming console’ written in Python!</li> <li>This might seem old and un-shiny, but the restrictions imposed by the environment gift <strong>simplicity</strong> <ul> <li>Vastly decreased learning time and effort compared to something like Unity or even Pygame</li> <li>Straight forward simple commands, just like it was for micro-computers in the 80s <ul> <li>cls(), line(), rect(), circ() etc.</li> </ul></li> </ul></li> <li>Pyxel is somewhat more Python and less console than others like PICO-8 or TIC-80 but this is a feature! Use your regular development environment to build.</li> </ul> <p><strong>Brian #4:</strong> <a href="https://hynek.me/til/ditch-codecov-python"><strong>How to Ditch Codecov for Python Projects</strong></a></p> <ul> <li>Hynek Schlawack</li> <li>Codecov is a third party service that checks your coverage output and fails a build if coverage dropped. </li> <li>It’s not without issues.</li> <li>Hynek is using <a href="https://coverage.readthedocs.io/">coverage.py</a> <code>--fail-under</code> flag in place of this in GitHub actions.</li> <li>It’s not as simple as just adding a flag if you are using <code>--parallel</code> to combine coverage for multiple test runs into one report.</li> <li>Hynek is utilizing the coverage output as an artifact for each test, then pulling them all together in a <code>coverage</code> stage combine and check coverage.</li> <li>He provides the snippet of GH Action, and even links to a <a href="https://github.com/hynek/structlog/blob/main/.github/workflows/main.yml">working workflow file</a> using this process. Nice!</li> </ul> <p><strong>Michael #5:</strong> <a href="https://github.com/nschloe/tiptop"><strong>tiptop (like glances)</strong></a></p> <ul> <li>via Zach Villers</li> <li>tiptop is a command-line system monitoring tool in the spirit of <a href="https://en.wikipedia.org/wiki/Top_(software)">top</a>. It displays various interesting system stats, graphs it, and works on all operating systems.</li> <li>Really nice visualization for your servers</li> <li>Good candidate for <strong>pipx</strong> install tiptop</li> </ul> <p><strong>Chris #6:</strong> <a href="https://github.com/irmen/pyc64"><strong>pyc64</strong></a></p> <ul> <li>A Commodore 64 emulator written in pure Python!</li> <li>Not 100% complete - screen drawing is PETSCII character mode only <ul> <li>This still allows for a lot of interesting apps &amp; exploration</li> </ul></li> <li>Actual machine emulation using <a href="https://github.com/mnaberez/py65">py65</a> - a pure Python 6502 chip emulator!</li> <li>You can pop to a Python REPL from inside the emulator and examine data structures like memory, registers, etc!</li> <li>An incredible example of what Python is capable of</li> <li>0.6 Mhz with CPython and over 2Mhz with pypy!</li> </ul> <p><strong>Extras</strong></p> <p>Michael:</p> <ul> <li>Michael’s <a href="https://twitter.com/FlaskCon/status/1461245426082799618"><strong>FlaskCon 2021 HTMX Talk</strong></a></li> </ul> <p><strong>Chris</strong>: </p> <ul> <li><a href="https://amazon.jobs/en/internal/search?offset=0&amp;result_limit=10&amp;sort=relevant&amp;distanceType=Mi&amp;radius=1024km&amp;hiring_manager[]=Sean%20Stewart%20(zjamste)&amp;latitude=&amp;longitude=&amp;loc_group_id=&amp;loc_query=&amp;base_query=&amp;city=&amp;country=&amp;region=&amp;county=&amp;query_options=&amp;">Amazon OpsTech IT is hiring!</a> (If deemed appropriate :) <a href="https://amazon.jobs/en/internal/search?offset=0&amp;result_limit=10&amp;sort=relevant&amp;distanceType=Mi&amp;radius=1024km&amp;hiring_manager[]=Sean%20Stewart%20(zjamste)&amp;latitude=&amp;longitude=&amp;loc_group_id=&amp;loc_query=&amp;base_query=&amp;city=&amp;country=&amp;region=&amp;county=&amp;query_options=&amp;"></a></li> </ul> <p><strong>Joke:</strong> <a href="https://www.newyorker.com/cartoons/daily-cartoon/wednesday-november-17th-daylight-saving-screens"><strong>I hate how the screens get bright so early this time of year</strong></a></p>
Categories: FLOSS Project Planets

Trey Hunner: Python Black Friday &amp; Cyber Monday Sales (2021)

Planet Python - Mon, 2021-11-22 23:41

This is my annual compilation post of Black Friday and Cyber Monday deals I’ve found related to Python and Python learning.

Note: Some sales likely aren’t announced yet, so I will update this post on Black Friday and Cyber Monday.

50% off dozens of Python screencasts (Python Morsels)

Yes, the self-promotion comes first.

The Python Morsels Lite plan has evolved a lot since I first launched it and it’s long overdue for a price increase. This plan includes access to over 90 Python screencasts (a new one added each week) as well as a monthly Python exercise (your choice from novice to advanced Python).

From December 1, 2021 onward the price for the Python Morsels Lite plan will be $10/month or $100/year. Until November 30, you can signup for $5/month or $50/year (and you’ll lock-in that price for as long as you’re subscribed). This is the lowest price I’ll ever offer this plan for.

Save 50% on the Python Morsels Lite plan by signing up from now until Cyber Monday.

Get the Python Morsels Lite plan for just $50/year

Reuven Lerner’s Python courses and Weekly Python Exercise

Reuven Lerner is offering 30% off all his products (intro Python bundle, advanced Python bundle, data analytics bundle, and Weekly Python Exercises, and more) through Monday. Enter the coupon BF2021 if needed (though that link should apply the coupon already).

If you like Python Morsels, you might want to check out Reuven’s Weekly Python exercise as well. Both are based around exercise-driven learning.

Matt Harrison’s books and courses on Python, data science, and Pandas

Matt Harrison is offering a 40% discount on all his courses and books (on Python, Pandas, and data science). See his MetaSnake store for more details. Enter coupon code BF40 if needed (though the coupon code should already be applied when you click that link).

Python Essentials for Data Scientists (Kevin Markham of Data School)

Kevin Markham is offering 33% off his new course, Python Essentials for Data Scientists. The course will be $33 instead of $49 from Black Friday through Cyber Monday. The BLACKFRIDAY coupon is already applied from that link, but you’ll need to wait until Friday (when enrollment to officially opens) to hit the Buy button.

Brian Okken’s Pytest book (Pragmatic Bookshelf)

Pragmatic Bookshelf is offering 40% off all books with the code turkeysale2021, including Brian Okken’s Pytest book which is just under $15 with the coupon.

Django-specific sales

Adam Johnson’s Speed Up Your Django Tests is on sale for 50% off (it’s normally $49). If you’re using Django and writing automated tests (you should be!) check out Adam’s book.

Will Vincent is also offering a 50% discount on his Django books, via a 3 book bundle. Each of Will’s Django books is normally $40, but during his Black Friday sale you can get all 3 books for $59.

Test Driven is offering a 25% discount on a 3 Django course bundle from Michael Herman and friends. You can get three $30 courses for just $68 in total.

Check out Adam Johnson’s Django-related deals for Black Friday and Cyber Monday post for more Django-related deals.

More Sales To Watch Out For

Talk Python has been offering a Black Friday sale on their everything bundle every year for a while now (often a discount of $50 or more). They’ll likely offer another sale this year so check their site on Black Friday for details.

Mike Driscoll often offers Black Friday and Cyber Monday sales on his Python books.

No Starch press often offers Black Friday discounts on lots of Python books (Al Sweigart, Eric Mathes, and more).

PyBites sometimes holds Black Friday and Cyber Monday sales. Check the PyBites site on Black Friday in case they’re holding a sale.

Lots of screencasts, exercises, books, and courses on sale

This blog post is not up-to-date yet. Check back on Black Friday for more Python-related sales as I hear about them (and feel free to comment below if you find more).

Also don’t go too wild on sales! If you don’t have time to work through a Python course, don’t buy it. If you’re unlikely to ever read that Python book, don’t get it. And if you can’t commit to weekly Python learning, don’t subscribe!

Consider picking a few things that look like you’ll actually use them, and buy them. Python educators love your support, but we also like happy customers who use and love our services.

Also if you have money to spend but nothing to spend it on (that’s a great problem to have…), do as Python educator Allen Downey suggested and donate to charity. You could become a PSF member or give to highly effective charities via GiveWell or The Life You Can Save.

If you have a question about the Python Morsels sale please email me. If you have a question about the other sales, reach out to the folks running it.

Happy coding!

Categories: FLOSS Project Planets

parallel @ Savannah: GNU Parallel 20211122 ('Peng Shuai') released [stable]

GNU Planet! - Mon, 2021-11-22 19:36

GNU Parallel 20211122 ('Peng Shuai') [stable] has been released. It is available for download at: lbry://@GnuParallel:4

No new functionality was introduced so this is a good candidate for a stable release.

Quote of the month:

  GNU parallel 便利すぎ
    -- @butagannen@twitter 豚顔面

New in this release:

  • Bug fixes and man page updates.

News about GNU Parallel:

Get the book: GNU Parallel 2018 http://www.lulu.com/shop/ole-tange/gnu-parallel-2018/paperback/product-23558902.html

GNU Parallel - For people who live life in the parallel lane.

If you like GNU Parallel record a video testimonial: Say who you are, what you use GNU Parallel for, how it helps you, and what you like most about it. Include a command that uses GNU Parallel if you feel like it.

About GNU Parallel

GNU Parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU Parallel can then split the input and pipe it into commands in parallel.

If you use xargs and tee today you will find GNU Parallel very easy to use as GNU Parallel is written to have the same options as xargs. If you write loops in shell, you will find GNU Parallel may be able to replace most of the loops and make them run faster by running several jobs in parallel. GNU Parallel can even replace nested loops.

GNU Parallel makes sure output from the commands is the same output as you would get had you run the commands sequentially. This makes it possible to use output from GNU Parallel as input for other programs.

For example you can run this to convert all jpeg files into png and gif files and have a progress bar:

  parallel --bar convert {1} {1.}.{2} ::: *.jpg ::: png gif

Or you can generate big, medium, and small thumbnails of all jpeg files in sub dirs:

  find . -name '*.jpg' |
    parallel convert -geometry {2} {1} {1//}/thumb{2}_{1/} :::: - ::: 50 100 200

You can find more about GNU Parallel at: http://www.gnu.org/s/parallel/

You can install GNU Parallel in just 10 seconds with:

    $ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
       fetch -o - http://pi.dk/3 ) > install.sh
    $ sha1sum install.sh | grep c82233e7da3166308632ac8c34f850c0
    12345678 c82233e7 da316630 8632ac8c 34f850c0
    $ md5sum install.sh | grep ae3d7aac5e15cf3dfc87046cfc5918d2
    ae3d7aac 5e15cf3d fc87046c fc5918d2
    $ sha512sum install.sh | grep dfc00d823137271a6d96225cea9e89f533ff6c81f
    9c5198d5 31a3b755 b7910ece 3a42d206 c804694d fc00d823 137271a6 d96225ce
    a9e89f53 3ff6c81f f52b298b ef9fb613 2d3f9ccd 0e2c7bd3 c35978b5 79acb5ca
    $ bash install.sh

Watch the intro video on http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1

Walk through the tutorial (man parallel_tutorial). Your command line will love you for it.

When using programs that use GNU Parallel to process data for publication please cite:

O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014.

If you like GNU Parallel:

  • Give a demo at your local user group/team/colleagues
  • Post the intro videos on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
  • Get the merchandise https://gnuparallel.threadless.com/designs/gnu-parallel
  • Request or write a review for your favourite blog or magazine
  • Request or build a package for your favourite distribution (if it is not already there)
  • Invite me for your next conference

If you use programs that use GNU Parallel for research:

  • Please cite GNU Parallel in you publications (use --citation)

If GNU Parallel saves you money:

About GNU SQL

GNU sql aims to give a simple, unified interface for accessing databases through all the different databases' command line clients. So far the focus has been on giving a common way to specify login information (protocol, username, password, hostname, and port number), size (database and table size), and running queries.

The database is addressed using a DBURL. If commands are left out you will get that database's interactive shell.

When using GNU SQL for a publication please cite:

O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases Using DBURLs, ;login: The USENIX Magazine, April 2011:29-32.

About GNU Niceload

GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit.

Categories: FLOSS Project Planets

Catch up: Calamares

Planet KDE - Mon, 2021-11-22 18:00

It’s been over a month since I last wrote anything; I acted as a caregiver for my mom for a while, then she moved house which led to frantic painting, unboxing, furniture assembling and all the other time-and-energy sinks associated with moving. Since the end of october I’ve been mostly back at work doing Calamares and KDE and FreeBSD- related things. Let’s catch up on Calamares, first.

  • Calamares 3.2.45 was released at the end of october. This was a first release of Calamares to have some small support for ZFS, thanks to new contributor Evan James. I’m really happy to have new people participating in development – Calamares is there for everyone and should have the things that every (and any) distro needs, either in core or in extensions.
  • Speaking of new contributors, Hacktoberfest was a disappointment in that it yielded nothing-at-all. Not even a nibble. I wrote up some more issues in my Hacktoberfest introductory fashion. That at least is not a total loss, because it involves a bunch of up-front thinking about how an issue could be solved, so later it can be done (e.g. by me or another regular contributor) a little more quickly.
  • Calamares 3.2.46 was released two weeks later. That is the release cadence I try to achieve: push out new things regularly, with whatever is done or new. With a bunch of Arch-derivatives testing the code, and KDE neon unstable doing so too, this shakes things out relatively quickly. This release did some major under-the-hood reworking so that it’s much easier to manage external processes in Calamares; medium term this will shake up a number of the Python modules, too.
  • And right on schedule two weeks later Calamares 3.2.47 was released, now with better privacy controls, and more complete ZFS support.

The ZFS bits are something I’m quite excited about, but they do ask that the distro do some work – the ZFS kernel modules and tools need to be on the ISO, for instance. That doesn’t happen magically, and distro-makers still need to do their thing – and make their own choices; there’s nothing forcing ZFS onto distributions, but Calamares (through Evan) now makes it possible.

Thanks screen from Archcraft Translations

Calamares is available in about 75 languages. 17 of those are at 100% translation, which is a really good statistic. Recent notable work has been to push Sinhala and Farsi (Persian) to 100% translation.

Screenshots with Sinhala and Farsi

Calamares still isn’t great in RTL-mode, but I’ve also never had any reports asking for it (or better yet, pull-requests doing something about it). Those few RTL-writing-people whom I have spoken with about it have told me that crappy layout is so ubiquitous that they would be surprised and concerned if things swapped around in Calamares when switching from RTL to LTR languages.

RTL is “Right to Left”, like Arabic script, which is used for Arabic and Farsi. LTR is “Left to Right”, like Cyrillic script, which is used for Russian and Azerbaijani. To be honest I don’t know which direction to read Sinhala, but I think it’s beautiful.

Distribution Notes

Since Calamares is used by several dozen Linux distributions, it’s convenient to be able to build-and-test on a live ISO. I sat down and wrote out a KDE neon testing and Arch testing guide. That helped me not a few days later when I had full instructions at hand for testing a strange install issue. By writing down the instructions for myself, I didn’t have to think about it much when I needed them.

Similar notes could probably be written for openSUSE, Fedora, and others. The central bit of software is the deploycala.py script which does the heavy lifting; PRs to keep it up-to-date with distro’s are always welcome.

Broader Community and the Future

There are several places where Calamares is developed: the core repository, an extensions repository for more specialized modules and bits, a KDE repository for KDE-specific parts. Some distributions have their own collections of modules. Penguins Eggs is an interesting idea for duplicating Linux installations that also leverages Calamares and has some custom bits.

Distro’s are welcome to add modules to core or extensions. Specialized modules are slowly growing in number, and that’s fine – I’d rather have a good shared central repo of modules with good customizability and configurability than tons of forks.

For the near future, my plans are:

  • get the KDE modules off the ground.
  • reach some level of API stability and branch off a 3.3 LTS version of Calamares.
  • move the development and short-cycle stream of Calamares releases to a 3.4 version. That will give some distro’s a stable thing to work with – useful if they have their own C++-based modules where API / ABI stability has long been an issue in Calamares – and allow us to ditch a whole bunch of backwards-compatbility cruft (e.g. I will no longer be supporting Qt 5.12).

So the future is sunny; kind of like this screenshot from Garuda:

Summary screenshot from Garuda Linux
Categories: FLOSS Project Planets

Jonathan Wiltshire: Mischief managed

Planet Debian - Mon, 2021-11-22 17:50

I’m finally paying up a certain amount of household technical debt, including investigating some exciting mystery cabling and insulating the space it inhabits. This has meant pulling down large chunks of ceiling (eventually, most or all of it for the insulation) on a cable hunt.

Turns out the best tool for this part of the job is a decent length of 4 by 2, some borrowed muscle, and a certain amount of bravery. Once a couple of holes have been cut the old-fashioned way to be sure there’s nothing crucial above the ceiling (like the other side of the felt roof), the 4×2 really comes into its own:

To use the 4×2, aim for a gap between two joists and imagine you’re holding a caber. Launch it. The ceiling will come off far worse than the lump of wood you’re holding.

We found the mystery cable, but didn’t really solve the mystery it creates and in the process uncovered another bizarre installation. The local lighting circuit is mostly a spur system in that white junction box by the RSJ. The overhead supplies dive under the RSJ through the junction box to the light switch including a full 3-core feed, not the usual loop-in system used in the rest of the house (I am not sure how prevalent loop-in systems are in other countries, they’re sometimes called three-plate systems – but they’re very common in the UK).

It does at least explain why I could never reverse-engineer the setup from the ceiling roses alone, which had only half the cores in the fitting than expected throughout the room (it wasn’t even that the first fitting was looped in and being a supply for the others).

On the other hand, normalising everything to a loop-in system and removing that awful rats nest of TPE should be straightforward. Neutral isn’t required in that switch so that’s one less problem.

I couldn’t resist labelling the switch in its relocated position:

Unfortunately, as valuable as that exercise was, I still have to get to the bottom of the original mystery cable which is at varying points 6mm2, 2.5mm2 and 1.5mm2 with apparently no current limiter or switch separation. Time for a bit more 4 by 2…

Categories: FLOSS Project Planets

Dries Buytaert: PHP Foundation launched

Planet Drupal - Mon, 2021-11-22 15:47

There is a common misconception that large open source projects are well-funded. In practice, many rely on a small group of maintainers.

The PHP programming language is one of them. Despite being used by 75%+ of the web, PHP only has a few full-time contributors.

That is why the PHP Foundation is launching. Its mission: The PHP Foundation will be a non-profit organization whose mission is to ensure the long life and prosperity of the PHP language..

Acquia is proud to support the PHP Foundation by contributing $25,000 to the foundation, alongside Automattic, JetBrains, Laravel and others. Our donations will help fund the development of PHP.

PHP is vital to the functioning of governments, schools, non-profits, private companies, public companies, and much more. If your organization relies on PHP, I'd encourage you to make a contribution.

Large open source projects like PHP need meaningful, long-term support. I remain very passionate about how to make Open Source production more sustainable, more fair, more egalitarian, and more cooperative. It will be interesting to see how the PHP Foundation develops.

Categories: FLOSS Project Planets

Golems GABB: The Gutenberg editor in Drupal: what it is like & how it works

Planet Drupal - Mon, 2021-11-22 15:21
The Gutenberg editor in Drupal: what it is like & how it works Editor Mon, 11/22/2021 - 22:21

In the long-term competition between CMSs, WordPress has always had an ace up its sleeve — super intuitive content creation experiences. People who have been using WordPress may be reluctant to start working with Drupal.

This needs to be resolved! This is what the Drupal creators thought and decided to make Drupal easier for editors out of the box. A giant amount of work has been done in this area, so Drupal is now totally different from what it was like several years ago.

Categories: FLOSS Project Planets

Talking Drupal: Talking Drupal #322 - Camp Planning

Planet Drupal - Mon, 2021-11-22 14:00

Today we are talking about Camp Planning with April Sides.

TalkingDrupal.com/322

Topics
  • Can you tell us about Drupal Camp Asheville?
  • Why is camp planning “Your Jam”?
  • How do you think virtual events have impacted camps?
  • Do you think we will get back to In-person camps in 2022?
  • What are your thoughts on hybrid camp formats in the future?
  • What is neurodiverse inclusion?
  • Why is it important for events and the Drupal community?
  • What is your favorite aspect of camp planning?
  • Biggest challenge
  • Biggest Success
  • Tips for starting a new camp
  • How to help with an existing camp
Resources

Drive by Daniel Pink Notist - John Notiat - April Event Organizers Working Group Event Accessibility Playbook Drupal Camp Asheville Drupal Camp Asheville Project Asheville Twitter

Hosts

Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi April Sides - @weekbeforenext

Module of the Week

DropzoneJS Drupal integration for DropzoneJS - an open source library that provides drag’n’drop file uploads with image previews.

Categories: FLOSS Project Planets

Łukasz Langa: Weekly Report, November 15 - 21

Planet Python - Mon, 2021-11-22 13:25

Pretty typical week that started with a bang: an out of schedule release of Python 3.9 to fix a regression of argparse that turned out to be pretty disruptive for our users.

Categories: FLOSS Project Planets

Cross Compile to PinePhone with Clang

Planet KDE - Mon, 2021-11-22 10:22
Cross Compile to PinePhone with Clang Click Here for GCC Part one Click Here for GCC Part three Advantages of Clang If you have read the previous posts about cross-compiling with gcc, you know that we need to install the cross-compiler first. This is not that difficult, but it has a few pitfalls. In particular, the one provided by ArchLinux by default does not work in our use case. The good thing about clang is that clang is inherently a cross-compiler.
Categories: FLOSS Project Planets

Promet Source: How to Create a Static Page from a Dynamic Drupal Site

Planet Drupal - Mon, 2021-11-22 10:09
When designing, developing, and migrating a large county site that incorporates more than 40 separate sites to a Drupal CMS, it can be expected that some site owners will have particular requirements that pose distinct challenges. One such condition emerged for us at Promet Source earlier this year during a Drupal migration project for the Orange County, Calif., website. 
Categories: FLOSS Project Planets

Real Python: Python Community Interview With Eric Wastl

Planet Python - Mon, 2021-11-22 09:00

This week, we’re joined by Eric Wastl, a Senior Architect at TCGPlayer and the founder of Advent of Code (AoC). Join us as we discuss the inception of AoC, how to avoid common pitfalls when solving code challenges in AoC, and what Eric gets up to in the “3.8 seconds” of free time he has per year.

Ricky: Thanks for joining me, Eric. You’re perhaps most well known for being the founder of Advent of Code, which we’ll talk about shortly, but you’re also the Senior Architect at TCGPlayer. Tell us a little about your day-to-day life there and what interesting problems you get to solve.

Eric: I’ve been with TCGPlayer for about a year. The work I do ranges from tricky algorithms, Kubernetes, vendor selection, and infrastructure scaling to training, architecture planning, technical candidate assessment, and running big internal hackathons.

My days are a mix of things like talking to teams and individuals to help them work through their hardest technical challenges, algorithm design, high-level technical planning, and building things for tooling, automation, and visibility. My job covers many different types of problems!

Read the full article at https://realpython.com/interview-eric-wastl/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Python for Beginners: Graph Operations in Python

Planet Python - Mon, 2021-11-22 08:59

A graph is a non linear data structure used to represent connections between different objects. Generally, graphs are used to represent maps, network, and social media connections. In this article, we will study how to perform different graph operations in Python. We will take a graph and will use it as a running example to perform all the graph operations.

What are different graph operations?

A graph is generally provided in the form of an adjacency list. If we talk about operations on the, there may be the following graph operations. 

  • Print all the vertices of the graph
  • Print all the edges of the graph
  • Insert a vertex into the graph
  • Insert an edge into the graph

We will perform all these graph operations in python. For this, we will use the graph given in the following image.

Graph in Python

Before performing the graph operations, we will construct an adjacency list representation of the above graph as follows.

graph = {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} print("Graph representation in python is:") print(graph)

Output:

Graph representation in python is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} How to print all the vertices of a graph

From the previous post on graphs in python, we know that the vertices of the graph are represented using the keys of the adjacency matrix (which is a python dictionary). Hence, we can print all the vertices of the graph by simply printing the keys of the adjacency matrix. For this, we will use the keys() method of a python dictionary as follows.

graph = {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} print("Graph representation in python is:") print(graph) vertices= list(graph.keys()) print("Vertices in the graph are:",vertices)

Output:

Graph representation in python is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} Vertices in the graph are: ['A', 'D', 'B', 'F', 'C', 'E'] How to print all the edges of the graph

We know that edges are represented in the graph by using a list associated with each vertex. Every vertex stores a list of vertices with which it is connected.  We will traverse through each vertex v1 and create an edge (v1,v2 ) for each vertex present in the list associated with v1. 

Remember that while printing the edges, there will be repetitions because whenever a vertex v2 is present in the list associated with v1, v1 will also be present in the list associated with v2. Hence, while printing the edges, both (v1,v2) and (v2,v1) will be printed which introduces redundancy as (v1,v2) and (v2,v1) both represent the same edge.

To overcome this problem, we will store any edge (v1, v2) as an unordered set. In this way, (v1, v2) will be the same as (v2,v1). After that, we will create a list of edges. Before inserting any new edge to the list, we will first check if the edge is present in the list or not. If any edge is already present in the list, we will not insert any duplicate edge. 

The above process can be implemented in python as follows.

graph = {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} print("Graph representation in python is:") print(graph) edges = [] for vertex in graph: for adjacent_vertex in graph[vertex]: edge = {vertex, adjacent_vertex} if edge not in edges: edges.append(edge) print("Edges in the graph are:", edges)

Output:

Graph representation in python is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} Edges in the graph are: [{'B', 'A'}, {'A', 'D'}, {'A', 'E'}, {'A', 'F'}, {'B', 'F'}, {'B', 'C'}]  How to insert a vertex into the graph

We know that a vertex is represented using keys of the adjacency list. To insert a vertex into the graph, we will insert the vertex as a key into the graph with an empty list  as its associated value. The empty list represents that the current vertex is not connected to any other vertex. We can implement it as follows.

graph = {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} print("Original Graph representation is:") print(graph) # insert vertex G graph["G"] = [] print("The new graph after inserting vertex G is:") print(graph)

Output:

Original Graph representation is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A']} The new graph after inserting vertex G is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A'], 'G': []} How to insert an edge into the graph

Inserting an edge into the graph is much simpler than printing the edges. We know that each vertex contains a list of vertices to which it is connected. So, to insert an edge (v1,v2), we will simply insert the vertex v1 to the list of vertices associated with v2 and v2 to the list of vertices associated with the vertex v1. 

In this way, It will be established that v1 is connected to v2 and v2 is connected to v1. Hence, the vertex (v1,v2) will be added in the graph. We can implement it as follows.

graph ={'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A'], 'G': []} print("Original Graph representation is:") print(graph) # insert vertex (D,G) graph["D"].append("G") graph["G"].append("D") print("The new graph after inserting edge (D,G) is:") print(graph)

Output:

Original Graph representation is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A'], 'G': []} The new graph after inserting edge (D,G) is: {'A': ['B', 'D', 'E', 'F'], 'D': ['A', 'G'], 'B': ['A', 'F', 'C'], 'F': ['B', 'A'], 'C': ['B'], 'E': ['A'], 'G': ['D']} Conclusion

In this article, we have implemented different graph operations in python. To know more about other data structures, you can read this article on Linked list in python.

The post Graph Operations in Python appeared first on PythonForBeginners.com.

Categories: FLOSS Project Planets

Codementor: Introduction: Python

Planet Python - Mon, 2021-11-22 07:34
Python could be a completely practical programming language that will do something virtually the other language can do, at comparable speeds. Python is capable of threading and GPU processing just like the other language. Most of the information process modules are literally simply Python wrappers around C/C++ code.
Categories: FLOSS Project Planets

Codementor: How to Send SMS in Python Using Plivo’s SMS API

Planet Python - Mon, 2021-11-22 05:35
How to Send SMS in Python Using Plivo’s SMS API
Categories: FLOSS Project Planets

Ricardo Mones: Claws Mail 4 in experimental

Planet Debian - Mon, 2021-11-22 04:49

A full month has passed since Claws Mail 4.0.0 was uploaded to Debian experimental, and, somewhat surprisingly, I've received no bug report about it.

This of course can be either because nobody has been brave enough to install it or because well, it works really nice.

For those who don't know what I'm talking about, just note that this version is the first Debian upload for the GTK+3 version of Claws Mail. There was an initial upstream release, namely 3.99, but it was less polished and also I was very busy, so I decided not to upload it. Since then I've been using git's 'gtk3' branch daily without problems, so, for me, it's as stable as its GTK+2 counterpart. There's still some rough edges, of course.

Note also that, if everything goes well, Claws Mail 4.x will be the version to be shipped with Debian 12 (bookworm).

Categories: FLOSS Project Planets

Web Omelette: How to create a Drupal Commerce shipment promotion offer

Planet Drupal - Mon, 2021-11-22 04:30

In this article we are going to see how to create a shipment promotion offer to reduce the shipping cost up to a maximum fixed amount.

Categories: FLOSS Project Planets

Test and Code: 171: How and why I use pytest's xfail - Paul Ganssle

Planet Python - Mon, 2021-11-22 03:00

Paul Ganssle, is a software developer at Google, core Python dev, and open source maintainer for many projects, has some thoughts about pytest's xfail.
He was an early skeptic of using xfail, and is now an proponent of the feature.
In this episode, we talk about some open source workflows that are possible because of xfail.

Special Guest: Paul Ganssle.

Sponsored By:

Support Test & Code in Python

Links:

<p>Paul Ganssle, is a software developer at Google, core Python dev, and open source maintainer for many projects, has some thoughts about pytest&#39;s xfail.<br> He was an early skeptic of using xfail, and is now an proponent of the feature.<br> In this episode, we talk about some open source workflows that are possible because of xfail. </p><p>Special Guest: Paul Ganssle.</p><p>Sponsored By:</p><ul><li><a href="https://testandcode.com/pycharm" rel="nofollow">PyCharm Professional</a>: <a href="https://testandcode.com/pycharm" rel="nofollow">Try PyCharm Pro for 4 months and learn how PyCharm will save you time.</a> Promo Code: TESTANDCODE22</li></ul><p><a href="https://www.patreon.com/testpodcast" rel="payment">Support Test & Code in Python</a></p><p>Links:</p><ul><li><a href="https://blog.ganssle.io/articles/2021/11/pytest-xfail.html" title="How and why I use pytest's xfail" rel="nofollow">How and why I use pytest's xfail</a> &mdash; Paul's blog post mentioned in the episode</li><li><a href="https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports" title="Craft Minimal Bug Reports" rel="nofollow">Craft Minimal Bug Reports</a> &mdash; Matthew Rocklin's article</li><li><a href="https://testandcode.com/111" title="episode 111: Subtests in Python with unittest and pytest - Paul Ganssle" rel="nofollow">episode 111: Subtests in Python with unittest and pytest - Paul Ganssle</a></li><li><a href="https://testandcode.com/165" title="episode 165: pytest xfail policy and workflow" rel="nofollow">episode 165: pytest xfail policy and workflow</a></li><li><a href="https://testandcode.com/166" title="episode 166: unittest expectedFailure and xfail" rel="nofollow">episode 166: unittest expectedFailure and xfail</a></li></ul>
Categories: FLOSS Project Planets

Django Weblog: Django 4.0 release candidate 1 released

Planet Python - Mon, 2021-11-22 01:39

Django 4.0 release candidate 1 is the final opportunity for you to try out the abundance of new features before Django 4.0 is released.

The release candidate stage marks the string freeze and the call for translators to submit translations. Provided no major bugs are discovered that can't be solved in the next two weeks, Django 4.0 will be released on or around December 6. Any delays will be communicated on the django-developers mailing list thread.

Please use this opportunity to help find and fix bugs (which should be reported to the issue tracker). You can grab a copy of the package from our downloads page or on PyPI.

The PGP key ID used for this release is Mariusz Felisiak: 2EF56372BA48CD1B.

Categories: FLOSS Project Planets

Mike Driscoll: PyDev of the Week: Paul McGuire

Planet Python - Mon, 2021-11-22 01:05

This week we welcome Paul McGuire (@ptmcguire) as our PyDev of the Week! Paul is the author of the pyparsing package. Paul is a Site Reliability Engineer for Indeed.com. You can find out what he is up to by checking out his website.

Let's take a few moments to get to know Paul!

Can you tell us a little about yourself (hobbies, education, etc):

I grew up as the math/science nerd surrounded by artists. My older brothers were a writer, a sculptor, and an architect. I took piano lessons for a few years, and I got to go see the Cleveland Orchestra many times while I was in high school (if you volunteered as an usher, you got in for free). So I had a good dose of the arts to go with the math and science. Eventually I was drawn to engineering and attended Rensselaer Polytechnic Institute, but I still kept up my appreciation of the arts.

In the mid 80's I read an article about the computer-generation algorithms used to create the landscapes for Star Wars, and thought that would be an interesting little program to write. I've gone back to that little program several times, and around 2008 I started doing abstract art prints on canvas, which then became other products as well - you can see them at paulmcguireart.com.

 

Why did you start using Python?

I was just starting to work with two friends who had started a consulting company. I had worked with Tcl previously, so I knew that I wanted to have a scripting language in my consulting toolkit. But I disliked Tcl's "everything's a string" data model. After looking at a couple of languages, I settled on Python.

I immediately loved the notion of using whitespace to delimit blocks. I had previously worked on a C development team that spent 2 weeks debating "where should the braces go?" and having blocks with no braces just made that whole issue go away (though maybe got traded for "tabs vs. spaces"?)

After about 10 months, I thought about the core ideas in pyparsing, and so put out version 0.1 in late 2003. I've been using Python ever since.

 

What other programming languages do you know and which is your favorite?

I've been around a while, so I've collected a number of languages. I started with BASIC in middle and high school, then FORTRAN in college. Through a succession of jobs I picked up (in rough chronological order) Pascal, PL/I, COBOL, C, Smalltalk, Java, C++, (insert Python here), C#, Boo, Groovy, and most recently Golang.

My favorite is probably the Python mode of the Processing environment. I've also used Processing's Java mode, and I have described it to others as "Java for artists". Processing is great for doing quick graphical work, with some really beautiful results, and it ports to multiple platforms pretty easily (I've used it to prototype a couple of small Android apps for my phone).

 

What projects are you working on now?

I'm *finally* finishing release 3.0.0 of pyparsing, which started 2 years ago - it was a major code restructure, it cleared out the Py2 compatibility code, plus some other stuff happened. I've described it as feeling like I'm walking a marathon.

My other open source projects are a pyparsing spin-off called plusminus (pyparsing/plusminus (github.com)), a library for incorporating custom, secure arithmetic expression evaluation into Python applications. The base parser guards against common eval() security and DOS attacks, and handles expressions like:

There are also custom parsers in the examples to parse and evaluate "30% off of 50", "d20+3d4", and "3 days and 2 hours from now".

And littletable (ptmcg/littletable: An in-memory database of Python objects, searchable using quasi-SQL API (github.com)), which started as an ORM experiment that has turned out to be useful on and off, especially working with CSV data. Littletable is pretty lightweight, so it gives a nice ORM-ish wrapper around lists of objects - it infers column names from the objects' attributes. Last winter I also added some full-text search. (Ironically, a week later I had a job interview coding test where I had to implement a full-text search!) You can use littletable to quickly read, manipulate, and write CSV files without having to wield the pandas sledgehammer.

I'm also working with Alex Martelli and Steve Holden on a 4th edition of Python in a Nutshell. The 3rd ed. was written when Python 3.6 was just coming out, and there have been some significant new features added to Python since then (plus we can also finally put Python2 in the rear-view mirror, and prune all the "but in v2, it looks like this…" cruft).

 

Which Python libraries are your favorite (core or 3rd party)?

itertools in the stdlib. Especially groupby. I wrote a couple of blog posts about using groupby in some novel ways, comparing it to a greeter who seats groups of diners at a restaurant. (Blog link: Things Python | Python bits collected along the way… (wordpress.com))

Second place in the stdlib is collections, especially deque and defaultdict.

rich from Will McGugan is really fun - I used part of it in littletable for pretty tabular output. I've used tqdm in the past for progress bars, but I want to give rich progress bars a try. And Will's textual package looks pretty cool, but I haven't used it yet.

 

How did the pyparsing package come about?

1. I was bad at regex.  2. I was annoyed at regex's use of common characters (like "." and "?" and "*") for metacharacters, and so requiring the ugly "\" escape if they were needed as literal content. 3. I had a long-standing interest in parsing utilities, having previously written an embedded arithmetic parser written in PL/I as part of a statistical process control package. So writing a simple 4-function arithmetic parser was a good early exercise while learning Python, and it evolved into an object-based API, in which you could write "OneOrMore(expr)" instead of "(expr)+". It is more verbose, but that verbosity makes it easier to revisit several months down the road when your existing parser needs a tweak.

(I've since gotten a lot better at regex.)

 

What are some neat features you can do with pyparsing that you don't think most people are aware of?

First off, 2 new features in 3.0.0, railroad diagrams (contributed by Michael Milton) and left-recursive parsing (contributed by Max Fischer). The railroad diagrams look very nice but they are still only lightly tested, so they will evolve a bit in the next few point releases. Here is a sample:

And a more thorough example from the pyparsing test suite:

The LR parsing walks a similar path as the PEG parser that was added to Python, with a twist - pyparsing's parse actions complicate this process a bit. I've encouraged Max to do a PyCon presentation on this work, I think it is really interesting.

 

In pyparsing 3.0.0, I am also adding PEP-8 names (like "parse_string") in place of the Javaesque names (like "parseString"). When I first wrote pyparsing, I had worked in C before and was familiar with snake case naming, which goes back to the dawn of C programming. But I had been working more recently in Smalltalk and Java. So at that time, I was sure that the more modern camel case naming was going to become the de facto convention, so I stuck with that for pyparsing. Since then, camel cased Python has pretty much fallen into disfavor, even though you still see it in Java-influenced stdlib modules like logging (from log4j) and unittest (from junit). Pyparsing 3.0.0 includes the new names, but also defines the old names as synonyms so that existing code does not require a huge rewrite in order to upgrade to it. The synonyms will be kept around for a bit, but new code should use the PEP-8 snake case names.

 

Is there anything else you’d like to say?

I've probably run on enough.


Thanks for doing the interview, Paul!

The post PyDev of the Week: Paul McGuire appeared first on Mouse Vs Python.

Categories: FLOSS Project Planets

Pages