Play elevator music in the background while your script runs.
from script_background_music import play_music_in_background
play_music_in_background()
Many common and unusual algorithms, implemented in Python as learning exercises. If you want to get a sense of what, say, data structures or fuzzy logic would look like in Python, this is a good place to start.
This is the Game of Life written in Python 3.10. It uses tkinter for the GUI; in fact I wrote it as an exercise in using tkinter as it's been a couple years since I last played with it.
Each cell of the game is a canvas rectangle. The id of each rectangle is stored in an matrix, shifted left by two. The bottom two bits of each shifted id are used to store the current state of the cell and the next state of the cell.
TinyFlux is a time series version of TinyDB that is also written in Python and has no external dependencies. It's a great companion for small analytics workflows and apps, as well as at-home IOT data stores. Python datetime objects are first-class citizens and queries are optimized for time, above all else. Designed to be simple and fun to use by providing a simple and clean API that can be learned in 5 minutes. The current source code has 4,000 lines of code (with about 50% documentation) and 4,000 lines tests. TinyFlux is about 150kb, unzipped. TinyFlux needs neither an external server nor any dependencies.
With every Python release, there are new modules being added and new and better ways of doing things get introduced. We all get used to using the good old Python libraries and to certain way of doing things, but it's time upgrade and make use of the new and improved modules and their features.
os.path
-> pathlib
os.urandom
-> secrets
pytz
-> zoneinfo
namedtuple
-> dataclasses
logging
.tomli
-> tomllib
distutils
-> setuputils
At the beginning of 2020, we discovered the Red Unlock technique that allows extracting Intel Atom Microcode. We were able to research the internal structure of the microcode and then x86 instruction implementation. Also, we recovered a format of microcode updates, algorithm and the encryption key used to protect the microcode.
This is the tools they used to take it apart.
TensorFlow Lite for Microcontrollers is an open-source machine learning framework in which a TensorFlow model is built and trained on a host computer. That model is then reduced in size and computational complexity by an exporter that converts it to the TensorFlow Lite format. For the tiniest of compute platforms — microcontrollers — that model is then converted to a C array containing the model structure and any trained parameters, like weights and biases. On the microcontroller, an interpreter parses the C array to extract operations and data to run inferences against new input data.
Given that TF Lite for Microcontrollers runs on some heavily resource-constrained devices, I got to wondering whether or not I could run inferences against these models on a Commodore 64.
A fast and local neural text to speech system developed by Mycroft for the Mark II. Multiple voice models, multiple languages.
Does not have to be used in the context of Mycroft. You can run Mimic on just about any Linux machine. If you can send text to a REST API rail somehow, you can use it.
WarcDB is a an SQLite-based file format that makes web crawl data easier to share and query. It is based on the standardized Web ARChive format, used by web archivers.
pyndb, short for Python Node Database, is a package which makes it easy to save data to a file while also providing syntactic convenience. It utilizes a Node structure which allows for easily retrieving nested objects. All data is wrapped inside of a custom Node object, and stored to file as nested dictionaries. It provides additional capabilities such as autosave, saving a dictionary to file, creating a file if none exists, and more. The original program was developed with the sole purpose of saving dictionaries to files, and was not released to the public.
Basically, it's a way to treat internal hash tables like real databases, with automatic saving, automatic creation (if the file doesn't exist already), and so forth.
CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, written in Python. It is more focused on the educational capabilities than using it in production. The file format is platform, machine, and programming language independent. Say, the database file created from Python on macOS should be compatible with Rust on Windows.
This project aims to help anyone, even a beginner in databases, build a persistent database in a few hours. There are no external dependencies; only the Python standard library is enough.
A countdown timer/stopwatch that runs in your terminal with nice, big ASCII numbers.
Metermon is a dockerized rtlamr wrapper that connects to an existing rtl_tcp instance and outputs formatted messages over MQTT for consumption by other software (e.g. telegraf for storage in influxdb and display in grafana, or import into Home Assistant).
The script can be run using docker (takes care of all dependencies) or standalone. It is designed to run on Raspberry Pi or similar.
By pulling apart this container it should be possible to figure out how to do this.
simple-homepage is a command line utility that helps you create a simple static homepage for your browser. The documentation can be found here.
All the talks at PyCon 2022 on Youtube.
PikaScript is an ultra-lightweight Python engine with zero dependencies and zero-configuration, that can run with 4KB of RAM and 32KB of flash (such as STM32G030C8 and STM32F103C8).
Keyboard Layouter is a plugin for KiCad(pcbnew). This plugin places switch footprints in the location specified by JSON of Keyboard Layout Editor.
I have confirmed that it works with pcbnew version (6.0.0) release build on Windows.
A library for evaluating tabletop dice roll expressions. Supports rolling multiple dice (3d6), dice arithmetic (adding die rolls together), dice with arbitrary numbers of sides (5d13), keeping or dropping the highest or lowest rolls, exploding dice (roll a maximum value, roll and add an extra die), and more.
Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tshark, p0f, etc.). It also performs very well at a lot of other specific tasks that most other tools can’t handle, like sending invalid frames, injecting your own 802.11 frames, combining technics (VLAN hopping+ARP cache poisoning, VOIP decoding on WEP encrypted channel, …), etc.
Scapy runs natively on Linux, Windows, OSX and on most Unixes with libpcap (see scapy’s installation page). The same code base now runs natively on both Python 2 and Python 3.
Python 3 tooling to retrieve data from Axon Body Cams. This code should work for first and second generation non-online models.