FLOSS Project Planets

PyCoder’s Weekly: Issue #633 (June 11, 2024)

Planet Python - Tue, 2024-06-11 15:30

#633 – JUNE 11, 2024
View in Browser »

String Interpolation in Python: Exploring Available Tools

In this tutorial, you’ll learn about the different tools that Python provides for performing string interpolation. String interpolation allows you to create new strings by inserting different objects into a string template.
REAL PYTHON

Notebooks for Fundamentals of Music Processing

This is a collection of Python Notebooks for teaching and learning the fundamentals of music processing. Examples include illustrations, sound samples, math, and more.
INTERNATIONAL AUDIO LABS

Upgrade Python Versions Without the Pain

Stop wasting 30% of your team’s sprint on maintaining legacy codebases. Automatically migrate and keep up-to-date on Python versions, so that you can focus on being productive while staying secure, without the risk of breaking changes - Get a code assessment today →
ACTIVESTATE sponsor

Python’s Many Command-Line Utilities

This article describes every command-line tool included with Python, each of which can be run with python -m module_name.
TREY HUNNER

String Interpolation in Python (Quiz)

Take this quiz to test your understanding of the available tools for string interpolation in Python, as well as their strengths and weaknesses. These tools include f-strings, the .format() method, and the modulo operator.
REAL PYTHON

Python 3.12.4 Released

See the full list of changes in this release
CPYTHON DEV BLOG

PEP 712 Rejected

This Python Enhancement Proposal “Adding a ‘converter’ parameter to dataclasses.field” was determined to have an insufficient number of use cases.
PYTHON

Python 3.13.0 Beta 2 Released

CPYTHON DEV BLOG

Articles & Tutorials What Are CRUD Operations?

CRUD operations are the cornerstone of application functionality. Whether you access a database or interact with a REST API, you usually want to create, retrieve, update, and delete data. In this tutorial, you’ll explore how CRUD operations work in practice.
REAL PYTHON

What We Talk About When We Talk About System Design

Mahesh talks about the rules he has encountered when doing research on designing large systems. Guidelines include late-binding on the design, focusing on the problem rather than existing systems, talking about other applications, and more.
MAHESH BALAKRISHNAN

Get Your Own AI Agent to Answer Questions From Your Database

Introducing “Database Mind” - a ready-to-use AI system designed for easy integration into your projects. As part of the “Minds Endpoints” AI platform, it offers a simple plug-and-play API service, enabling developers to effortlessly incorporate advanced AI capabilities into their solutions →
MINDSDB sponsor

Statically Typed Functional Programming With Python 3.12

This detailed article looks at how to use the match statement along with Python’s typing mechanism to write functional programs similar in style to Kotlin.
OSKAR WICKSTROM

How to Annotate a Graph With Matplotlib and Python

The Matplotlib package is great for visualizing data. One of its many features is the ability to annotate points on your graph. This article shows you how.
MIKE DRISCOLL

bytes: The Lesser-Known Python Built-in Sequence

The bytes data type looks a bit like a string, but it isn’t a string. This article explores it and also looks at the main Unicode encoding, UTF-8
STEPHEN GRUPPETTA

Reflecting on One Year of Being an Engineering Manager

“Being a manager is a focus change from code to people, from output to outcomes and from being productive to making most of everyone’s time.” Read more of Victor’s reflecting on his first year as a manager.
VICTOR STOJANOV

Testing With Python: Fake It

This article is on using mock in your Python testing and is part of a larger series on testing in general.
BITECODE

Projects & Code Mesop: Build Web Apps in Python

GITHUB.COM/GOOGLE

WeasyPrint: The Awesome Document Factory

GITHUB.COM/KOZEA

django-axes: Track of Failed Login Attempts in Django

GITHUB.COM/JAZZBAND

Zango: Microservices in Django

GITHUB.COM/HEALTHLANE-TECHNOLOGIES

gloe: Library for Flow-Oriented Code

GITHUB.COM/IDEOS

Events Weekly Real Python Office Hours Q&A (Virtual)

June 12, 2024
REALPYTHON.COM

Wagtail Space NL

June 12 to June 15, 2024
WAGTAIL.SPACE

Django Girls Abraka Workshop 2024

June 13 to June 15, 2024
DJANGOGIRLS.ORG

Python Atlanta

June 13 to June 14, 2024
MEETUP.COM

PyData London 2024

June 14 to June 17, 2024
PYDATA.ORG

PyCamp Leipzig 2024

June 15 to June 17, 2024
BARCAMPS.EU

Wagtail Space US

June 20 to June 23, 2024
WAGTAIL.SPACE

Happy Pythoning!
This was PyCoder’s Weekly Issue #633.
View in Browser »

[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

Categories: FLOSS Project Planets

The Drop Times: Drupal Starshot Initiative Sets Strategic Milestones in Product Definition

Planet Drupal - Tue, 2024-06-11 12:21
The Drupal community advanced its Starshot initiative with a key session on June 7, 2024, led by Dries Buytaert and Cristina Chumillas. The session focused on refining the Drupal ecosystem with user-centric improvements and strategic development milestones. Key topics included the mission statement review, concept wireframes, draft milestones for DrupalCon Barcelona, and the Starshot Council.
Categories: FLOSS Project Planets

The Last 2 Weeks in my GSoC

Planet KDE - Tue, 2024-06-11 11:30

We’re already on Week 3 of the coding period of Google Summer of Code! As a reminder, I’m adding Python support to a few KDE Frameworks. During the first two weeks I added support for KWidgetsAddons, and it’s now almost finished except for two widgets whose bindings aren’t generated properly and don’t compile.

I also wrote (with the help of my mentor Carl) the necessary CMake code to build the library. That part is probably going to end (hopefully) in extra-cmake-modules so it can be used by anyone easily. The plan is to eventually submit each of the bindings to their repository so it’s easier to keep the C++ libraries in sync with their Python bindings.

This week I will be adding some examples for KWidgetAddons now that it’s on a usable status. If you want to see how it’s going, you can take a look at the code.

Categories: FLOSS Project Planets

Dries Buytaert: Major version upgrades in Drupal: tools and workflow

Planet Drupal - Tue, 2024-06-11 10:29

When a new major version of Drupal is released, custom code often requires updates to align with API changes, including the removal of deprecated APIs.

Because I keep forgetting certain aspects of this workflow, I decided to document it for future reference.

Tools overview Tool Interface Functionality Target Audience Upgrade Status module UI in Drupal Identifies deprecated code, hosting environment compatibility, and more Site administrators and developers Drupal Check Command-line Identifies deprecated code Developers, especially during coding and continuous integration (CI) Upgrade Status module

The Upgrade Status module assesses a Drupal site's readiness for major version upgrades by checking for deprecated code and other compatibility issues.

Screenshot of a Drupal upgrade status report showing hosting environment compatibility checks.
  1. Install the Upgrade Status module like you would install any other Drupal module:

    [code bash]$ ddev composer require –dev drupal/upgrade_status[/code]

    Here, ddev is the tool I prefer for managing my local development environment. composer is a dependency manager for PHP, commonly used to install Drupal modules. The –dev option specifies that the module should be installed as a development requirement, meaning it is necessary for development environments but not installed on production environments.

  2. Enable the Upgrade Status module:

    [code bash]$ ddev drush pm-enable upgrade_status[/code]

    drush stands for "Drupal shell" and is a command-line utility for managing Drupal sites. The command pm:enable (where pm stands for "package manager") is used to enable a module in Drupal.

  3. After enabling the module, you can access its features by navigating to the Admin > Reports > Upgrade status page at /admin/reports/upgrade-status.
Upgrading PHP and MySQL using DDEV

The Upgrade Status module might recommend updating PHP and MySQL, per Drupal's system requirements.

To update the PHP version of DDEV, use the following command:

[code bash]$ ddev config –-php-version 8.3[/code]

To upgrade the MySQL version of DDEV and migrate your database content, use the following command:

[code bash]$ ddev debug migrate-database mariadb:10.11[/code]

After updating these settings, I restart DDEV and run my PHPUnit tests. Although these tests are integrated into my CI/CD workflow, I also run them locally on my development machine using DDEV for immediate feedback.

Drupal Check

Drupal Check is a command-line tool that scans Drupal projects for deprecated code and compatibility issues.

Output of Drupal Check command indicating no deprecated code was found.
  1. Installation:

    [code bash]$ ddev composer require –dev mglaman/drupal-check[/code]
  2. Run Drupal Check from the root of your Drupal installation:

    [code bash]$ ./vendor/bin/drupal-check –memory-limit 500M docroot/modules/custom[/code]

    I usually have to increase the memory limit, hence the --memory-limit 500M.

Categories: FLOSS Project Planets

Real Python: Listing All Files in a Directory With Python

Planet Python - Tue, 2024-06-11 10:00

Getting a list of all the files and folders in a directory is a natural first step for many file-related operations in Python. When looking into it, though, you may be surprised to find various ways to go about it.

When you’re faced with many ways of doing something, it can be a good indication that there’s no one-size-fits-all solution to your problems. Most likely, every solution will have its own advantages and trade-offs. This is the case when it comes to getting a list of the contents of a directory in Python.

In this video course, you’ll be focusing on the most general-purpose techniques in the pathlib module to list items in a directory, but you’ll also learn a bit about some alternative tools.

[ 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

Qt on macOS 15 Sequoia

Planet KDE - Tue, 2024-06-11 09:19

As is customary Apple announced their latest operating system versions at WWDC yesterday, including macOS 15 Sequoia, named after the national park in the Sierra Nevada mountain range.

Categories: FLOSS Project Planets

Plasma Browser Integration 1.9.1

Planet KDE - Tue, 2024-06-11 06:35

I’m pleased to announce the immediate availability of Plasma Browser Integration version 1.9.1 on the Firefox Web Store. This is the Firefox release of version 1.9 that was released way back in November 2023. We’re not sure how it got stuck in Add-on review and that we didn’t realize this but whatever the reason, it’s out now! This is a maintenance release shipping a couple of important changes as well as the usual translation updates. The extension is of course fully supported under Plasma 6!

Konqi surfing the world wide web

Plasma Browser Integration bridges the gap between your browser and the Plasma desktop. It lets you share links, find browser tabs and visited websites in KRunner, monitor download progress in the notification center, and control music and video playback anytime from within Plasma, or even from your phone using KDE Connect!

The next release will likely be version 2.0 ported to Manifest v3 since Chrome has continued their roll-out of enforcing the new manifest version soon. We’re still trying to find a way to keep a unified code base supporting both Firefox and Chrome. Chrome for example requires service workers for the extension now while Firefox continues to support only background pages. Recent Firefox and Chrome releases seem to support each other’s manifest properties, though, therefore we’re confident to make this work without introducing browser-specific git branches.

What’s new?

If you’re a Firefox user, check out the previous version announcement for more details on what’s new:

  • Reworked page injection code (e.g. fixes Spotify)
  • Port away from deprecated InstallTrigger
  • “Share…” menu now also on tab context menu
  • Tabs runner queries only “normal” windows (no apps)
  • History runner skips “blob” URLs
  • Check native messaging host before sending to it (fixes annoying console warnings on unsupported platforms, e.g. Windows)
  • Prettier console debug output
  • Performance and resource usage improvements

(also see the Changelog Page on our Community Wiki)

Categories: FLOSS Project Planets

Python Bytes: #387 Heralding in a new era of database queries

Planet Python - Tue, 2024-06-11 04:00
<strong>Topics covered in this episode:</strong><br> <ul> <li><a href="https://github.com/Dataherald/dataherald">Dataherald</a></li> <li><a href="https://www.pythonmorsels.com/cli-tools"><strong>Python's many command-line utilities</strong></a></li> <li><a href="https://github.com/wolfi-dev">Distroless Python</a></li> <li><a href="https://docs.python.org/3/library/functools.html"><strong>functools.cache</strong></a>, <a href="https://github.com/tkem/cachetools/"><strong>cachetools</strong></a><strong>, and</strong> <a href="https://github.com/awolverp/cachebox"><strong>cachebox</strong></a></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=ETZ3CvfbF_o' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="387">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by ScoutAPM: <a href="https://pythonbytes.fm/scout"><strong>pythonbytes.fm/scout</strong></a></p> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@mkennedy@fosstodon.org</strong></a></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@brianokken@fosstodon.org</strong></a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes"><strong>@pythonbytes@fosstodon.org</strong></a></li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually Tuesdays at 10am PT. Older video versions available there too.</p> <p>Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Michael #1:</strong> <a href="https://github.com/Dataherald/dataherald">Dataherald</a></p> <ul> <li>Interact with your SQL database, Natural Language to SQL using LLMs.</li> <li>Allows you to set up an API from your database that can answer questions in plain English</li> <li>Uses include <ul> <li>Allow business users to get insights from the data warehouse without going through a data analyst</li> <li>Enable Q+A from your production DBs inside your SaaS application</li> <li>Create a ChatGPT plug-in from your proprietary data</li> </ul></li> </ul> <p><strong>Brian #2:</strong> <a href="https://www.pythonmorsels.com/cli-tools"><strong>Python's many command-line utilities</strong></a></p> <ul> <li>Trey Hunner</li> <li>Too many to list, but here’s some fun ones <ul> <li>json.tool - nicely format json data</li> <li>calendar - print the calendar <ul> <li>current by default, but you can pass in year and month</li> </ul></li> <li>gzip, ftplib, tarfile, and other unixy things <ul> <li>handy on Windows</li> </ul></li> <li>cProfile &amp; pstats</li> </ul></li> </ul> <p><strong>Michael #3:</strong> <a href="https://github.com/wolfi-dev">Distroless Python</a></p> <ul> <li>via Patrick Smyth</li> <li>What is <a href="https://www.chainguard.dev/unchained/minimal-container-images-towards-a-more-secure-future">distroless</a> anyway? <ul> <li>These are container images without package managers or shells included.</li> <li>Debugging these images presents some wrinkles (can't just exec into a shell inside the image), but they're a lot more secure.</li> </ul></li> <li>Chainguard, creates low/no CVE distroless images based on our FOSS distroless OS, <a href="https://github.com/wolfi-dev">Wolfi</a>.</li> <li>Some Python use-cases: <pre><code>docker run -it cgr.dev/chainguard/python:latest # The entrypoint is a Python REPL, since no b/a/sh is included docker run -it cgr.dev/chainguard/python:latest-dev # This is their dev version and has pip, bash, apk, etc. </code></pre></li> </ul> <p><strong>Brian #4:</strong> <a href="https://docs.python.org/3/library/functools.html"><strong>functools.cache</strong></a>, <a href="https://github.com/tkem/cachetools/"><strong>cachetools</strong></a><strong>, and</strong> <a href="https://github.com/awolverp/cachebox"><strong>cachebox</strong></a></p> <ul> <li><a href="https://docs.python.org/3/library/functools.html"><strong>functools</strong></a> cache and lru_cache - built in </li> <li><a href="https://github.com/tkem/cachetools/"><strong>cachetools</strong></a> - “This module provides various memoizing collections and decorators, including variants of the Python Standard Library's @lru_cache function decorator.”</li> <li><a href="https://github.com/awolverp/cachebox"><strong>cachebox</strong></a> - “The fastest caching Python library written in Rust”</li> </ul> <p><strong>Extras</strong> </p> <p>Brian:</p> <ul> <li><a href="https://pythoninsider.blogspot.com/2024/06/python-3124-released.html">Python 3.12.4 is out</a></li> <li><a href="https://devblogs.microsoft.com/python/python-in-visual-studio-code-june-2024-release/">VSCode has some pytest improvements</a></li> </ul> <p>Michael:</p> <ul> <li>Time for a <a href="https://www.macrumors.com/2024/06/06/alternatives-bartender-mac-menu-bar/">bartender alternative</a>, I’ve switched to <a href="https://icemenubar.app">Ice</a>.</li> <li><a href="https://www.rocket.chat">Rocket.chat</a> as an alternative to Slack</li> </ul> <p><strong>Joke:</strong> <a href="https://dev.to/alvaromontoro/css-cartoons-29bp">CSS Cartoons</a></p>
Categories: FLOSS Project Planets

Specbee: Why and How to migrate your DotNetNuke (DNN) site to Drupal 10

Planet Drupal - Tue, 2024-06-11 02:28
First things first, let's talk about why you're here. You've got a DNN website that's starting to show its age, and you're eyeing that sleek, modern Drupal CMS like it's the latest iPhone. From DotNetNuke to DNN Platform to DNN Evoq-sometimes simply called Evoq-this CMS has seen a series of transformations. Once an extremely popular CMS solution for organizations (mostly enterprise-level), DNN Evoq has faced the inevitable challenge of staying relevant over two decades. It's hard for any software to remain popular for over 20 years, especially with the changing world of web development and content management. Drupal, despite being older than DNN (okay, a year older), is thriving! Over time, it has only evolved into a more modern, user-friendly, and robust CMS. Moreover, Drupal excels at what it was designed to do: effective content management.  However, this is not intended to be a comparison blog of DNN vs. Drupal, even though we'll touch on a few reasons to consider the switch. This article aims to shed light on the DNN to Drupal migration process and what it entails. Additionally, we will share a case study of one of  Specbee's successful DNN to Drupal migrations.  Why you should migrate from DNN Evoq to Drupal To those who need to know some history of DNN, it was created by Shaun Walker and launched in late 2002. Written in C#, DNN is open source and relies on .NET framework and ASP.NET Web Forms. DNN soon became a platform known for its extensibility and seamless scalability which also brought in a lot of consultants and agencies to offer DNN development services.  However, over the years, DNN has experienced significant changes. The shift to the ASP.NET MVC model in 2009, coupled with some acquisitions, led to a decline in its user base and community support. DNN started relying on outdated technologies (since the .NET framework stopped development in 2019) and is unable to adapt to modern technologies and advancements. This evolution made it less appealing for businesses looking for a robust and active platform.  Now, why should you consider moving to Drupal, especially Drupal 10? Active and Vibrant Community: Drupal has one of the largest open-source communities. This means continuous improvements, a wealth of modules and themes, and a support system that's always buzzing. Continuous innovation: Drupal's constant innovation, driven by its passionate community, keeps it ahead with advanced features and enhancements. New strategic initiatives like Drupal Starshot, Project Browser, Experience Builder, Recipes, and Automatic Updates are poised to revolutionize the Drupal experience, making it more intuitive, efficient, and adaptable than ever before.  Cutting-Edge Features: Drupal 10 comes packed with modern features. It leverages Symfony 6 and Twig 3, ensuring your site is not just robust but also future-proof. The new admin theme, Claro, and the front-end theme, Olivero, offer a more intuitive and visually appealing experience. Effective editorial workflow system: With Drupal, end users can easily create and manage workflows tailored to their organization's needs and adjust them on-demand as necessary which is becoming more and more of a demand today.  In comparison, DNN's customization options and support for complex editorial workflows often require extensive coding knowledge.  Scalability and Flexibility: Like DNN, Drupal is known for its scalability. However, Drupal takes it a step further with its flexible content architecture, allowing you to create and manage various content types with ease. Security: Drupal is renowned for its strong security track record. The Drupal Security Team actively monitors and addresses vulnerabilities, giving you peace of mind. SEO and Performance: Drupal 10 includes out-of-the-box features that help improve SEO and site performance. From clean URLs to advanced caching mechanisms, it’s designed to help your site rank better and load faster. Accessibility: Drupal is committed to web accessibility standards, ensuring your site is usable by everyone. Extensive Ecosystem: With thousands of modules and themes, Drupal offers a vast ecosystem to extend your site's functionality without reinventing the wheel. By switching to Drupal 10, you're stepping into a future-ready, secure, and highly customizable environment. It's a move that can significantly improve your digital presence and provide a solid foundation for growth. Preparing for the migration Before you begin your DNN to Drupal migration, we recommend reading this article to get yourself prepped for a migration regardless of the version. It covers what information you should share with your Drupal development partner. This migration is also a perfect time to add those extra features or third-party integrations you've always wanted. Additionally, it's a great opportunity to revamp your website's design and user experience if needed. Consider your website’s current SEO positioning and how you would like to optimize it. Once you've considered everything, create a backup of your website to avoid any accidental changes or data loss. Next, make a checklist of your content structure, including content types, URLs, metadata, and media files. After this, let the Drupal migration experts take over. DNN to Drupal migration process Here’s a 4-step migration process that is (or should ideally be) followed by your Drupal migration partner: 1. Migration Audit Identify your DNN website features, functionality, modules, and content structure Conduct a detailed analysis to understand the digital landscape Catalog content views for easier replication Develop a strategic content migration strategy 2. Build Application Meticulously rebuild content structure and theme Replicate website features, add new features Conduct thorough regression testing Ensure a solid foundation, seamless functionality, and flawless performance 3. Migrate Content Content extraction from your database in a CSV, XML or JSON format Ensure a seamless transition from DNN to the latest Drupal version Import all contents and valuable assets, match them with the freshly created content types and fields Meticulously validate the entire data migration process for data accuracy and completeness. 4. Testing Thoroughly test migrated data for sanity and integrity. Subject replicated features to smoke testing and load testing. Guarantee seamless performance under various scenarios. Conduct meticulous security checks. Watch this video of our step-by-step Drupal migration process, irrespective of the CMS you are coming from. (To be embedded) https://youtu.be/D5JUud_a81k?feature=shared A DNN to Drupal migration case study The client (Stamats) approached us with a two-fold issue. They had three magazine sites on a legacy version of DNN that was riddled with malware and needed major work for the migration to Drupal. Among those sites was MeetingsToday.com.  Meetings Today was several years old, and had more than 20,000 articles in DNN. There was also extensive functionality related to their physical magazine, events, podcasts, webinars, and more. Their primary goal was to retain and grow their audience. They were experiencing issues with editing, and an uncertain future. The challenge came to Specbee to create a Drupal distribution that could serve the core publishing needs of several online magazine sites built in DNN.  So we built a custom Drupal distribution to save them time and money in the long term. This approach allowed any new feature developed for one site to be easily implemented across all sites while preserving their unique designs. It also gave them the ability to spin up a new publishing site without building a brand new website from scratch getting them to market 10x faster.  Specbee delivered a solution that allowed for Drupal's powerful editorial controls and publishing tools for multiple sites while allowing those sites to retain their unique functionality. References https://devessence.com/blog/!/22/what-is-your-dnn-migration-strategy/https://www.dnnsoftware.com/community-blog/cid/134716/asp-net-mvc-and-d…https://www.linkedin.com/in/shaunbrucewalker/ Final thoughts We understand that migrations are never an easy decision for any business. While entrusting a reliable technology partner can alleviate some concerns, it's crucial to dedicate your attention and time before handing over the reins. By choosing the right Drupal partner (such as Specbee, a certified Drupal migration partner), you can streamline the migration process, making it as seamless and painless as possible. Still wondering if you should migrate your DNN website to Drupal? Give us a call and we’ll help you make the right decision.
Categories: FLOSS Project Planets

Konsole Layout Automation (part 1)

Planet KDE - Mon, 2024-06-10 20:00

Do you find yourself opening up the same tabs in your terminal and running the same commands every day? Have you wanted to make this easier, say, by clicking a desktop icon or running a short command?

Recently, I saw a question along these lines in the KDE support room on Matrix. Someone wanted to have Konsole automatically open some tabs and run specific commands when it's started. Since I've done this kind of thing, for personal and professional environments, I thought I'd share. You too can avoid doing the same manual terminal setup day after day, and just get to what you're working on.

Here in Part 1, I'll outline how to open tabs with different profiles and run commands in them. Next week, in Part 2, I'll share how to set up layouts (a.k.a. split panes) and run commands in those. You can combine these techniques to make your setup truly flexible. Using aliases, functions and scripts, you can bring up a complex layout with one command or button click.

Inspiration

I have a motto: If I have to do the exact same thing more than twice (on a computer), I should probably script / automate it. It's an up front time investment that saves me a lot of manual tedium later.

My inspiration for scripting terminal layouts came from iTerm2's customization abilities. After a few years of using it on a work-provided MacBook Pro, I was spoiled. It's truly nice how easy it is to create profiles and save splits in the GUI. You can then tweak their configurations using any text editor. When I searched for how to do this with Linux terminals, I found quite a few people were also looking for an "iTerm2 equivalent for Linux".

Goal: Launch a Konsole window with tabs which run commands

💡 Note For more detailed instructions on using Konsole, please see the output of konsole --help and take a look at the Konsole Handbook

We'll start with that request from Matrix: having Konsole create tabs and run commands in them when it starts. Here are the steps I used to accomplish this. Feel free to use this as inspiration and adapt for your own needs.

Use case: Quickly set up a working environment that I use daily to save time every day. There will be a couple of tabs connected to different remote hosts, one that changes to a notes directory, and one running a system monitor.

Here's an overview of the steps:

  • Create a Konsole profile which will run a command and optionally use another color theme
  • Create a tab layout file to launch Konsole with which will open a tab with that profile
  • Create a profile with a different command for an additional tab, and then identify commands for a couple of the other tabs
  • Update the tab layout file to launch Konsole with all the desired tabs

Now let's get into the details.

Create the first Konsole profile

Making custom profiles for different hosts are where my adventures in customizing Konsole began.

Use case: I would like to automatically connect to my hosted VPS in a tab with a specific color theme.

Reasoning: Running commands using a theme is quicker and easier than typing by hand (especially as they get more complex). With a custom color scheme, I can see at a glance which tab has my server session vs. any other system. This helps me avoid typing commands for my server into another system and vice-versa.

💡 Note Profiles are stored as plain text files in /.local/share/konsole/. Profile names are cAsE senSiTive. Since profile files are plain text, you can create, edit, and delete them with scripts. That is beyond the scope of this post.

The first step is to set up a custom profile with a custom color theme, a custom tab title format, and a command.

I'm using "eternal terminal" (et) for its ability to reconnect, rather than ssh to connect to the VPS. I also have an entry for the host in .ssh/config

In Settings -> Manage Profiles - New I created a profile named VPS. The following are the options I changed. Others were left as-is ("hostname" is a stand-in for the actual VPS hostname):

Name: VPS Command: et VPS Tab title format: %n hostname Tab Color: I chose a color Appearance - Color scheme & font: I chose a different color scheme

Now that I have a custom profile, I can use it with a new tab in Konsole. When I go to File -> New Tab and click "VPS", the tab will open with the new profile, and the command will run to connect to the server.

You can use Konsole's command line options in the following way to have it launch with a tab using a profile.

konsole --new-tab --profile VPS

This command can be used with an alias, function, script, Windows batch file, desktop shortcut or whatever you prefer.

There's another way to launch Konsole which is better for opening multiple tabs. It uses a "tabs configuration file".

Create a tabs configuration file

💡 Note I have found this to be unreliable if any tab uses ssh or et There's an open bug report for this. Until this is resolved, you may have better luck with a shell script that opens multiple tabs, I'll add information below.

Now I'll create a tabs configuration file with the VPS profile in it.

Each line in this file describes a tab for Konsole to open. The format is detailed in the command line options documentation. I keep these in ~/konsole_layouts/, keep yours in whatever directory works for you. I'll save this file as "vps-tabs".

Each line must have at least a profile or a command field. It can have both, and there are other options as well.
Do not specify a command on a line for a tab if you also use a profile which itself has a command. This may lead to unexpected behavior.

If you only need to run a command in a tab, you can just use the command field. You combine a command with a profile (that has no command) if you want to customize the tab further.

This is what will go in the file for now for my first tab:

title: VPS ;; profile: VPS

The command below will start Konsole using this file. (Change file path to point to the file on your system). Opening Konsole in this way can also be done with an alias, script etc.

konsole --hold --tabs-from-file ~/konsole_layouts/vps-tabs

Notice that I'm using --hold which tells Konsole to keep tabs open even after their command has exited. This will help debugging any problems that might arise (unless the window crashes entirely or fails to load). Once things are set up and running smoothly, you don't need to use --hold, if you prefer.

Create additional profiles

Use case: At the start of the day, I want to automatically open tabs which connect to both servers I need to work with. I want an additional tab open to my notes directory and another one running a system monitor.

Time to add an additional profile to Konsole:

  • Server2 - this will use ssh to connect to a second server and use a profile for a different color theme

I won't create profiles for the system monitor tab or the Notes tab. I'll run those commands directly from the tab configuration file.

Update the tabs file with additional tab definitions

At this point, I'll add lines to the tabs configuration file I created.

  • A tab for the Server2 profile.
  • A tab which changes to a notes directory, and uses the Sand profile with colors I prefer for them.
  • A tab for the system monitor which runs the btm command and uses another profile with yet another color scheme.

The file now looks like this:

title: VPS ;; profile: VPS title: SysAdminNotes ;; workdir: ~/Nextcloud/Notes/SysAdmin ;; profile: Sand title: Server2 ;; profile: Server2 title: NavyBlue ;; command: btm ;; profile: NavyBlue

And now, when I run konsole --hold --tabs-from-file ~/konsole_layouts/vps-tabs, Konsole launches with all the tabs I need.

Bonus: Run commands after connecting to a remote host

It's possible with both ssh and et to run commands on a remote host after connection. For instance, I could update the command in my VPS profile like so:

Name: VPS Command: et VPS -c 'sudo apt update && apt list --upgradable; exec /bin/zsh' Tab title format: %n hostname Tab Color: I chose a color Appearance - Color scheme & font: I chose a different color scheme

The command not only connects to my VPS, it also displays a list of any available updates, and stays connected to the host. Note the exec /bin/zsh at the end. This will keep an interactive terminal open after other commands are run.

With ssh, to run a command on a remote host while staying connected, the command is slightly different:

ssh -t VPS 'sudo apt update && apt list --upgradable; zsh' But what if I need to connect to a jumphost before the remote host and I still want to run a command after I connect?

This can be done with either SSH or Eternal Terminal. For SSH, the process is relatively easy, and plenty of sites online provide instructions. Eternal Terminal, on the other hand, is a bit more tricky.

It took some research and experimentation to get this working with Eternal Terminal, so here it is ("jumphost" is a placeholder for the actual hostname of the jumphost).

Command=et jumphost -c "ssh -t remotehost 'cd /some/directory && . ../some_script && cd ../another-directory; exec /bin/zsh'" Alternative to using a tabs file: a shell script or function

If you have difficulties with using a tabs configuration file, you can use a shell script (or function) that takes advantage of the command line options Konsole has. For instance, using the -e flag we can have tabs run commands:

#!/usr/bin/env bash konsole --new-tab -e echo This is tab 1 & konsole --new-tab -e echo This is tab 2 & konsole --new-tab -e echo This is tab 3 & konsole --new-tab -e echo This is tab 4 &

You can combine commands with profiles as well:

#!/usr/bin/env bash konsole --new-tab --profile VPS & konsole --new-tab --profile Sand --workdir: ~/Nextcloud/Notes/SysAdmin & konsole --new-tab --profile Server2 & konsole --new-tab --profile NavyBlue -e btm &

Explore the Konsole docs and experiment!

Known issues
  • Launching Konsole with --tabs-from-file will open an extra tab in addition to the ones from the configuration file. This has an open bug report.
  • Sometimes, with --tabs-from-file, the new Konsole window immediately disappears. This may be related to ssh/et being in a command. I filed a bug report for that.
  • If using a tabs configuration file, or a script: only use Eternal Terminal with one tab. Trying to use it with more than one tab will result in et core dumping in one of them.
Categories: FLOSS Project Planets

Switching to GNU/Linux: Mentally

Planet KDE - Mon, 2024-06-10 20:00

Stallman was right; in the wake of Microsoft’s announcement of its much-maligned Recall feature and widespread public backlash to the terms and conditions for Adobe Creative Cloud products, it’s clear that trust in big tech and the software it produces is rapidly eroding. Under the circumstances, it’s no surprise that Free/Libre and Open Source Software (FLOSS) is seeing an uptick in interest from the public at large. So as ever more average users consider “switching to Linux,” it strikes me that while there exist tomes on the technical aspects, there seems to be much less written on the shift in thinking that is part and parcel of every experienced and well-adjusted FLOSS user. So if you’re making the switch or know someone who is, here’s some advice to make the most of the transition.

He was right. CC BY-NC-ND 3.0 Welcome #

First of all: welcome to GNU/Linux! You’ve chosen the operating system that powers bullet trains, the world’s fastest supercomputers, U.S.A. air traffic control, CERN’s Large Hadron Collider, and Google, Amazon, and Microsoft’s cloud services, used by NASA, the People’s Liberation Army, the Turkish government, whitehouse.gov, the U.S.A. Department of Defense, France’s national police force, ministry of agriculture, and parliament, Iceland’s public schools, the Dutch Police Internet Research and Investigation Network, Burlington Coat Factory, Peugeot, DreamWorks Animation, the Chicago Mercantile Exchange, the London Stock Exchange, the New York Stock Exchange, and Stephen Fry.

As you’ve no doubt inferred by now, GNU/Linux users span from your everyday cat-video viewer to large institutions and organizations where operating system reliability and performance means the difference between life and death. No matter where you are on this spectrum, with a little humility, open-mindedness, and perseverance, I promise that you can find your self every bit as happily at-home with GNU/Linux as you were with whatever OS you’ve been using up to this point. This may mean giving up a long-trusted piece of software for something new and different, but for many new users the most hard-won battle is a change in mentality.

You’re not a power-user anymore #

I’ve heard it said that the most “computer literate” people often find it especially arduous to adjust to GNU/Linux. I’ve been there; it’s a frightening thing to go from the person family, friends, and neighbors call to help with problems with any device that has so much as an LED on it to feeling like that clueless relative with a dozen toolbars installed on their outdated version of Internet Explorer. The reality is that while you’ve gotten very good at navigating the operating system that you’ve been using for the past twenty years, very little of that knowledge is useful in GNU/Linux. This is something you’re going to have to accept early on: no matter what distro you choose, it’s going to be different to Windows or MacOS in very fundamental ways.

This means that, no matter your mastery of Windows keyboard shortcuts, or how convoluted your AutoHotkey config may be, it’s going to take you some time to grasp the basics. Beyond that, the bar to become a GNU/Linux power-user is much, much higher than it is on proprietary operating systems. In case you’re feeling intimidated, know that this comes with some serious advantages. GNU/Linux systems come with a practically limitless potential for mastery, efficiency, and customization. In time, you’ll be able to customize your GUI to your exact specifications, automate system maintenance, and knock out common tasks with a speed you wouldn’t have thought possible on your old OS.

Embrace the new #

Switching to GNU/Linux is, in some ways, much more convenient than switching from, say, MacOS to Windows. Chiefly, most distros can be configured to run a wide range of software built for MacOS, Windows, or Android with minimal fuss. That said, I strongly encourage new users to explore FLOSS alternatives built on and for GNU/Linux. FLOSS projects often get a bad rap among users of proprietary operating systems because while a piece of software may run on these systems, the experience is rarely as good as it is on the system is was designed for: usually, GNU/Linux. FLOSS mainstays such as LibreOffice, Krita, Inkscape, Scribus, Kdenlive, and Ardour are at their best on GNU/Linux in terms of appearance, performance, and features. There are professionals of every stripe who do their work with an exclusively FLOSS toolset, from graphic design to video editing, audio production, data analytics, and more. If they can do it, so can you! Don’t let the one piece of proprietary software that just won’t work put you off of your new operating system when there’s a whole new ecosystem of incredible software to explore.

The latest development version of Scribus running on EndeavourOS. I guarantee you it doesn’t look this good on Windows.

New users of FLOSS projects often complain that the user interface or workflow of the tool they’re trying is “unintuitive.” Occasionally, these complaints hit on an area that genuinely could use some improvement, but more often, new users are simply expressing frustration that the workflow of a FLOSS project is different from what they are used to. These applications are not mere clones of their proprietary counterparts; they are projects in their own right, with unique goals, ideals, features, and workflows. Getting through a work project a little more slowly at first is not necessarily a flaw in the tool, it likely just means that you need a bit more practice. In time, you’ll come to learn and appreciate killer features that go above and beyond the capabilities of software produced by even the largest tech companies.

As a GNU/Linux user, you’re part of a community #

When you switch to GNU/Linux, you’re not a customer any more. FLOSS projects are largely build by communities of volunteers who work on what they find interesting or important for their own reasons. There’s no support line to call, no one to complain to if something breaks, and no one is losing anything by you choosing not to use their software. If you need help, or if you want to help make a FLOSS project better, you’re going to have to engage with the wider community. Every project has a forum, a Matrix or IRC channel, or some other means of connecting users and developers. If you have a problem you can’t solve on your own, these are the places to go to get help. Sign up and make a good faith effort to learn the rules and etiquette of the community, and chances are someone will be more than willing to help you find a solution out of sheer civic-mindedness.

There is likewise a great deal of pleasure and satisfaction to be gained by returning that kindness: by being an active participator in the communities you join, you’ll help others overcome the stumbling blocks you once faced and foster connections with others who share your interests. Beyond the community alone, there is something wonderful about using software that you’ve helped shape; contributing well written bug reports, monetary donations, writing documentation, or testing new releases makes a direct positive impact on the tools you rely on each day. It’s one thing to use FLOSS projects for reasons of ethics, privacy, or mere utility, but seeing a page of documentation you’ve written go live for anyone in the world to learn from, seeing a bug you reported vanish after an update, a theme you created get added to a game, or experiencing your feature request given form in a release really draws you in. You’re no longer at the mercy of some large tech company who only cares about profit; you’re part of a community that cares about people, ideas, and making its software better, more efficient, more usable, and more useful for everyone.

The FLOSS mindset #

To distill what I’ve said above: Things are going to be different, and you may feel disempowered and frustrated for a while until you catch up again. The solution to this, beyond simple patience, is to embrace the fact that by using FLOSS projects, you become a part of the process of making them. Join the community with respect and humility, allow yourself to receive help and kindness from others, and you’ll begin to once again remember how it feels to earn your skills. In time, you’ll be the one offering help, you’ll dance circles around any Windows power-user, and you’ll be using tools that you’ve helped make better. Again I say: welcome. With these small shifts in your thinking, you’re going to be in for a good time.

Categories: FLOSS Project Planets

Help wanted! Port KDE Frameworks oss-fuzz builds to Qt6/KF6

Planet KDE - Mon, 2024-06-10 19:01

If you're looking for an isolated and straightforward way to start contributing to KDE, you're in the right place. At KDE, we use fuzzing via oss-fuzz to try to ensure our libraries are robust against broken inputs. Here's how you can help us in this essential task.

What is Fuzzing?

Fuzzing involves feeding "random" [1] data into our code to check its robustness against invalid or unexpected inputs. This is crucial for ensuring the security and stability of applications that process data without direct user control.

Why is Fuzzing Important?

Imagine receiving an image via email, saving it to your disk, and opening it in Dolphin. This will make Dolphin create a thumbnail of the image. If the image is corrupted and our image plugin code isn't robust, the best-case scenario is that Dolphin crashes. In the worst case, it could lead to a security breach. Hence, fuzzing helps prevent such vulnerabilities.

How You Can Help:

We need to update the build of KDE libraries in oss-fuzz to use Qt6. This task could be challenging because it involves static compilation and ensuring the correct flags are passed for all compilation units.

Steps to Contribute:

  1. Start with karchive Project

    • Download oss-fuzz and go into the karchive subfolder.
    • Update the Dockerfile to download Qt from the dev branch and KDE Frameworks from the master branch.
  2. Update build.sh Script:

    • Modify the build.sh script to compile Qt6 (this will be harder since it involves moving from qmake to cmake) and KDE Frameworks 6.
  3. Check karchive_fuzzer.cc:

    • This file might need updates, but they should be relatively easy.
    • At the top of karchive_fuzzer.cc, you'll find a comment with the three commands that oss-fuzz runs. Use these to test the image building, fuzzer building, and running processes.

Need Help?

If you have questions or need assistance, please contact me at aacid@kde.org or ping me on Matrix at @tsdgeos:kde.org

Note:

[1] Smart fuzzing engines don't generate purely random data. They use semi-random and semi-smart techniques to efficiently find issues in the code.

Categories: FLOSS Project Planets

Talking Drupal: Talking Drupal #454 - Drupal API Client

Planet Drupal - Mon, 2024-06-10 14:00

Today we are talking about Drupal’s API Client, What it does, and why you might need it with guest Brian Perry. We’ll also cover Iconify Icons as our module of the week.

For show notes visit: www.talkingDrupal.com/454

Topics
  • Brian what is new with you!
  • Elevator pitch for Drupal API Client
  • What was Pitchburg like
  • Is this a normalizer for JSON API
  • Why is this JS framework agnostic
  • What is typescript and how does Drupal API Client use it
  • Looking at the quick start guide the second step is to create an instance, where do you do that
  • Who is this module for
  • Will Drupal API Client be added to core
  • What is on the roadmap
  • How does this relate to Chapter Three and Next.js
  • What is the spin up time
  • How will Starshot impact this
Resources Guests

Brian Perry - brianperry.dev brianperry

Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Randy Fay - rfay

MOTW Correspondent

Martin Anderson-Clutz - mandclu.com mandclu

  • Brief description:
    • Have you ever wanted to empower your content creators to place icons from a massive, open source library into your Drupal site? There’s a module for that.
  • Module name/project name:
  • Brief history
    • How old: created on May 22 of this year, so less than two weeks ago, by David Galeano (gxleano) of Factorial
    • Versions available: 1.0.0 which supports Drupal 9.3 or newer, right up to Drupal 11
  • Maintainership
    • Actively maintained
    • Security coverage
    • Test coverage
    • Documentation
    • Number of open issues: 2 open issues, neither of which are bugs
  • Usage stats:
    • 1 site
  • Module features and usage
    • Out of the box the module provides both a CKEditor button for placing icons, and a new field type. It even provides a new form element that can be used in custom forms, a render element you can use to programmatically put an icon into something like a custom block, and a Twig extension that can be used to place icons in templates.
    • According to the project page, the Iconify icon library includes more than 200,000 icons, though in my limited experimentation it seems like there are some duplicates between icon sets. Speaking of which, Iconify provides over 150 different icon sets, and in this module’s configuration you can specify which ones you want to be available on your site.
    • Placing an icon is as simple as using an autocomplete to search the names of the icons available, and a preview is shown for each of the matches found.
    • The field widget and the CKEditor button both give content creators options for what size and color to use for the icons. For myself I’d prefer to lock some of those options down (for example, make that part of the field’s display configuration instead), but I’m sure that could be added as part of a different widget.
    • I can think of a few Drupal sites I’ve built where this would have been really handy, so I’m interested to play around with this module some more, and see how it evolves.
Categories: FLOSS Project Planets

The Drop Times: Drupal's New Horizons: Innovations, Community, and the Starshot Initiative

Planet Drupal - Mon, 2024-06-10 12:52

Drupal's popularity is soaring because it's easy to use and flexible enough to fit any project. Businesses love it for its ability to grow with them, whether they're just starting out or already established. With each update, Drupal improves, offering more features and making it easier for everyone to build amazing websites.

One big thing to watch out for is the Starshot Initiative. It's all about making Drupal easier to use by adding some cool features from the start. Think of it as getting a new phone with all the apps you need installed. Starshot is like that for Drupal, making it simpler for everyone to get started and build something great.

The best part about Drupal is its community. People worldwide come together to share ideas, help each other, and improve Drupal. Whether you're a beginner or an expert, there's always something new to learn and someone to help you.

As Drupal grows, so does its potential. More and more businesses are choosing Drupal because it's reliable, adaptable, and just plain works. With initiatives like Starshot on the horizon, Drupal's future looks brighter.

With that said, let's now explore what updates and news we have covered last week:

In the interview with Alka Elizabeth, sub-editor at The Drop Times, Esmeralda Braad-Tijhoff, discusses her background, rise in the Drupal community, and ongoing efforts to promote inclusivity and collaboration within the tech industry. She shares insights into her roles with the Stichting Drupal Nederland and the Network of European Drupal Associations (NEDA), reflecting on her achievements and vision for the future of open-source solutions in public sector projects.

I had the opportunity to connect with some of the speakers of the upcoming DrupalJam to gain their insights on their sessions. Frederik Wouters sheds light on integrating RAG and OpenAI technologies within organizational infrastructures, emphasizing the significance of data quality and privacy considerations. Mikko Hämäläinen delves into the complexities of Digital Experience Platforms (DXP), elucidating their role in addressing customer expectations and internal silos in customer management. Finally, Mathias Bolt Lesniak advocates for the importance of open-source software in governmental policies, urging society to rediscover its benefits and advocate for its adoption.

Additionally, PHPCamp took place on 8th June 2024. I spoke with the organizers to provide insights into what attendees could expect. Amit Kumar Singh, a key organizer, shared his thoughts on why PHPCamp holds significance in the tech community.

Recently, Jay Callicott, an experienced Drupal Architect, introduced a new tool: DrupalX. DrupalX aims to simplify the process of building enterprise-level websites using Drupal. The Drop Times approached him for a comment, where he highlighted DrupalX's focus on improving the Drupal development experience, particularly for enterprise projects. Jay anticipates DrupalX will be beneficial in addressing common challenges developers face. Click here to read more about DrupalX.

The Drupal Starshot Initiative is picking up speed, and if you're interested in getting involved, now's the perfect time! The complete session calendar is now accessible, featuring a range of interactive Zoom calls. These sessions are tailored to offer updates and guidance on how you can contribute to this thrilling initiative.

After its unveiling at DrupalCon Portland 2024, the initial Drupal Starshot session, spearheaded by Dries Buytaert on May 31, 2024, attracted over 200 participants. The session discussed key topics such as community involvement, funding strategies, and governance plans. These discussions underscored the project's mission to streamline Drupal site construction through improved features and accessibility.

The Drupal Starshot project has introduced its new leadership team headed by Dries Buytaert. This team comprises key figures such as Technical Lead Tim Plunkett, User Experience Lead Cristina Chumillas, Product Owner Pamela Barone, and Contribution Coordinator Gábor Hojtsy. Together, they are committed to elevating the Drupal platform by prioritizing product vision, technical excellence, and user experience.

The Drupal Association has invited leaders of Local Associations from Asia to the inaugural Local Association Leaders meet-up on June 11, 2024. This initiative aims to strengthen the success of Drupal Local Associations by directly involving community leaders committed to advancing the Drupal project within their respective regions.

To celebrate Pride Month 2024, the Drupal Association is highlighting international LGBTQ+ organizations and donating proceeds from Pride-themed apparel sales. Community members can vote for the recipient organization, and they're encouraged to share their Pride stories for potential social media features.

The Drop Times has officially become a media partner for Drupaljam 2024, set to take place on June 12, 2024, at Fabrique Utrecht. We'll offer extensive coverage of all the latest updates throughout the event. But that's not all! The Drop Times has also been named the official Media Partner for DrupalCamp Spain 2024. This event is a cornerstone gathering for the Drupal community and is scheduled to be held from October 24 to 26 at the Hotel DeLoix Aqua Center. Stay tuned for comprehensive coverage of both Drupaljam 2024 and DrupalCamp Spain 2024!

Twin Cities Drupal Camp has opened the Call for Submissions for its upcoming event on September 12-13, 2024. With rolling session acceptance, early submissions have a higher chance of selection. The event will feature general sessions lasting 45 minutes, allowing for interactive audience Q&A sessions.

Registration for DrupalCamp Asheville 2024 is now open. The camp, which will take place from July 12 to 14, 2024, offers an exciting lineup of events. The camp includes three days of training, an unconference, various sessions, and community activities, all set against the scenic backdrop of Asheville. 

In other news, MidCamp will return with new dates in 2025, from May 20 to 22, at the DePaul University Student Center in Chicago. This change aligns with an earlier DrupalCon, providing the community a great opportunity to gather in the spring. Key events leading up to MidCamp include opening the call for speakers in the fall of 2024, with final selections and the schedule announcement expected in late January or early February 2025.

It summarises the week's major updates, though we couldn't include every story in this selection. Until next week... 

To get timely updates, follow us on LinkedIn, Twitter and Facebook. Also, join us on Drupal Slack at #thedroptimes.

Thank you,
Sincerely
Kazima Abbas
Sub-editor, The Drop Times

Categories: FLOSS Project Planets

Real Python: Python News: What's New From May 2024

Planet Python - Mon, 2024-06-10 10:00

May was packed with exciting updates and events in the Python community. This month saw the release of the first beta version of Python 3.13, the conclusion of PyCon US 2024, and the announcement of the keynote speakers for EuroPython 2024. Additionally, PEP 649 has been delayed until the Python 3.14 release, and the Python Software Foundation published its 2023 Annual Impact Report.

Get ready to explore the recent highlights!

Join Now: Click here to join the Real Python Newsletter and you'll never miss another Python tutorial, course update, or post.

The First Beta Version of Python 3.13 Released

After nearly a year of continuous development, the first beta release of Python 3.13 was made available to the general public. It marks a significant milestone in Python’s annual release cycle, officially kicking off the beta testing phase and introducing a freeze on new features. Beyond this point, Python’s core developers will shift their focus to only identifying and fixing bugs, enhancing security, and improving the interpreter’s performance.

While it’s still months before the final release planned for October 2024, as indicated by the Python 3.13 release schedule, third-party library maintainers are strongly encouraged to test their packages with this new Python version. The goal of early beta testing is to ensure compatibility and address any issues that may arise so that users can expect a smoother transition when Python 3.13 gets officially released later this year.

Although you shouldn’t use a beta version in any of your projects, especially in production environments, you can go ahead and try out the new version today. To check out Python’s latest features, you must install Python 3.13.0b1 using one of several approaches.

Note: If you’d like to share your feedback or file a bug against a pre-release development version, then open an issue on Python’s GitHub repository.

The quickest and arguably the most straightforward way to manage multiple Python versions alongside your system-wide interpreter is to use a tool like pyenv in the terminal:

Shell $ pyenv install 3.13.0b1 $ pyenv shell 3.13.0b1 $ python Python 3.13.0b1 (main, May 15 2024, 10:41:55) [GCC 13.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> Copied!

The highlighted line brings the first beta release of Python 3.13 onto your computer, while the following command temporarily sets the path to the python executable in your current shell session. As a result, the python command points to the specified Python interpreter.

Alternatively, you can use a Python installer, which you’ll find at the bottom of the downloads page, or run Python in an isolated Docker container to keep it completely separate from your operating system. However, for ultimate control, you can try building the interpreter from source code based on the instructions in the README file. This method will let you experiment with more advanced features, like turning off the GIL.

Unlike previous Python releases, which introduced a host of tangible syntactical features that you could get your hands on, this one mainly emphasizes internal optimizations and cleanup. That said, according to the official release summary document, there are a few notable new features that will be immediately visible to most Python programmers:

Some of these features don’t work on Windows at the moment because they rely on Unix-specific libraries, so you won’t see any difference unless you’re a macOS or Linux user. The good news is that Windows support is coming in the second beta release, which will arrive soon, thanks to Real Python team member Anthony Shaw.

Read the full article at https://realpython.com/python-news-may-2024/ »

[ 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

LN Webworks: Drupal Translation Module: How to Create Multilingual Drupal Websites

Planet Drupal - Mon, 2024-06-10 08:27

It typically occurs when you click on a website and become disinterested in utilizing it because there are no language preferences. In addition, you will be more interested in browsing the website if you can easily navigate its user interface and select your preferred language, regardless of where you live. 

According to some reports: Multilingual websites can reach 75% more internet users and improve user experience, as 60% of global consumers prefer browsing in their native language. Businesses with such websites see a 70% average increase in conversion rates. That’s why it is preferred that you must create a multilingual website to help with website traffic and your business strategy.

How?

Categories: FLOSS Project Planets

Robin Wilson: Introducing offline_folium

Planet Python - Mon, 2024-06-10 05:35

Another new-ish package that I’ve never got around to writing about on my blog is offline_folium. It has a somewhat niche use-case, but it seems like a few people have found it useful.

In brief, it allows you to use the folium package for creating interactive maps from Python, but without an internet connection. Folium is built on top of the Leaflet web mapping library – and it loads all the relevant JS and CSS files directly from CDNs. This means that if you try and use folium without an internet connection it just doesn’t work. Offline_folium works around this by downloading the files when you do have an internet connection, and then re-writing the links to the files to point to the offline versions.

I originally created this package when doing freelance work on a project for the UK Navy – they wanted to have interactive maps on an air-gapped computer, so I built a system that would allow this (in this case, the JS/CSS file download step was run as part of building the ‘app’ we produced). I should note at this point that without an internet connection the default OpenStreetMap background mapping will not work. In some situations that would be a significant problem – but we were using other background mapping, coastline vector files and so on, so it wasn’t a problem for us.

So, how do you use this package?

First, install it using pip install offline_folium. Then make sure you have an internet connection and run python -m offline_folium – this will download the JS/CSS files and store them in a sensible place (chosen automatically). Now you’re all set up.

Once you have no internet connection and want to use folium, you must import it in a slightly different way – first import offline from offline_folium, and then import folium, like this:

from offline_folium import offline import folium

Now you can use folium as usual, for example by creating a simple map object:

m = folium.Map()

So, that’s pretty-much it. People are actively submitting pull requests at the moment, so hopefully the functionality will expand to work with various folium plugins too.

For more information (or to submit a PR yourself), see the Github repo.

Categories: FLOSS Project Planets

Python Software Foundation: It’s time to make nominations for the PSF Board Election!

Planet Python - Mon, 2024-06-10 05:00

This year’s Board Election Nomination period opens tomorrow and closes on June 25th. Who runs for the board? People who care about the Python community, who want to see it flourish and grow, and also have a few hours a month to attend regular meetings, serve on committees, participate in conversations, and promote the Python community. Check out our Life as Python Software Foundation Director video to learn more about what being a part of the PSF Board entails. We also invite you to review our Annual Impact Report for 2023 to learn more about the PSF mission and what we do.

Current Board members want to share what being on the Board is like and are making themselves available to answer all your questions about responsibilities, activities, and time commitments via online chat. Please join us on the PSF Discord for the Board Election Office Hours (June 11th, 4-5 PM UTC and June 18th, 12-1 PM UTC)  to talk with us about running for the PSF Board. 

Board Election Timeline

Nominations open: Tuesday, June 11th, 2:00 pm UTC
Nominations close: Tuesday, June 25th, 2:00 pm UTC
Voter application cut-off date: Tuesday, June 25th, 2:00 pm UTC
Announce candidates: Thursday, June 27th
Voting start date: Tuesday, July 2nd, 2:00 pm UTC
Voting end date: Tuesday, July 16th, 2:00 pm UTC 

Not sure what UTC is for you locally? Check here!

Nomination details

You can nominate yourself or someone else. We encourage you to reach out to people before you nominate them to ensure they are enthusiastic about the potential of joining the Board. Nominations open on Tuesday, June 11th, 2:00 PM UTC, and end on June 25th, 2:00 PM UTC.

Please send nominations and questions regarding nominations to psf-board-nominations@pyfound.org. Include the name, email address, and an endorsement of the nominee's candidacy for the PSF Board. To get an idea of what a nomination looks like, check out the Nominees for 2023 PSF Board page. After the nomination period closes, we will request a statement and other relevant information from the nominees to publish for voter review.

Voting Reminder!

Every PSF Voting Member (Supporting, Managing, Contributing, and Fellow) needs to affirm their membership to vote in this year’s election. You should have received an email from "psf@psfmember.org <Python Software Foundation>" with subject "[Action Required] Affirm your PSF Membership voting status" that contains information on how to affirm your voting status.

You can see your membership record and status on your PSF Member User Information page. If you are a voting-eligible member and do not already have a login, please create an account on psfmembership.org first and then email psf-donations@python.org so we can link your membership to your account.

Categories: FLOSS Project Planets

Tryton News: Security Release for issue #92

Planet Python - Mon, 2024-06-10 04:00

Ashish Kunwar has found that python-sql accepts any string in the offset or limit parameters when python is ran with -O which makes any system exposing those vulnerable to an SQL injection attack.

Impact

CVSS v3.0 Base Score: 9.1

  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: Low
  • User Interaction: None
  • Scope: Changed
  • Confidentiality: High
  • Integrity: Low
  • Availability: Low
Workaround

Do not use the -O switch or PYTHONOPTIMIZE environment variable when executing python.

Resolution

All affected users should upgrade python-sql to the latest version.

Affected versions: <= 1.5.0
Non affected versions: >= 1.5.1

Reference Concerns?

Any security concerns should be reported on the bug-tracker at https://bugs.tryton.org/python-sql with the confidential checkbox checked.

1 post - 1 participant

Read full topic

Categories: FLOSS Project Planets

Pages