FLOSS Project Planets

Golems GABB: A Glance at Tome - Drupal static content generator

Planet Drupal - Fri, 2023-03-17 09:13
A Glance at Tome - Drupal static content generator Editor Fri, 03/17/2023 - 15:13

Creating a completely static HTML website is quite a challenging process unless you use a static content generator. Tome is developed to make it as easy as possible with any site on Drupal.
Like any CMS, it provides a set of templates and automatically helps to create pages, avoiding a long and complicated manual setup. You don't even need to know Java to use it. Just a perfect match if you're creating content based on raw data and a website template set.
Static sites are perfect for SEO and SEA. Using a static content generator gives some severe benefits to your site, including better performance, a lighter backend, and multiple options for customization. Moreover, static sites are more flexible, secure, and scalable than dynamic types. Let's learn more about static website generators and Tome with our Drupal development team.

Categories: FLOSS Project Planets

Python for Beginners: Pandas DataFrame to List in Python

Planet Python - Fri, 2023-03-17 09:00

Python lists and dataframes are two of the most used data structures in python. While we use python lists to handle sequential data, dataframes are used to handle tabular data. In this article, we will discuss different ways to convert pandas dataframe to list in python.

Table of Contents
  1. Convert Pandas DataFrame to a List of Rows
  2. Pandas DataFrame to List of Arrays in Python
  3. Convert Pandas DataFrame to a List of Lists
    1. Pandas DataFrame to a List of Lists Using iterrows() Method
    2. Using tolist() Method And The Values Attribute
  4. Get a List of Column Names From Dataframe
  5. Convert Dataframe Column to a List in Python
  6. Conclusion
Convert Pandas DataFrame to a List of Rows

Each row in a pandas dataframe is stored as a series object with column names of the dataframe as the index and the values of the rows as associated values. 

To convert a dataframe to a list of rows, we can use the iterrows() method and a for loop. The iterrows() method, when invoked on a dataframe, returns an iterator. The iterator contains all the rows as a tuple having the row index as the first element and a series containing the row data as its second element. We can iterate through the iterator to access all the rows.

To create a list of rows from the dataframe using the iterator, we will use the following steps.

  • First, we will create an empty list to store the rows. Let us name it rowList.
  • Next, we will iterate through the rows of the dataframe using the iterrows() method and a for loop. 
  • While iterating over the rows, we will add them to rowList. For this, we will use the append() method. The append() method, when invoked on the list, takes the current row as its input argument and adds the row to the list.

After execution of the for loop, we will get the output list of rows. You can observe this in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) rowList=list() for index,row in df.iterrows(): rowList.append(row) print("The list of rows is:") print(rowList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of rows is: [Roll 1 Maths 100 Physics 80 Chemistry 90 Name: 0, dtype: int64, Roll 2 Maths 80 Physics 100 Chemistry 90 Name: 1, dtype: int64, Roll 3 Maths 90 Physics 80 Chemistry 70 Name: 2, dtype: int64, Roll 4 Maths 100 Physics 100 Chemistry 90 Name: 3, dtype: int64]

In this example, you can observe that we have created a list of rows from the dataframe. You can observe that the elements of the list are series objects and not arrays representing the rows.

Pandas DataFrame to List of Arrays in Python

Instead of creating a list of rows, we can create a list of arrays containing the values in rows from the dataframe. For this we will take out the values of the dataframe using the values attribute. The values attribute of the dataframe contains a 2-D array containing the row values of the dataframe. 

Once we get the values from the dataframe, we will convert the array to a list of arrays using the list() function. The list() function takes the values of the array as its input and returns the list of arrays as shown below.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) rowList=list(df.values) print("The list of rows is:") print(rowList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of rows is: [array([ 1, 100, 80, 90]), array([ 2, 80, 100, 90]), array([ 3, 90, 80, 70]), array([ 4, 100, 100, 90])]

In this example, you can observe that we have created a list of arrays from the dataframe.

Convert Pandas DataFrame to a List of Lists

Instead of creating a list of arrays, we can also convert pandas dataframe into a list of lists. For this, we can use two approaches.

Pandas DataFrame to a List of Lists Using iterrows() Method

To convert a dataframe into a list of lists, we will use the following approach.

  • First, we will create an empty list to store the output list. 
  • Next, we will iterate through the rows of the dataframe using the iterrows() method and a for loop. While iteration, we will convert each row into a list before adding it to the output list.
  • To convert a row into a list, we will use the tolist() method. The tolist() method, when invoked on a row, returns the list of values in the row. We will add this list to the output list using the append() method.

After execution of the for loop, the pandas dataframe is converted to a list of lists. You can observe this in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) rowList=list() for index,row in df.iterrows(): rowList.append(row.tolist()) print("The list of rows is:") print(rowList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of rows is: [[1, 100, 80, 90], [2, 80, 100, 90], [3, 90, 80, 70], [4, 100, 100, 90]] Using tolist() Method And The Values Attribute

Instead of using the iterrows() method and the for loop, we can directly convert the pandas dataframe to a list of lists using the values attribute. For this, we will first obtain the values in the data frame using the values attribute. Next, we will invoke the tolist() method on the values. This will give us the list of lists created from the dataframe. You can observe this in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) rowList=df.values.tolist() print("The list of rows is:") print(rowList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of rows is: [[1, 100, 80, 90], [2, 80, 100, 90], [3, 90, 80, 70], [4, 100, 100, 90]] Get a List of Column Names From Dataframe

To get a list of column names from a dataframe, you can use the columns attribute. The columns attribute of a dataframe contains a list having all the column names. You can observe this in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) nameList=df.columns print("The list of column names is:") print(nameList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of column names is: Index(['Roll', 'Maths', 'Physics', 'Chemistry'], dtype='object')

Alternatively, you can pass the entire dataframe to the list() function. When we pass a dataframe to the list() function, it returns a list containing the columns of the dataframe. You can observe this in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) nameList=list(df) print("The list of column names is:") print(nameList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of column names is: ['Roll', 'Maths', 'Physics', 'Chemistry'] Convert Dataframe Column to a List in Python

To convert a dataframe column to a list, you can use the tolist() method as shown in the following example.

import pandas as pd myDicts=[{"Roll":1,"Maths":100, "Physics":80, "Chemistry": 90}, {"Roll":2,"Maths":80, "Physics":100, "Chemistry": 90}, {"Roll":3,"Maths":90, "Physics":80, "Chemistry": 70}, {"Roll":4,"Maths":100, "Physics":100, "Chemistry": 90}] df=pd.DataFrame(myDicts) print("The original dataframe is:") print(df) rollList=df["Roll"].tolist() print("The list of Roll column is:") print(rollList)

Output:

The original dataframe is: Roll Maths Physics Chemistry 0 1 100 80 90 1 2 80 100 90 2 3 90 80 70 3 4 100 100 90 The list of Roll column is: [1, 2, 3, 4]

In this example, you can observe that we have used the tolist() method to convert a dataframe column to a list.

Conclusion

In this article, we discussed different ways to convert pandas dataframe to list in python. We also discussed how to convert the dataframe to a list of rows as well as a list of lists. To know more about python programming, you can read this article on Dataframe Constructor Not Properly Called Error in Pandas. You might also like this article on how to split string into characters in Python.

I hope you enjoyed reading this article. Stay tuned for more informative articles.

Happy Learning!

The post Pandas DataFrame to List in Python appeared first on PythonForBeginners.com.

Categories: FLOSS Project Planets

Axelerant Blog: Why Did We Choose Enthusiasm As A Core Axelerant Value

Planet Drupal - Fri, 2023-03-17 08:44
Introduction

This article explores why "enthusiasm" is a core organizational value within a fully remote company like Axelerant.

Categories: FLOSS Project Planets

Real Python: The Real Python Podcast – Episode #149: Coding With namedtuple & Python's Dynamic Superpowers

Planet Python - Fri, 2023-03-17 08:00

Have you explored Python's collections module? Within it, you'll find a powerful factory function called namedtuple(), which provides multiple enhancements over the standard tuple for writing clearer and cleaner code. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder's Weekly articles and projects.

[ 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

Web Review, Week 2023-11

Planet KDE - Fri, 2023-03-17 07:51

Let’s go for my web review for the week 2023-11.

MoonRay Production Renderer

Tags: tech, foss, 3d, movie

This is a huge! DreamWorks Animation releasing its rendering pipeline as free software.

https://openmoonray.org/


Who reads your email?

Tags: tech, email, decentralized, self-hosting

This is very very centralized. No good surprise here unfortunately… and still email is really tough to fully self-host.

https://www.netmeister.org/blog/mx-diversity.html


Microsoft just laid off one of its responsible AI teams

Tags: tech, ai, microsoft, ethics, gpt

Well, people asking relevant questions slow you down obviously… since the goal about the latest set of generative models is to “move them into customers hands at a very high speed” this creates tension. Instead of slowing down they seem hell bent at throwing ethics out of the window.

https://www.platformer.news/p/microsoft-just-laid-off-one-of-its


GPT-4’s successes, and GPT-4’s failures - by Gary Marcus

Tags: tech, ai, gpt, ethics, science

The lack of transparency is staggering… this is purely about hype and at that point they’re not making any effort to push science forward anymore.

https://garymarcus.substack.com/p/gpt-4s-successes-and-gpt-4s-failures


Vim Best Practices For IDE Users

Tags: tech, tools, ide, vim

Very thorough overview of everything you can do with vim but also your IDE vim emulation.

https://betterprogramming.pub/50-vim-mode-tips-for-ide-users-f7b525a794b3


What a good debugger can do

Tags: tech, debugging, tools

I find debuggers to be underused at quite a few places. A shame when you see what they can do nowadays, and they keep improving!

https://werat.dev/blog/what-a-good-debugger-can-do/


Git Worktree: Enhance your Git Workflow

Tags: tech, tools, git

An often forgotten feature of git. That said it is very convenient when we need to juggle several branches at the same time. This can save some time and space.

https://www.dylanpaulus.com/posts/git-worktree


macige • mobile app CI workflow generator

Tags: tech, ci, mobile

Early days but could turn out useful when it gets more complete. Good way to easily have a CI pipeline targeting mobile platforms.

https://macige.tramline.app/


GitHub - huytd/comby-search: A code search tool based on Comby

Tags: tech, tools, refactoring

Looks like it completes Comby nicely for the search only case.

https://github.com/huytd/comby-search


Remote Synthesis | The Price Developers Pay for Loving Their Tools Too Much

Tags: tech, react, culture, tools

Excellent post about getting too invested in a single tool. We can loose flexibility in the process. Also in the case of React, I didn’t realize until now that half of the web developers have never known a time when React didn’t exist!

https://remotesynthesis.com/blog/the-price-of-developer-tools/


In Defense of Crusty Old Swiss Army Knives // Zach Goldstein

Tags: tech, django, htmx, react, frontend, backend

Nice exploration of Django + HTMX + web components for a CRUD use case. Interesting insights and highlights some of the limitations with HTMX.

https://zachgoldstein.engineering/posts/crusty-knives/crusty-knives/


Choose boring tools – Eduards Sizovs

Tags: tech, architecture, complexity

Definitely this. If it’s too fancy and fashionable you’re likely to pay it in later with the undue complexity it introduced.

https://sizovs.net/boring/


Debugging Architects - The Architect Elevator

Tags: tech, system, architecture, organization

Indeed, it’s important for architects to get their “hands dirty”. Organizations where it’s not the case prevent their architects to challenge their assumptions pushing them to stay in their ivory tower. It’s a good way for bad decisions to pile up over time.

https://architectelevator.com/transformation/debugging-architect/


Jade Rubick - Advice for new directors

Tags: tech, management

Interesting advises for higher management roles. The information gathering and the distorsion fields are key factors to have in mind to not loose perspective. Otherwise it’s when you’ll start doing more harm than good.

https://www.rubick.com/advice-for-new-directors/


Research: Do People Really Get Promoted to Their Level of Incompetence?

Tags: management, hr, career

Interesting, this seems to empirically confirm the Peter Principle, at least in sales. Also shows that companies are trying to workaround it. Dual career ladders seem to be an interesting path for this.

https://hbr.org/2018/03/research-do-people-really-get-promoted-to-their-level-of-incompetence


No heroes needed

Tags: tech, team, management, project-management

Definitely this as well. Having “heroes” brings obscurity and hide the problems, this prevents management from knowing and handling the issues. This also create lots of missed opportunities for collective learning and improvements.

https://rpadovani.com/no-heroes


Nearly 40% of software engineers will only work remotely | TechTarget

Tags: tech, remote-working, hr, hiring

The report is very US centric. Still it looks like the future standard for developer jobs will be more and more remote.

https://www.techtarget.com/searchhrsoftware/news/365531979/Nearly-40-of-software-engineers-will-only-work-remotely


See the First Complete Map of an Insect’s Brain | Smart News| Smithsonian Magazine

Tags: science, neuroscience

Very import milestone for brain mapping. Far from more complex animals of course and an insane amount of work each time. Still the common fruit fly is already revealing interesting new facts about neurology.

https://www.smithsonianmag.com/smart-news/see-the-first-complete-map-of-an-insects-brain-180981778/


Shoshikantetsu

Tags: culture, japan

Interesting japanese term. “Complete what was originally intended”. A few more proposed at this end of this short post.

https://asnewman.github.io/shoshikantetsu


Bye for now!

Categories: FLOSS Project Planets

The Drop Times: Von Eaton Addresses 'Back to Work for Women'

Planet Drupal - Fri, 2023-03-17 05:44
International Centre for Free and Open Source Software (ICFOSS), Kerala partnered with Zyxware Technologies to offer Drupal training for women who had career breaks owing to various reasons. This was the fifth edition of the program titled Back to Work for Women. The 15 day program started on March 01 and will end on March 19, 2023.
Categories: FLOSS Project Planets

eGenix.com: PyDDF Python Spring Sprint 2023

Planet Python - Fri, 2023-03-17 05:00

The following text is in German, since we're announcing a Python sprint in Düsseldorf, Germany.

Ankündigung

Python Meeting Herbst Sprint 2023 in
Düsseldorf

Samstag, 25.03.2023, 10:00-18:00 Uhr
Sonntag, 26.03.2023. 10:00-18:00 Uhr

Atos Information Technology GmbH, Am Seestern 1, 40547 Düsseldorf

Informationen Das Python Meeting Düsseldorf (PyDDF) veranstaltet mit freundlicher Unterstützung der Atos Information Technology GmbH ein Python Sprint Wochenende.

Der Sprint findet am Wochenende 25./26.03.2023 in der Atos Niederlassung, Am Seestern 1, in Düsseldorf statt.Folgende Themengebiete sind als Anregung bereits angedacht:
  • Workflows mit Ray
  • Time Tracker mit automatischem Berücksichtigen von betrieblichen Pausenvorgaben
  • Monitoring für Balkonkraftwerke: Prometheus Exporter und MQTT
  • Distanzmessung von Qrovo Nodes via Micropython
  • Projekt manage_django_project (Helper to develop Django projects)
Natürlich können die Teilnehmenden weitere Themen vorschlagen und umsetzen.
Anmeldung, Kosten und weitere Infos

Alles weitere und die Anmeldung findet Ihr auf der Meetup Sprint Seite:

WICHTIG: Ohne Anmeldung können wir den Gebäudezugang nicht vorbereiten. Eine spontane Anmeldung am Sprint Tag wird daher vermutlich nicht funktionieren. Also bitte unbedingt mit vollen Namen bis spätestens am Freitag, 24.03., über Meetup anmelden.

Teilnehmer sollten sich zudem in der PyDDF Telegram Gruppe registrieren, da wir uns dort koordinieren:
Über das Python Meeting Düsseldorf

Das Python Meeting Düsseldorf ist eine regelmäßige Veranstaltung in Düsseldorf, die sich an Python-Begeisterte aus der Region wendet.

Einen guten Überblick über die Vorträge bietet unser PyDDF YouTube-Kanal, auf dem wir Videos der Vorträge nach den Meetings veröffentlichen.

Veranstaltet wird das Meeting von der eGenix.com GmbH, Langenfeld, in Zusammenarbeit mit Clark Consulting & Research, Düsseldorf.

Viel Spaß !

Marc-André Lemburg, eGenix.com

Categories: FLOSS Project Planets

Droptica: Drupal for professional publishing - Thunder CMS overview

Planet Drupal - Fri, 2023-03-17 04:41

Nowadays, software has become crucial for the functioning of large publishers. It supports the process of creating, publishing and distributing content, and also allows monitoring and analyzing users and market data. In the following article, we would like to introduce you to one of the available tools that improve the process of creating a website and increase the quality of daily work on content. This solution is the Thunder distribution based on Drupal CMS.

What is Thunder?

Thunder is an open source content management system aimed at professional publishers. The tool is also one of Drupal's free distributions, i.e. its version enriched with additional modules and extensions, which are available out of the box and are targeted at facilitating user work in specific aspects.

In the case of Thunder, we are dealing with a tool for all kinds of publishers. Both small and large information portals, publisher websites, and even blogs can benefit from its functionalities. Popular magazines such as Elle, InStyle, and Playboy use it in everyday work. Further down the article, we'll present details about the distribution itself and some of its most interesting and useful options.

Popularity and authors

Currently, over 800 websites report using Thunder, and the distribution itself is regularly developed and supported by the authors and users. As a result, the stability and community support for this solution are at least at a satisfactory level.

The author of Thunder is Hubert Burda Media - a German media group that has been developing this project since 2016 (the first version was released in January 2017). Their experience allowed them to tailor a tool to the needs of the industry they are members of. Thunder was designed to solve real problems and facilitate the daily work of other publishing or media companies.

Thunder download and installation

Thunder as a project is available at: https://www.drupal.org/project/thunder and we can find complete installation instructions in the documentation.

To install Thunder, we need a server with access to PHP, a database and Composer. The article with tips on how to generate a local development environment will help us prepare these elements.

The latest version of Thunder 6, which we recommend, is based on Drupal 9, therefore it shares the hardware requirements with it. These include: PHP in at least 7.3 version (although the recommended version is 8) and Apache in at least 2.4.7 version. In the case of the database, the values will vary depending on which database we decide to use. We can find a full list of hardware requirements in Drupal's documentation.

Once we deal with the necessary preparation, the distribution installation requires only two commands:

1. Project creation and installation


2. Quick start


And that's basically it. After following these steps, we have our first Thunder instance on the local environment ready for work.

We recommend delving deeper into the above-mentioned installation documentation available on Drupal’s website. There we’ll find more details and additional information that will help us launch a new project.

Thunder CMS - review and functionalities

As we mentioned above, Thunder is a distribution aimed at publishers. Its main and most commonly used functionality will therefore be the article creation window. We'll go through the process of adding content, indicating the elements that streamline and improve our work. We'll take up the topic in two parts: article creation and additional functions, in order to separate these aspects from each other.

Article creation

To Drupal users, this window may seem both familiar and foreign. The longer we look at this screen, the more we'll be surprised by the solutions not accessible in the standard version of Drupal. Let's go through all sections to see what possibilities Thunder offers us.

BASIS
 

Source: Thunder CMS

In addition to the standard Title field to complete the title, there are also several new features here.

Channel

The Channel field allows us to assign an article to one of the main channels. The list of available channels can be configured and extended at: /admin/structure/taxonomy/manage/channel/overview

 

This function allows us to organize the content and its purpose. In the example above, we see a standard division into events and messages. This type of solution enables us to easily and effectively distribute the content within specific channels. On our test web page, this helped us create separate subpages presenting content from these two categories.

 

SEO Title

This is the title that isn't visible to the user but is read by robots crawling and indexing our website. Its quality and compliance with certain rules are crucial to strengthen the web page’s position in Google or Bing search engines.

This title is also used to automatically generate the address of our article, so it's a good idea to keep it in mind and include the keywords for our content here.

This field is also enriched with a "validity indicator" oscillating between the colors: red (bad), yellow (correct), and green (good). The dynamic bar illustrates whether we stick to the set rules, such as the length of the title. This indicator updates automatically when filling out the title, so there's no need to refresh the web page.


Tags

These are the keywords that allow us to group the content. This is one of the integral elements of contemporary content creation. Thunder CMS treats this matter seriously and proposes a simple but complementary way to generate and add tags. The Tags field lets us choose the predefined tags and create new ones on the fly.

All the tags we defined are available here: /admin/structure/taxonomy/manage/tags/overview. Here we can edit, remove and add new ones.

Example of creating tags in Thunder CMS:

 

In addition to the name itself, tags may also contain additional, extensive information, thanks to using Paragraphs, which actions we present later in the article.

In this way, we can easily search for the prepared tag and add it to our article.

 


That's not all, though. If a tag is missing from the list, we don't have to leave the article editing window in order to add it. We just enter a new expression in the TAGS field, and the right tag will be created in the background.


TEASER

Teaser text

This is an introductory text that aims to familiarize the user with the topic of our article. It usually displays at the very beginning of the content and is separated from the rest of the post. Teaser text is also used as a teaser on article testing web pages and when sharing the content within such channels as Facebook and Google.


Image

Thunder CMS provides the ability to easily add and edit graphics.

First of all, we can add photo in two ways:

  • We choose a photo from among the files already added to the system. Filtering them by status and the ability to search by name helps here. It's also a good way to use the graphics prepared and processed earlier by a graphic designer, and add them to the system ​​for later convenient use of the ready files. This creates the opportunity to build our own media collection, which can be used many times in different ways, without having to fill up disk space with the same images.
     

 

  • We import photos. Here we can upload a photo from our computer.
     


However, the possibilities don't end with adding a photo. Each image can be described by using a number of fields, such as:

  • name: main name of the photo, by witch we’ll be able to search for it in the future,
  • tags: created exactly on the same principle as described above,
  • alternative text: photo description used by screen readers for blind people, and also important for the website's SEO,
  • title: title of our photo,
  • description: description of the photo and its content,
  • credits: author and source, if the image doesn’t belong to us,
  • expires: date indicating when the picture will no longer be valid - a field used for more complex cases, such as purchasing rights to a photo for a specific period.
     


An additional feature in Thunder CMS, invisible at first glance, is the ability to select a "point of focus" in the photo, symbolized by the cross icon. By clicking anywhere on the graphic, we can choose its most important point. This is used when framing and cropping the photo. By indicating this point, we can be sure that regardless of how the image is displayed, the most crucial element will always be visible.
 


Under the thumbnail image, we can also find a magnifier icon, which when clicked will show us how the photo will be displayed in various cases:
 


PARAGRAPHS

Paragraphs are a key functionality used to build an article. It's a system for creating content using separate blocks (paragraphs) that can be one of many types of content. All paragraphs - once added - we can freely edit and change their order, like laying "blocks" of various types. 
 


The basic paragraphs built into Thunder CMS, from which we may build an article, are:

1. Text

The fundamental tool for writing the content itself. With the support of the extremely popular CKEditor module it becomes an extensive editor that meets even complex requirements.
 


For more advanced users, it's also possible to edit content directly in the HTML code field:
 


2. Image

The option of adding and editing a photo that works on exactly the same principle as we described above in the TEASER section.

3. Gallery

It allows creating photo galleries. The process itself is very simple and similar to what was presented above in the image section. The only difference here is the ability to add many photos at once.

An example of adding a photo gallery in Thunder CMS:
 


The gallery created in this way will be displayed on the web page in the form of a slider, with the possibility to switch photos, as in the picture below:
 


4. Instagram

In this field, we can provide the URL of an Instagram post to embed on the website. Unfortunately, using this option requires additional work from us. For security reasons and due to the requirements arising from Meta's policy, authentication is necessary. We can do this by completing the configuration: /admin/config/media/instagram-settings.
 


It's required to create an appropriate account here to obtain the indicated data. We can find full configuration instructions on the official Facebook documentation web page.

5. Twitter

The field for embedding Twitter posts. Unlike Instagram, it works straight away and doesn't require any additional actions.
 


6. Pinterest

As with Twitter, in this field we embed a link to a Pinterest post.
 


7. Video

As with the photo editor, we have the ability to select a previously added movie from the media library or create a new video.
 


When adding a new video, we can also insert it using a link from portals such as YouTube, Vimeo, or Tiktok. Such a movie, depending on the selected source, is embedded on the web page with the appropriate player.

8. Link

This field lets us insert a link with an optional anchor text. It should be displayed as:
 


9. Quote

This option allows for creating a quote.
 


Note that we mentioned above only those paragraphs that are built directly into the Thunder distribution. They fulfill most of the basic needs arising from creating an article. However, the system itself doesn't limit us to using these options only.

For more advanced users or developers, Thunder CMS makes it possible to build custom paragraphs that meet any requirements. Thus, this tool in the right hands is extremely powerful, and the number of possibilities - is virtually unlimited.

Publication options

Another important element of any content creation tool is the ability to configure and manage the publication. Thunder CMS also provides us with extensive and adjustable functions here.

What catches our eye is the publication bar "fixed" to the bottom of the screen.
 


With its help, we're able to save or delete the article at any time, as well as change its status to one of the following:

  • draft: rough version, not visible to users,
  • unpublished: finished but unpublished article, not visible to users,
  • published: published article available to everyone.

Another vital element is the side menu for more complex operations.
 


Here we can find information about the date of the last saved version of the document, the possibility of creating a new revision during saving, or leaving information when making such a revision.

Let's stop for a moment to take a look at the concept of revision. What does it mean? Thunder, by default, provides versioning for every change in our article. Using the REVISIONS item in the menu, we are able to view all saved versions of our document:
 


It allows us to compare the differences between versions and restore previous versions.
 


This is a handy and simple solution ensuring that no changes will be lost, and in case of any mistake, it'll be easy to restore the last correct version of our website.

Among the available options of our sidebar, we can also find:

  • Meta tags: an extensive tool enabling customization of the default meta values of our website. A beneficial and comprehensive solution for SEO specialists.
     

 

  • Simple XML Sitemap: the configurations concerning the website regarding its existence within the sitemap. We can decide here whether the article is to be indexed and what priority it should have. And yes – Thunder includes an automatically generated XML sitemap by default.
     

 

  • URL alias: as we mentioned above, the alias of our website is automatically generated based on the SEO title, but to leave us complete freedom and configurability, Thunder’s creators also allow editing the alias from this position.
     

 

  • URL redirects: enables creating and managing the redirections on our website.
     

 

  • Scheduling options: an extremely useful option that allows scheduling the article publication. From here, we can also set the end date of the publication - this option can be helpful, for example, in the case of a sponsored article, which is to be displayed on our website only for a certain time period.
     

 

  • Authoring information: fully editable information about the author and the creation date of the article.

 


This concludes our adventure with the article creation window. It’s an essential part of Thunder CMS and the place where editors and content creators spend the most time. The comprehensive solution proposed by Thunder is one of the best on the market because it combines ease of use with the complexity of possibilities.

Additional functionalities

In addition to the core Thunder’s functionality, i.e. the editor, with which we spend most of our time, this system also has a number of other useful elements. We would like to present some of these and show you how to use them.

Mobile preview

The creators of Thunder are aware that we live in a world dominated by mobile devices. Therefore, they provide us with a content management system which allows us to check whether articles display properly on smartphones and tablets.

When logging in as an administrator, we can find a phone icon in the admin bar anywhere on the web page. Clicking it allows us to select the model of a mobile device for simulation. As a result, our website will go into mobile version inspection mode, visible only to us. It's a great and simple tool that enables finding any irregularities on our web page in the blink of an eye.
 


Liveblog

The name of this module already describes its use. Liveblog allows us to create dynamic, real-time changing articles. It's an ideal solution for reporting sports events or dynamically evolving crisis situations. There are many ways to use it, and we're sure that already while reading this paragraph, you'll come up with at least a few new ones.

Demo Content and Guided Tour

By installing these additional modules (they are already included with the system, we only need to turn them on), we get Thunder with basic configuration and sample content. This allows us to get used to the system faster and understand specific dependencies. All screenshots in this article come from Demo Content. In addition, the admin bar is enriched with the Tour icon, and after clicking it, we're guided through the possibilities and functionalities of Thunder. It's a great way to start the adventure with this system.
 

CMS Thunder for the Zawsze Pomorze news magazine

One of our projects created with Thunder is the website of the Pomeranian regional portal Zawsze Pomorze. The client wanted an easy-to-use, yet a sufficiently extensive system that would allow many journalists to work on several articles at the same time and to manage the publication efficiently.

The website includes an extensive category system, allows for leaving comments, creating "live" articles, and has a complex system of adding and editing sections for individual categories on the home page. The layout can be dynamically edited without any technical knowledge. The system also includes a window for supporting the authors with donations, visible directly on the article page.

Thunder CMS review – summary

From the developers’ perspective, we have to admit that working on projects using Thunder is extremely pleasant. The number of possibilities this tool provides out of the box meets most of the requirements. As programmers, we can create and develop CMS systems for media and publishers, focusing only on individual needs and solutions. This greatly shortens the development process and allows building even large-sized websites in a relatively short time.

From the publisher point of view, it's also a very decent system that meets many needs. It maintains the perfect balance between the number of possibilities and their simplicity of use - we are never overwhelmed with a large number of often redundant options. The reduced development time also allows investing in additional functionalities, as the very core on which Thunder is based is a robust and comprehensive solution.

Categories: FLOSS Project Planets

Python Engineering at Microsoft: Introducing the Data Wrangler extension for Visual Studio Code Insiders

Planet Python - Thu, 2023-03-16 21:29

We’re excited to announce the launch of Data Wrangler, a revolutionary tool for data scientists and analysts who work with tabular data in Python. Data Wrangler is an extension for VS Code Insiders and the first step towards our vision of simplifying and expediting the data preparation process on Microsoft platforms.

Data preparation, cleaning, and visualization is a time-consuming task for many data scientists, but with Data Wrangler we’ve developed a solution that simplifies this process. Our goal is to make this process more accessible and efficient for everyone, to free up your time to focus on other parts of the data science workflow. To try Data Wrangler today, go to the Extension Marketplace tab in VS Code Insiders and search for “Data Wrangler”. To learn more about Data Wrangler, check out the documentation here: https://aka.ms/datawrangler.

With Data Wrangler, you can seamlessly clean and explore your data in VS Code Insiders. It offers a variety of features that will help you quickly identify and fix errors, inconsistencies, and missing data. You can perform data profiling and data quality checks, visualize data distributions, and easily transform data into the format you need. Plus, Data Wrangler comes with a library of built-in transformations and visualizations, so you can focus on your data, not the code. As you make changes, the tool generates code using open-source Python libraries for the data transformation operations you perform. This means you can write better data preparation programs faster and with fewer errors. The code also keeps Data Wrangler transparent and helps you verify the correctness of the operation as you go.

In a recent study, Python data scientists using the Pandas dataframe library report spending the majority (~51%) of their time preparing, cleaning and visualizing data for their models (Anaconda State of Data Science Report 2022). This activity is critical to the success of their projects, as poor data quality directly impacts the quality of the predictions made by their models. Furthermore, this activity is not predictable: the industry even calls it exploratory data analysis to capture the fact that it is often highly creative, requiring experimentation, visualization, comparison and iteration. However, despite the activity being creative and iterative, the individual operations are not – they involve writing small code snippets that drop columns, remove missing values, etc. But today there isn’t tooling support that makes it easier; In our research with data scientists, we regularly see them searching for and copy-pasting snippets of code from Stack Overflow into their programs.

Data Wrangler Interface

With Data Wrangler, we’ve developed an interactive UI that writes the code for you. As you inspect and visualize your Pandas dataframes using Data Wrangler, generating the code for your desired operations is easy. For instance, if you want to remove a column, you can right-click on the column heading and delete it, and Data Wrangler will generate the Python code to do that. If you want to remove rows containing missing values or substitute them with a computed default value, you can do that directly from the UI. If you want to reformat a categorical column by one-hot encoding it to make it suitable for machine learning algorithms, you can do so with a single command.

Create column from examples

Data scientists often need to create a new derived column from existing columns in their Pandas dataframe, which usually involves writing custom code that can easily become a source of bugs. With Data Wrangler, all you need to do is provide examples of how you want the data in the derived column to look like, and PROSE, our AI-powered program synthesis technology (the same technology that powers Microsoft Excel’s Flash Fill feature), will write the Python code for you. If you find an error in the results, you can correct it with a new example, and PROSE will rewrite the Python code to produce a better result. You can even modify the generated code yourself.

 

How to try Data Wrangler

To start using Data Wrangler today in Visual Studio Code Insiders, just download the Data Wrangler extension from the marketplace and visit our getting started page to try it out! You can then launch Data Wrangler from any Pandas dataframe output in a Jupyter Notebook, or by right-clicking any CSV or Parquet file in VS Code and selecting “Open in Data Wrangler”.

This is the first release of Data Wrangler so we are looking for feedback as we iterate on the product. Please provide any product feedback here. If you run into any issues, please file a bug report in our Github repo here. Our plan is to move the extension from VS Code Insiders to VS Code in the near future.

The post Introducing the Data Wrangler extension for Visual Studio Code Insiders appeared first on Python.

Categories: FLOSS Project Planets

Reproducible Builds (diffoscope): diffoscope 239 released

Planet Debian - Thu, 2023-03-16 20:00

The diffoscope maintainers are pleased to announce the release of diffoscope version 239. This version includes the following changes:

[ Chris Lamb ] * Fix compatibility with pypdf 3.x, and correctly restore test data. (Closes: reproducible-builds/diffoscope#335) * Rework PDF annotations processing into a separate method.

You find out more by visiting the project homepage.

Categories: FLOSS Project Planets

A Big Thank You Community! KDE Snaps resumed and More.

Planet KDE - Thu, 2023-03-16 18:07
Snowy Sunrise Witch Wells, Az

After my last post a few things have happened. First, I want to thank all of you for your support, monetary and moral. The open source community is amazing and I love being a part of it. We are surviving thanks to all of you. Despite my failed interview, a new door has opened up and I am happy to announce that Canonical is funding me to work part time for a period of 3 months on KDE Snaps! While not the full time role I was hoping for, I’ll take it, and who knows, maybe they will see just how awesome I am!

I started back to work on these last Tuesday. So far I have made good progress and even have a working Core22 snap!

Work done on upstream snapcraft ( tool used to make snaps ):

New content pack version, fixed an issue with snapcraft remote-build choking on part with /sdk, fixed regex as our naming scheme has changed:

https://github.com/snapcore/snapcraft/pull/4069

Ran into a new bug with snapcraft expand-extensions and so I must now enter all of this information manually into snapcraft.yaml until fixed, bug report here:

https://bugs.launchpad.net/snapcraft/+bug/2011719

And without further ado, our first core22 snap is Dragonplayer Version 22.12.3 available in the snap store. Many more coming soon!

KDE Dragon media player

With a new month upon us, I must ask for help again, I will not see any money for this work until next month. Please consider a dontation. Thank you from the bottom of our hearts.

https://gofund.me/c9cc02ed

Categories: FLOSS Project Planets

Scarlett Gately Moore: A Big Thank You Community! KDE Snaps resumed and More.

Planet Debian - Thu, 2023-03-16 18:07
Snowy Sunrise Witch Wells, Az

After my last post a few things have happened. First, I want to thank all of you for your support, monetary and moral. The open source community is amazing and I love being a part of it. We are surviving thanks to all of you. Despite my failed interview, a new door has opened up and I am happy to announce that Canonical is funding me to work part time for a period of 3 months on KDE Snaps! While not the full time role I was hoping for, I’ll take it, and who knows, maybe they will see just how awesome I am!

I started back to work on these last Tuesday. So far I have made good progress and even have a working Core22 snap!

Work done on upstream snapcraft ( tool used to make snaps ):

New content pack version, fixed an issue with snapcraft remote-build choking on part with /sdk, fixed regex as our naming scheme has changed:

https://github.com/snapcore/snapcraft/pull/4069

Ran into a new bug with snapcraft expand-extensions and so I must now enter all of this information manually into snapcraft.yaml until fixed, bug report here:

https://bugs.launchpad.net/snapcraft/+bug/2011719

And without further ado, our first core22 snap is Dragonplayer Version 22.12.3 available in the snap store. Many more coming soon!

KDE Dragon media player

With a new month upon us, I must ask for help again, I will not see any money for this work until next month. Please consider a dontation. Thank you from the bottom of our hearts.

https://gofund.me/c9cc02ed

Categories: FLOSS Project Planets

PyCharm: PyCharm 2023.1 Release Candidate Is Out!

Planet Python - Thu, 2023-03-16 15:03

PyCharm 2023.1 is just around the corner! Check out the fixes and improvements we added to the PyCharm 2023.1 Release Candidate.

To see what has already been added in PyCharm 2023.1 during the early access program, take a look at our EAP blog posts.

The Toolbox App is the easiest way to get the EAP builds and keep both your stable and EAP versions up to date. You can also manually download the EAP builds from our website.

Download PyCharm 2023.1 RC

Faster variable value previews for large collections

We optimized the performance of the Special Variable window available in the Python Console and Debug Console. A preview of the calculated variable values is now displayed faster, even for large collections such as arrays, deques, dictionaries, lists, sets, frozensets, and tuples.

To see the full list of variable values, click on View as …, Load next to the variable preview.

Instant access to the Python Console and Python Packages tool window

As part of our work to refine the new UI, we’ve put the Python Console icon on the main editor screen so that you can instantly navigate to the console when needed. Next to the Python Console icon, you can now find the icon for the Python Packages tool window, so you can quickly manage project packages.

The Release Candidate also delivers the following fixes:
  • Creating a remote Docker interpreter with an ENTRYPOINT defined in a Docker image or Dockerfile no longer leads to an error. [PY-55444]
  • Breakpoints are hit as expected when debugging a FastAPI project. [PY-57217]
  • Attaching a debugger to the process now works for ARM (Mac and Ubuntu). [PY-44191]
  • Virtualenv is now successfully activated on PowerShell in the Terminal. [PY-53890]
  • No warnings are shown for undocumented methods of subclasses with docstrings. The same works for an undocumented class in cases when it has a documented superclass. [PY-30967]

These are the most important updates for PyCharm 2023.1 Release Candidate. For the full list of improvements, check out the release notes. Share your feedback on the new features in the comments below, on Twitter, or in our issue tracker.

Categories: FLOSS Project Planets

Chromatic Insights: Why is Drupal 7's End-of-Life a Big Deal?

Planet Drupal - Thu, 2023-03-16 11:00
There has been quite a bit of talk about what it takes to upgrade to 'modern Drupal,' but less ink has been spilled painting a picture of what it will actually be like to still be responsible for a Drupal 7 site after that date.
Categories: FLOSS Project Planets

Drupal Association blog: The Drupal Association Supports ICFOSS/Zyxware Back-to-work Programme

Planet Drupal - Thu, 2023-03-16 10:00

The Drupal Association is honored to be included in this month’s cycle of the Back-to-work Programme, an initiative by the International Centre for Free and Open Source Software in collaboration with Zyxware Technologies. Zyxware Technologies is one of our amazing Drupal Certified Partners, and we are excited to contribute to the success of this program for many cycles to come.

The Back-to-work Programme provides Drupal training to women professionals who have been on a career break due to various reasons. This program not only aims to induct them into the talent pool of Drupal developers but also provides an opportunity to reintroduce them to the Free Software community.

The Drupal Association is committed to ensuring that the Open Web thrives and to providing talent and education opportunities to communities who need them most. It is our hope that by supporting ICFOSS, Zyxware, and the Back-to-work Programme, we can continue to expand access to the Drupal community and professional opportunities in the Drupal ecosystem and empower women everywhere in their pursuit of professional equity.

Von R. Eaton, Director, Programs for the Drupal Association, will present to this current cohort on the work being done at the Drupal Association in Open Source, DEI, and talent cultivation on Thursday, 16 March.

We are so excited about this collaboration and are very grateful to have been invited to participate. We look forward to working with Zyxware and ICFOSS to make a positive impact on women in the Drupal community.

Categories: FLOSS Project Planets

Gary Benson: Which APT repository did a package come from?

GNU Planet! - Thu, 2023-03-16 09:18
$ apt policy wget wget: Installed: 1.21.2-2ubuntu1 Candidate: 1.21.2-2ubuntu1 Version table: *** 1.21.2-2ubuntu1 500 500 http://gb.archive.ubuntu.com/ubuntu jammy/main amd64 Packages 100 /var/lib/dpkg/status
Categories: FLOSS Project Planets

Stack Abuse: Python TypeError: < not supported between instances of str and int

Planet Python - Thu, 2023-03-16 08:23
Introduction

In this article, we'll be taking a look at a common Python 3 error: TypeError: '<' not supported between instances of 'str' and 'int'. This error occurs when an attempt is made to compare a string and an integer using the less than (<) operator. We will discuss the reasons behind this error and provide solutions for fixing it. Additionally, we will also cover how to resolve this error when dealing with lists, floats, and tuples.

Why You Get This Error

In most languages, you probably know that the less than (<) operator is used for comparison between two values. However, it is important to note that the two values being compared must be of the same type or be implicitly convertible to a common type. For example, two implicitly convertable types would be an integer and a float since they're both numbers. But in this specific case, we're trying to compare a string and an integer, which are not implicitly convertable.

When you try to compare a string and an integer using one of the comparison operators, Python raises a TypeError because it cannot convert one of the values to a common type.

For instance, consider the following code:

num = 42 text = "hello" if num < text: print("The number is smaller than the text.") # confused.jpg

In this example, the comparison between num (an integer) and text (a string) using the less than operator will raise the error:

TypeError: '<' not supported between instances of 'str' and 'int' How to Fix this Error

To fix this error, you need to ensure that both values being compared are of the same type or can be implicitly converted to a common type. In most cases, this means converting the integer to a string or vice versa.

Using a similar example as above, here's how you can resolve the error:

  1. Convert the integer to a string:
num = 42 text = "46" if str(num) < text: print("The number is smaller than the text.")
  1. Convert the string to an integer:
num = 42 text = "46" # Assuming 'text' represents a numeric value numeric_text = int(text) if num < numeric_text: print("The number is smaller than the text.")

This example works because the string does represent an integer. If, however, we were to try this fix on the example at the beginning of this article, it wouldn't work and Python would raise another error since the given text is not convertable to an integer. So while this fix works in some use-cases, it is not universal.

Fixing this Error with Lists

When working with lists, the error may occur when trying to compare an integer (or other primitive types) to a list.

my_list = ["1", "2", "3"] if my_list > 3: print("Greater than 3!") TypeError: '>' not supported between instances of 'list' and 'int'

In this case, the fix really depends on your use-case. When you run into this error, the common problem is that you meant to compare the variable to a single element in the list, not the entire list itself. Therefore, in this case you will want to access a single element in the list to make the comparison. Again, you'll need to make sure the elements are of the same type.

my_list = ["1", "2", "3"] if int(my_list[1]) > 3: print("Greater than 3!") Greater than 3! Fixing this Error with Floats

When comparing floats and strings, the same error will arise as it's very similar to our first example in this article. To fix this error, you need to convert the float or the string to a common type, just like with integers:

num = 3.14 text = "3.15" if float(text) < num: print("The text as a float is smaller than the number.") Fixing this Error with Tuples

When working with tuples, just like lists, if you try to compare the entire tuple to a primitive value, you'll run into the TypeError. And just like before, you'll likely want to do the comparison on just a single value of the tuple.

Another possibility is that you'll want to compare all of the elements of the tuple to a single value, which we've shown below using the built-in all() function:

str_tuple = ("1.2", "3.2", "4.4") my_float = 6.8 if all(tuple(float(el) < my_float for el in str_tuple)): print("All are lower!")

In this example, we iterate through all elements in the touple, convert them to floats, and then make the comparison. The resulting tuple is then checked for all True values using all(). This way we're able to make an element-by-element comparison.

Conclusion

In this article, we discussed the TypeError: '<' not supported between instances of 'str' and 'int' error in Python, which can occur when you try to compare a string and an integer using comparison operators. We provided solutions for fixing this error by converting the values to a common type and also covered how to resolve this error when working with lists, floats, and tuples.

By understanding the root cause of this error and applying the appropriate type conversion techniques, you can prevent this error from occurring and ensure your comparisons work as intended.

Categories: FLOSS Project Planets

Qt Creator 10 RC released

Planet KDE - Thu, 2023-03-16 07:29

We are happy to announce the release of Qt Creator 10 RC!

Categories: FLOSS Project Planets

Gary Benson: Python debugger

GNU Planet! - Thu, 2023-03-16 06:09

By the way, if you’ve never used Python’s debugger, it really is as simple as adding a call to the built-in function breakpoint() at the point you want it to stop.

Categories: FLOSS Project Planets

Pages