FLOSS Project Planets

Read the Docs: Read the Docs newsletter - August 2022

Planet Python - Tue, 2022-08-16 20:00

We continue to be excited about the expanded capacity we have with an additional team member. Our focus for July has been around a lot of marketing and positioning, trying to better understand how our customers view our product, and work with them to use it well.

We also had our 12th birthday just before publishing this newsletter. 🎉

New features

We’ve continued building a number of features and bug fixes in our roadmap:

  • We have more Example projects, which allow users to get started quickly with our products. We shipped an example for Jupyter Book this month, which is of growing interest to scientific and academic projects.
  • Scientific users are important for us, so we’ve put together a landing page that highlights the benefits that our scientific users are seeing.
  • We created a GitHub action that allows users to have a link to the Pull Request preview automatically added to the PR description. If users find this useful, we will continue to expand this functionality, and perhaps add it to our core platform so no configuration is needed.
  • We improved the convenience and security of our platform by making sure all invites for a team or project are seen and approved by the invited user.

You can always see the latest changes to our platforms in our Read the Docs Changelog.

Awesome documentation projects

We are collecting entries for Awesome Read the Docs Projects - please do tell us about your favorites, either by sending an email or opening a Pull Request!

  • Weblate - Weblate is a translation platform with a large documentation project with many translations and customized Read the Docs theme. Documentation aimed at all segments: users, administrators and developers. Also features an extensive Changelog.
  • TomoBank - a big list of tomographic datasets and phantoms, featuring especially tables and images and maintained by science community.
  • Uberspace - Customized sidebar and footer, adding project’s branding through custom CSS and HTML to sphinx_rtd_theme. Latest version and release date on front page.
Upcoming features
  • We are working on some improvements to our URL handling code, which will allow us to support more flexible URL configurations for projects.
  • As mentioned before, we are shifting some of our focus to frontend & marketing these next few months. We’re getting close to shipping our new landing page, which we’re excited about.
  • We’re continuing to focus on outreach for our new build customization features, so that we can continue to improve them with your feedback.
  • Our main theme sphinx_rtd_theme will soon be revived after a period of inactivity and we will do a number of smaller releases in Q3 and Q4.
Possible issues

We have unpinned Pillow for some Python versions. This could break some builds, but we haven’t receive any complaints yet.

We continue to actively deprecate jQuery from our code, as well as guide the Sphinx ecosystem through the transition.

Considering using Read the Docs for your next documentation project? Check out our documentation to get started!

Questions? Comments? Ideas for the next newsletter? Contact us!

Categories: FLOSS Project Planets

FSF Blogs: Escape to Freedom now also available in Mandarin and Spanish

GNU Planet! - Tue, 2022-08-16 16:20
"Escape to Freedom" is a new animated video from the Free Software Foundation (FSF), giving an introduction to the concepts behind software freedom: both what we gain by having it, and what rights are at stake. We now have the video available in Mandarin and Spanish language tracks.
Categories: FLOSS Project Planets

Escape to Freedom now also available in Mandarin and Spanish

FSF Blogs - Tue, 2022-08-16 16:20
"Escape to Freedom" is a new animated video from the Free Software Foundation (FSF), giving an introduction to the concepts behind software freedom: both what we gain by having it, and what rights are at stake. We now have the video available in Mandarin and Spanish language tracks.
Categories: FLOSS Project Planets

ImageX: Adding Social Media Buttons to Drupal: Everything you need to know

Planet Drupal - Tue, 2022-08-16 16:08
Social media integration is paramount for increasing your brand reach. It enables your website to work in tandem with social media platforms that will host a forecasted 4.59 billion users in 2022.  Social platforms enable you to enable prospects to interact with your brand authentically. Adding social platform buttons and widgets to your website can help your presence reach its fullest potential. Here are just a few examples of how your website and social media profiles can work as an efficient team:
Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #538 (Aug. 16, 2022)

Planet Python - Tue, 2022-08-16 15:30

#538 – AUGUST 16, 2022
View in Browser »

NLP Forward With Transformer Models and Attention

What’s the big breakthrough for Natural Language Processing (NLP) that has dramatically advanced machine learning into deep learning? What makes these transformer models unique, and what defines “attention?” This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, continues our talk about how machine learning (ML) models understand and generate text.
REAL PYTHON podcast

“Unstoppable” Python Remains More Popular Than C and Java

“Python seems to be unstoppable,” argues the commentary on August’s edition of the TIOBE index, which attempts to calculate programming-language popularity based on search results for courses, vendors, and “skilled engineers”.
SLASHDOT.ORG

Scout APM: Built For Developers, By Developers

Scout APM is a python monitoring tool designed to help developers find and fix performance issues quickly. With an intuitive user interface, Scout will tie bottlenecks to source code so you can quickly pinpoint and resolve performance abnormalities. Start your 14-day free trial today →
SCOUT APM sponsor

Adding Auditing to Pip

In light of recent supply-chain attacks on PyPi, people are talking about how to help secure their environments. Discussions on adding a security audit feature to pip have begun, but opinions differ widely. This article summarizes the conversation so far.
JAKE EDGE

Finding Performance Problems: Profiling or Logging?

Statistical profiling takes a sample of your code at run time and in intervals inspects the performance. Learn how to use this to help determine your performance bottlenecks even in production code.
ITAMAR TURNER-TRAURING

Python 3.11.0rc1 Released

PYTHON.ORG

Discussions Is Django Really the Slowest and Most Incomplete Framework?

REDDIT

What Python Feature Made You Think “Wow That’s a Thing?”

TREY HUNNER

Python Jobs Software Engineer Backend/Python (Anywhere)

Close

Software Engineer (Los Angeles or Dallas, USA)

Causeway Capital Management LLC

Backend Software Engineer (Anywhere)

Catalpa

Backend Engineering Manager (Anywhere)

Close

Python/JavaScript Full-Stack Engineers (Anywhere)

United States Senate Sergeant at Arms

More Python Jobs >>>

Articles & Tutorials Sorting a Python Dictionary: Values, Keys, and More

In this tutorial, you’ll get the lowdown on sorting Python dictionaries. By the end, you’ll be able to sort by key, value, or even nested attributes. But you won’t stop there—you’ll go on to measure the performance of variations when sorting and compare different key-value data structures.
REAL PYTHON

PEP 682 – Format Specifier for Signed Zero

Somewhat surprising to math people, both floats and the Decimal package support negative zero. As this can cause strange results, Python Enhancement Proposal 682 suggests a change to the string format specification to automatically normalize negative zero to positive zero.
PYTHON.ORG

Ray Summit 2022: The Industry Conference for Scalable AI and Python Applications

Join us August 22-24 in San Francisco to learn what’s next in AI and how Ray is transforming scalable AI and ML.
ANYSCALE sponsor

The Many Flavors of Hashing

As Python has the dict type built-in and hashing is a common part of objects, it is easy to forget that there is more than one way to hash an object. This high-level article describes many ways hashes are used in programming and the associated algorithms.
CIPRIAN DORIN CRACIUN

Text Extraction Using PyMuPDF

PyMuPDF is an open source Python programming library which provides convenient access to the C library MuPDF. This blog post explores text extraction using PyMUPDF and what differentiates it from other approaches.
HARALD LIEDER • Shared by Harald Lieder

How to Add a Text Editor to Django With Summernote

“No one wants to read unformatted text.” This article teaches you how to use the Summernote WYSIWYG editor plug-in to add formatting and images to your posts.
ALICE RIDGWAY

10 Malicious Python Packages Found

Ten more malicious packages have been found in a series of supply-chain attacks on PyPi. Increasingly, hosting sites are discussing how to handle the situation, with GitHub creating an RFC on package signing.
KEVIN PURDY

Exploring Special Function Parameters

In this Code Conversation video course, you’ll explore special function parameters that allow for positional-only arguments, keyword-only arguments, or a combination of the two.
REAL PYTHON course

The Magic of Matplotlib Stylesheets

With a single line of code, you can integrate a stylesheet with your Matplotlib visualization. This tutorial shows you how to make your very own custom reusable stylesheet.
KEVIN WHITE • Shared by Kevin White

Building a Slack-Bot With Python and Supabase

Learn how to use Python and Supabase to build a Slack-bot that consolidates messages from several channels.
RAMIRO NUÑEZ DOSIO • Shared by Ramiro Nuñez Dosio

Projects & Code jnumpy: Writing Python C Extensions With Julia

GITHUB.COM/SUZHOU-TONGYUAN

django-pgtrigger: Postgres Triggers in Django

GITHUB.COM/OPUS10 • Shared by Wes Kendall

perftester: Lightweight Performance Testing of Python

PYPI.ORG • Shared by Marcin Kozak

docker-django-example: Django on Docker Example

GITHUB.COM/NICKJJ

Events SOLID’s Single Responsibility Principle

August 17, 2022
MEETUP.COM

An Introduction to Cloud-Native Web Applications

August 17, 2022
MEETUP.COM

Weekly Real Python Office Hours Q&A (Virtual)

August 17, 2022
REALPYTHON.COM

Heidelberg Python Meetup

August 17, 2022
MEETUP.COM

PyStaDa

August 17, 2022
PYSTADA.GITHUB.IO

Happy Pythoning!
This was PyCoder’s Weekly Issue #538.
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

John Cook: Dump a pickle file to a readable text file

Planet Python - Tue, 2022-08-16 14:40

I got a data file from a client recently in “pickle” format. I happen to know that pickle is a binary format for serializing Python objects, but trying to open a pickle file could be a puzzle if you didn’t know this.

There are a couple problems with using pickle files for data transfer. First of all, it’s a security risk because an attacker could create a malformed pickle file that would cause your system to run arbitrary code. In the Python Cookbook, the authors David Beazley and Brian K. Jones warn

It’s essential that pickle only be used internally with interpreters that have some ability to authenticate one another.

The second problem is that the format could change. Again quoting the Cookbook,

Because of its Python-specific nature and attachment to source code, you probably shouldn’t use pickle as a format for long-term storage. For example, if the source code changes, all of your stored data might break and become unreadable.

Suppose someone gives you a pickle file and you’re willing to take your chances and open it. It’s from a trusted source, and it was created recently enough that the format probably hasn’t changed. How do you open it?

The following code will open the file data.pickle and read it into an object obj.

import pickle obj = pickle.load(open("data.pickle", "rb"))

If the object in the pickle file is very  small, you could simply print obj. But if the object is at all large, you probably want to save it to a file rather than dumping it at the command line, and you also want to “pretty” print it than simply printing it.

The following code will dump a nicely-formatted version of our pickled object to a text file out.txt.

import pickle import pprint obj = pickle.load(open("sample_data.pickle", "rb")) with open("out.txt", "a") as f: pprint.pprint(obj, stream=f)

In my case, the client’s file contained a dictionary of lists of dictionaries. It printed as one incomprehensible line, but it pretty printed as 40,000 readable lines.

Related posts The post Dump a pickle file to a readable text file first appeared on John D. Cook.
Categories: FLOSS Project Planets

PyBites: Annotate all the things! Why you should care about Python type hints …

Planet Python - Tue, 2022-08-16 10:03

Listen now:

This week we have Will Frey on the podcast: ML engineer, Python “knowledge dictionary” and type hints fan & geek.

We talk about his background, how he learns / keeps up with Python’s fast moving ecosystem and of course we look at Python’s type hints in-depth: why care and some of his favorite tricks. 

We hope you enjoy this episode.

Links:
– typing docs
– mypy docs
– PEP 484 – Type Hints
– PEP 483 – Theory of Type Hints
– PEP 526 – Syntax for Variable Annotations
– PEP 544 – Protocols: Structural subtyping (static duck typing)
– PEP 561 – Distributing and Packaging Type Information
– typing notes (unmentioned, but useful)
– grep.app

(We told you, he lives and breathes this stuff haha)

Categories: FLOSS Project Planets

Real Python: Caching in Python With lru_cache

Planet Python - Tue, 2022-08-16 10:00

There are many ways to achieve fast and responsive applications. Caching is one approach that, when used correctly, makes things much faster while decreasing the load on computing resources.

Python’s functools module comes with the @lru_cache decorator, which gives you the ability to cache the result of your functions using the Least Recently Used (LRU) strategy. This is a simple yet powerful technique that you can use to leverage the power of caching in your code.

In this video course, you’ll learn:

  • What caching strategies are available and how to implement them using Python decorators
  • What the LRU strategy is and how it works
  • How to improve performance by caching with the @lru_cache decorator
  • How to expand the functionality of the @lru_cache decorator and make it expire after a specific time

By the end of this video course, you’ll have a deeper understanding of how caching works and how to take advantage of it in Python.

[ 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

Tag1 Consulting: Alex Ross on Drupal, module maintenance, NYC DrupalCamp, and getting kicked out of 30 Rock

Planet Drupal - Tue, 2022-08-16 08:22

Tag1’s 20 years of Drupal series continues with Alex Ross (bleen | Drupal.org), Sr. Director of Software Engineering at NBC Universal. Alex’s long experience with Drupal starts like many others - where he fell into it almost by accident. From his beginnings as a ‘dumpster diver’ in the issue queue, to becoming an organizer for Drupal Camp NYC, Alex has contributed to Drupal and the community in significant ways. Join Tag1 Managing Director Michael Meyers as he and Alex talk about the history of NYC Drupal Camp, Alex’s journey with and beyond Drupal, and the ups and downs of the changes that have come to Drupal over the last 20 years. You’ll also hear about being a module owner and maintainer, and get a first-hand account of working with the Drupal Security team! --- For a transcript of this video, see Transcript - 20 years of Drupal with Alex Ross. --- ## Additional links These are some of the prominent modules Alex has worked on or maintains: - reCaptcha - DART - Advanced image crop - Akamai ESI Photo by Juan Pablo Mascanfroni on Unsplash

Read more lynette@tag1co… Tue, 08/16/2022 - 05:22
Categories: FLOSS Project Planets

Bits from Debian: Debian turns 29!

Planet Debian - Tue, 2022-08-16 07:00

Today is Debian's 29th anniversary. We recently wrote about some ideas to celebrate the DebianDay, and several events have been planned in more than 14 locations. You can join the party or organise something yourselves too!

Today is also an opportunity for you to start or resume your contributions to Debian. For example, you can have a look at our list of Debian Teams, install the how-can-i-help package and see if there is a bug in any of the software that you use that you can help to fix, start designing your artwork candidate for the next release, contribute small tips on how to install Debian on your machines to our wiki pages https://wiki.debian.org/InstallingDebianOn/, or put a Debian live image in an USB memory and give it to some person near you, who still didn't discover Debian.

Our favorite operating system is the result of all the work we do together. Thanks to everybody who has contributed in these 29 years, and happy birthday Debian!

Categories: FLOSS Project Planets

Metadrop: Mocking third-party API in development and test environments

Planet Drupal - Tue, 2022-08-16 04:16

A big part of our job is to integrate the tools we build with third-party services as efficiently and reliably as possible, which means maintaining robust code that is covered by tests. In one of our projects, we developed a feature that was responsible for adding or removing users to mailing lists managed by an external service, with which we communicated via an API.

On this occasion, we integrated the API using the library provided by the same provider, also developing a custom service as an interface to interact with the library.

The logic we had to apply to decide when to add or remove users from the multiple lists was somewhat complex, as it depended on the different statuses of a user, their account settings,  and roles. 

We decided to duplicate the lists in the external service for development and automated test coverage to have different versions from the production ones. The problem arose when, at a certain point, the list management tests started to fail randomly. Then we realized that the inconsistency was generated by launching tests in parallel from different Merge Requests, as they were acting on the same lists.

The solution was to mock the API. In our case, what we had to mock was not the API but the custom service. With this approach, we decouple the development of the API integration itself from the development of specific functionalities that depend on the…

Categories: FLOSS Project Planets

Pages