opensource.com

Subscribe to opensource.com feed
Updated: 1 hour 29 min ago

3 ways to test your API with Python

Tue, 09/21/2021 - 15:01

In this tutorial, you'll learn how to unit test code that performs HTTP requests. In other words, you'll see the art of API unit testing in Python.

Unit tests are meant to test a single unit of behavior. In testing, a well-known rule of thumb is to isolate code that reaches external dependencies.

For instance, when testing a code that performs HTTP requests, it's recommended to replace the real call with a fake call during test time. This way, you can unit test it without performing a real HTTP request every time you run the test.


read more

Run containers on your Mac with Lima

Tue, 09/21/2021 - 15:00

Running containers on your Mac can be a challenge. After all, containers are based on Linux-specific technologies like cgroups and namespaces.

Luckily, macOS has a built-in hypervisor, allowing virtual machines (VMs) on the Mac. The hypervisor is a low-level kernel feature, not a user-facing one.


read more

Use this Linux command-line tool to learn more about your NVMe drives

Mon, 09/20/2021 - 15:01

NVMe stands for Non-Volatile Memory Express, and it refers to how software and storage communicate across PCIe and other protocols, including TCP. It's an open specification led by a non-profit organization and defines several forms of solid-state storage.

My laptop has an NVMe drive, as does my desktop. And they're fast. I love how quickly my computers boot and how quickly they're able to read and write data. There's no perceptible delay.


read more

Use Vagrant to test your scripts on different operating systems

Mon, 09/20/2021 - 15:00

I've been happy using Vagrant for quite a while now. I work with several DevOps tools, and installing them all on one system can get complicated. Vagrant lets you do cool things without breaking your system because you don't have to experiment on your production system at all.


read more

5 best practices for using open source community leaderboards

Sun, 09/19/2021 - 15:00

It takes a community of people with varying skill sets and expertise to build open source software. Leaderboards have become a way for open source communities to track progress and showcase and celebrate top-performing contributors. If leaderboards are done right, they can increase participation, motivate contributors with gamification, and enhance the community. But leaderboards can also have adverse outcomes—including discouraging participation.


read more

Why my public library chooses Linux and open source

Sat, 09/18/2021 - 15:00

The Crawford County Federated Library System has been using Linux and open source software in its IT operations since 1999. They realized early on the potential of open source and integrated it into their enterprise. They were a part of my own Linux journey as I built a content filtering system for our school district. Twenty years ago, there were few models for the use of open source in libraries and education. Meadville Public Library and the Crawford County Federated Library System were the leaders then and now.


read more

Organize your Magic: The Gathering decks with Magic Assistant

Fri, 09/17/2021 - 15:00

The world's first trading card game was Magic: The Gathering, first published in 1993.

It remains popular today because of its great flexibility. With more than 25,000 unique cards published over nearly three decades, there are enough cards for players to build hundreds of different decks for surprisingly unique gameplay experiences.


read more

Start using YAML now

Fri, 09/17/2021 - 15:00

YAML (YAML Ain't Markup Language) is a human-readable data serialization language. Its syntax is simple and human-readable. It does not contain quotation marks, opening and closing tags, or braces. It does not contain anything which might make it harder for humans to parse nesting rules. You can scan your YAML document and immediately know what's going on.

YAML features

YAML has some super features which make it superior to other serialization formats:


read more

Watch commands and tasks with the Linux watch command

Thu, 09/16/2021 - 15:02

There are many times when you need to wait for something to finish, such as:

  • A file download.
  • Creating or extracting a tar file.
  • An Ansible job.

Some of these processes have some sort of progress indication, but sometimes the process is run through a layer of abstraction, and the only way to measure the progress is through its side effects. Some of these might be:


read more

How I patched Python to include this great Ruby feature

Thu, 09/16/2021 - 15:01

Ruby, unlike Python, makes lots of things implicit, and there's a special kind of if expression that demonstrates this well. It's often referred to as an "inline-if" or "conditional modifier", and this special syntax is able to return one value when a condition is true, but another value (nil, specifically) when a condition is false. Here's an example:


read more

Crunch numbers in Python with NumPy

Thu, 09/16/2021 - 15:00

NumPy, or Numerical Python, is a library that makes it easy to do statistical and set operations on linear series and matrices in Python. It is orders of magnitude faster than Python lists, which I covered in my notes on Python Data Types. NumPy is used quite frequently in data analysis and scientific calculations.


read more

A guide to web scraping in Python using Beautiful Soup

Wed, 09/15/2021 - 15:01

Today we'll discuss how to use the Beautiful Soup library to extract content from an HTML page. After extraction, we'll convert it to a Python list or dictionary using Beautiful Soup.


read more

Build a data sharding service with DistSQL

Wed, 09/15/2021 - 15:00

If you're reading this, then you're probably familiar with the data query and programming language, SQL (Structured Query Language). It's also used as the standard language for management systems for accessing data, querying, updating, and managing relational database systems. Like standard SQL, DistSQL, or Distributed SQL, it is a built-in SQL language unique to ShardingSphere that provides incremental functional capabilities beyond standard SQL.


read more

A conversation about open source design and ethical funding

Wed, 09/15/2021 - 15:00

Pablo Ruiz-Múzquiz is the CEO and co-founder of Kaleidos and Taiga. I contacted him for an interview to learn more about his latest project: Penpot, an open source, online interface design tool.

Clayton Dewey: I reached out to you because I recently learned about Penpot, an excellent design tool similar to Figma and Sketch. How did Penpot get started?


read more

9 underrated responsibilities of an open source community manager

Tue, 09/14/2021 - 15:01

Open source communities don’t just happen. They require work. Sometimes the technical interest in an open source project is enough to attract a group of people to get involved.


read more

Managing the open source product roadmap

Tue, 09/14/2021 - 15:00

In the first four parts of this series on the open source software supply chain, I explored open source as a supply chainwhat a product iswhat product managers do, and ways to differentiate open source software products from their upstream projects


read more

Replace smart quotes with the Linux sed command

Mon, 09/13/2021 - 15:01

In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this:

“smart quotes”


read more

How I rediscovered Logo with the Python Turtle module

Mon, 09/13/2021 - 15:00

When I was in high school, one of the very first programming languages I was introduced to was Logo. It was interactive and visual. With basic movement commands, you could have your cursor (“turtle”) draw basic shapes and intricate patterns. It was a great way to introduce the compelling concept of an algorithm—a series of instructions for a computer to execute.

Fortunately, the Logo programming language is available today as a Python package. So let’s jump right in, and you can discover the possibilities with Logo as we go along.


read more

What I miss about open source conferences

Sun, 09/12/2021 - 15:00

A typical work year would involve my attending maybe six to eight conferences in person and speaking at quite a few of them. A few years ago, I stopped raiding random booths at the exhibitions usually associated with these for t-shirts for the simple reason that I had too many of them. That's not to say that I wouldn't accept one here or there if it was particularly nice, or an open source project which I esteemed particularly, for instance. Or ones which I thought my kids would like—they're not "cool" but are at least useful for sleepwear, apparently.


read more

Play with model trains in OpenTTD

Sat, 09/11/2021 - 15:00

My father has always been fond of model trains, and I remember watching him building a track around the Christmas tree when I was young. When Lego train sets were released, he and I transitioned to them for their convenience and inherent extensibility. We built and operated Lego trains and monorail tracks over the course of many years. I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and electric whistling trains.


read more

Pages