Skip to content

Add missing licenses #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/node_modules/**
.DS_Store
build/**
54 changes: 39 additions & 15 deletions package-list.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
packages:
- name: arduino-modulino-mpy
- name: Arduino Modulino
url: https://github.com/arduino/arduino-modulino-mpy
author: Arduino, Sebastian Romero
description: A MicroPython library to control Arduino Modulinos.
docs: https://github.com/arduino/arduino-modulino-mpy/blob/main/docs/api.md
tags: ["sensors", "actuators"]
license: Mozilla Public License Version 2.0
- name: micropython-modbus
url: https://github.com/brainelectronics/micropython-modbus
author: brainelectronics
description: MicroPython ModBus TCP and RTU library supporting client and host mode
tags: ["modbus"]
license: GNU General Public License
- name: arduino-iot-cloud-py
url: https://github.com/arduino/arduino-iot-cloud-py
author: Arduino
Expand All @@ -22,7 +24,7 @@ packages:
library_version: "0.0.7"
micropython_version: "1.19.1"
tester: "arduino"

license: Mozilla Public License Version 2.0
- name: BME680-Micropython
url: https://github.com/robert-hh/BME680-Micropython
author: Robert Hammelrath
Expand Down Expand Up @@ -60,6 +62,7 @@ packages:
library_version: null
micropython_version: "1.19.1"
tester: "arduino"
license: MIT License
- name: micropython_servo_pdm
author: Taras Prokofiev
url: https://github.com/TTitanUA/micropython_servo_pdm
Expand All @@ -76,93 +79,111 @@ packages:
library_version: null
micropython_version: "1.19.1"
tester: "arduino"
- name: lcd
url: https://github.com/dhylands/python_lcd/
description: Python code for talking to HD44780 compatible character based dot matrix LCDs.
license: MIT license; Copyright (c) 2013 Dave Hylands
tags: ["display", "LCD"]
license: MIT License
- name: picoservo
url: https://github.com/sandbo00/picoservo
author: sandbo00
description: A simple class for controlling a 9g servo with the Raspberry Pi Pico.
tags: ["servo"]
package_descriptor:
urls:
- [servo.py, github:sandbo00/picoservo/servo.py]
license: MIT License
- name: micropython-DS3231-AT24C32
url: https://github.com/pangopi/micropython-DS3231-AT24C32
author: pangopi
description: MicroPython driver for DS3231 RTC and AT24C32 EEPROM module.
tags: ["time", "RTC"]
package_descriptor:
urls:
- [ds3231.py, github:pangopi/micropython-DS3231-AT24C32/ds3231.py]
license: MIT License
- name: micropython_ahtx0
url: https://github.com/targetblank/micropython_ahtx0
author: targetblank
description: MicroPython driver for the AHT10 and AHT20 temperature and humidity sensors.
tags: ["sensors", "temperature", "humidity"]
package_descriptor:
urls:
- [ahtx0.py, github:targetblank/micropython_ahtx0/ahtx0.py]
license: MIT License
- name: micropython-dfplayer
url: https://github.com/ubidefeo/micropython-dfplayer
author: Ubi de Feo
description: Micropython implementation of DFPlayer control over UART
tags: ["audio", "mp3"]
verification:
- fqbn: "arduino:mbed_nano:nanorp2040connect"
library_version: null
micropython_version: "1.19.1"
tester: "arduino"
license: MIT License
- name: MAX30102-MicroPython-driver
url: https://github.com/n-elia/MAX30102-MicroPython-driver
author: n-elia
description: A port of the SparkFun driver for Maxim MAX30102 sensor to MicroPython.
tags: ["sensors"]
license: MIT License
- name: micropython-i2c-lcd
url: https://github.com/ubidefeo/micropython-i2c-lcd
author: Ubi de Feo
description: This library is designed to support a MicroPython interface for i2c LCD character screens. It is designed around the Pycom implementation of MicroPython
tags: ["display", "LCD", "RGB"]
license: MIT License
- name: micropython-i2c-lcd-monochrome
url: https://github.com/brainelectronics/micropython-i2c-lcd
author: brainelectronics
description: Micropython package to control HD44780 LCD displays 1602 and 2004 via I2C
license: MIT
- name: sh1107-micropython
url: https://github.com/nemart69/sh1107-micropython
author: nemart69
description: Micropython driver for SH1107-based OLED display (64 x 128)
tags: ["display", "OLED"]
package_descriptor:
urls:
- [sh1107.py, github:nemart69/sh1107-micropython/sh1107.py]
- name: SH1106
url: https://github.com/robert-hh/SH1106
author: Robert Hammelrath
description: MicroPython driver for the SH1106 OLED controller
tags: ["display", "OLED"]
package_descriptor:
urls:
- [sh1106.py, github:robert-hh/SH1106/sh1106.py]
license: MIT License
- name: micropython-ir-rx
url: https://github.com/peterhinch/micropython_ir/ir_rx
author: Peter Hinch
description: Nonblocking device drivers to receive from IR (infra red) remotes.
tags: ["IR"]
license: MIT
- name: micropython-ir-tx
url: https://github.com/peterhinch/micropython_ir/ir_tx
author: Peter Hinch
description: Nonblocking device drivers for IR (infra red) blaster apps.
tags: ["IR"]
license: MIT
- name: pi_pico_neopixel
url: https://github.com/blaz-r/pi_pico_neopixel
description: a library for using ws2812b and sk6812 leds (aka neopixels) with Raspberry Pi Pico
author: blaz-r
description: A library for using WS2812b and SK6812 LEDs (aka neopixels) with Raspberry Pi Pico.
tags: ["LED"]
package_descriptor:
urls:
- [neopixel.py, github:blaz-r/pi_pico_neopixel/neopixel.py]
license: MIT License
- name: micropython-thermal-printer
url: https://github.com/ayoy/micropython-thermal-printer
description: This is the MicroPython port of Python Thermal Printer by Adafruit
author: ayoy
description: This is the MicroPython port of Python Thermal Printer by Adafruit.
tags: ["printer"]
package_descriptor:
urls:
- [Adafruit_Thermal.py, github:ayoy/micropython-thermal-printer/Adafruit_Thermal.py]
- name: micropython-tm1637
url: https://github.com/mcauser/micropython-tm1637
author: Mike Causer
description: A MicroPython library for quad 7-segment LED display modules using the TM1637 LED driver. For example, the Grove - 4 Digit Display module http://wiki.seeed.cc/Grove-4-Digit_Display/
tags: ["display"]
verification:
Expand All @@ -173,7 +194,7 @@ packages:
- name: MicroPython-Button
author: Ubi de Feo
url: https://github.com/ubidefeo/MicroPython-Button
description: An easy to use MicroPython library to handle Buttons and other devices with digital (LOW/HIGH) output.
description: An easy-to-use MicroPython library to handle buttons and other devices with digital (LOW/HIGH) output.
tags: ["input", "button"]
verification:
- fqbn: "arduino:mbed_nano:nanorp2040connect"
Expand All @@ -182,23 +203,26 @@ packages:
tester: "arduino"
- name: micropython-max7219
url: https://github.com/mcauser/micropython-max7219
description: A MicroPython library for the MAX7219 8x8 LED matrix driver, SPI interface, supports cascading and uses framebuf
author: Mike Causer
description: A MicroPython library for the MAX7219 8x8 LED matrix driver, SPI interface, supports cascading and uses framebuf.
tags: ["LED", "matrix"]
license: Licensed under the MIT License.
package_descriptor:
urls:
- [max7219.py, github:mcauser/micropython-max7219/max7219.py]
- name: BME280
url: https://github.com/robert-hh/BME280
description: Micropython driver for the BME280 sensor, target platform Pycom devices
description: MicroPython driver for the BME280 sensor, target platform Pycom devices.
author: Robert Hammelrath
tags: ["pressure", "temperature", "humidity"]
package_descriptor:
urls:
- [bme280_int.py, github:robert-hh/BME280/bme280_int.py]
- [bme280_float.py, github:robert-hh/BME280/bme280_float.py]
- name: HT16K33-Python
url: https://github.com/smittytone/HT16K33-Python
description: Python drivers for the Holtek HT16K33 controller chip and various display devices based upon it, such as the Adafruit 0.8-inch 8x16 LED Matrix FeatherWing and the Raspberry Pi Pico. The drivers supports both CircuitPython and MicroPython applications. They communicate using I²C.
author: smittytone
description: Python drivers for the Holtek HT16K33 controller chip and various display devices based upon it, such as the Adafruit 0.8-inch 8x16 LED Matrix FeatherWing and the Raspberry Pi Pico. The drivers support both CircuitPython and MicroPython applications. They communicate using I²C.
tags: ["LED", "matrix", "segment", "adafruit"]
license: Licensed under the MIT License.
verification:
Expand All @@ -213,6 +237,6 @@ packages:
- name: ucPack-mpy
url: https://github.com/arduino/ucPack-mpy
author: Arduino, Giovanni di Dio Bruno, Lucio Rossi
description: A MicroPython porting of ucPack library.
description: A MicroPython porting of the ucPack library.
tags: ["communication"]
license: Licensed under MPL2.0.
license: Mozilla Public License Version 2.0
39 changes: 32 additions & 7 deletions tools/create-index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import path from 'path';
import { execSync } from 'child_process';
import yaml from 'js-yaml';

const cloneRepository = (url, directory) => {
try {
// Clone the repository
execSync(`git clone ${url} ${directory}`);
return true;
} catch (error) {
console.error(`Error cloning repository: ${error.message}`);
return false;
}
};

const getGitHubUrl = (rootPath) => {
try {
// Get the GitHub repository URL
Expand Down Expand Up @@ -63,12 +74,18 @@ const searchPackages = (directory, outputFilename, indexUrl) => {
} else {
const isPackageJson = file === 'package.json';
const isManifestPy = file === 'manifest.py';
const packageName = path.basename(dir);

if(packageName.startsWith("_")) {
continue; // Skip "private" packages
}

if (isPackageJson || isManifestPy) {
const packageInfo = {
name: path.basename(dir),
name: packageName,
docs: constructGitHubUrl(gitHubUrl, currentBranch, repositoryRoot, dir),
index: indexUrl,
author: 'MicroPython',
};

if (isManifestPy) {
Expand Down Expand Up @@ -109,14 +126,22 @@ const searchPackages = (directory, outputFilename, indexUrl) => {
};

// Check if command line arguments are provided
if (process.argv.length < 5) {
if (process.argv.length < 3) {
// Note: Official MicroPython lib index is: https://micropython.org/pi/v2
// Example usage: node create-index.mjs ../micropython-lib/micropython micropython-lib.yml https://micropython.org/pi/v2
console.error('Usage: node create-index.mjs <directory> <outputFilename.yml> <indexUrl>');
// Example usage: node create-index.mjs micropython-lib.yml
console.error('Usage: node create-index.mjs <outputFilename.yml>');
} else {
const directory = process.argv[2];
const outputFilename = process.argv[3];
const indexUrl = process.argv[4];
// Make build directory if it doesn't exist
if (!fs.existsSync('build')) {
fs.mkdirSync('build');
}

if(!fs.existsSync('build/micropython-lib')) {
cloneRepository("git@github.com:micropython/micropython-lib.git", "build/micropython-lib");
}
const directory = "build/micropython-lib";
const indexUrl = "https://micropython.org/pi/v2";
const outputFilename = process.argv[2];

searchPackages(directory, outputFilename, indexUrl);
}
33 changes: 33 additions & 0 deletions tools/find-license.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function convertToRawURL(url, suffix = null) {
url = url.replace('https://github.com/', '');
const parts = url.split('/');
const owner = parts[0];
const repoName = parts[1];
const branch = 'HEAD';
let path = parts[2] ? "/" + parts[2] : '';
if (suffix) {
path += "/" + suffix;
}
return `https://raw.githubusercontent.com/${owner}/${repoName}/${branch}${path}`;
}

async function findLicenseURL(url) {
const licenseFileURL = convertToRawURL(url, 'LICENSE');
// Fetch the license file
const licenseResponse = await fetch(licenseFileURL);
if (licenseResponse.ok) {
const licenseText = await licenseResponse.text();
// Get the first line of the license file
const license = licenseText.split('\n')[0];
return license;
}
return null;
}

if(process.argv.length < 3) {
console.error('Usage: node find-license.mjs <GitHub URL>');
process.exit(1);
}

const license = await findLicenseURL(process.argv[2]);
if (license) console.log(license);