Skip to content

Commit d360b07

Browse files
authored
Merge pull request #28 from arduino/meta-data
Add missing licenses
2 parents a20369b + c4f0113 commit d360b07

File tree

4 files changed

+105
-22
lines changed

4 files changed

+105
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/node_modules/**
22
.DS_Store
3+
build/**

package-list.yaml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
---
22
packages:
3-
- name: arduino-modulino-mpy
3+
- name: Arduino Modulino
44
url: https://github.com/arduino/arduino-modulino-mpy
55
author: Arduino, Sebastian Romero
66
description: A MicroPython library to control Arduino Modulinos.
77
docs: https://github.com/arduino/arduino-modulino-mpy/blob/main/docs/api.md
88
tags: ["sensors", "actuators"]
9+
license: Mozilla Public License Version 2.0
910
- name: micropython-modbus
1011
url: https://github.com/brainelectronics/micropython-modbus
1112
author: brainelectronics
1213
description: MicroPython ModBus TCP and RTU library supporting client and host mode
1314
tags: ["modbus"]
15+
license: GNU General Public License
1416
- name: arduino-iot-cloud-py
1517
url: https://github.com/arduino/arduino-iot-cloud-py
1618
author: Arduino
@@ -22,7 +24,7 @@ packages:
2224
library_version: "0.0.7"
2325
micropython_version: "1.19.1"
2426
tester: "arduino"
25-
27+
license: Mozilla Public License Version 2.0
2628
- name: BME680-Micropython
2729
url: https://github.com/robert-hh/BME680-Micropython
2830
author: Robert Hammelrath
@@ -60,6 +62,7 @@ packages:
6062
library_version: null
6163
micropython_version: "1.19.1"
6264
tester: "arduino"
65+
license: MIT License
6366
- name: micropython_servo_pdm
6467
author: Taras Prokofiev
6568
url: https://github.com/TTitanUA/micropython_servo_pdm
@@ -76,93 +79,111 @@ packages:
7679
library_version: null
7780
micropython_version: "1.19.1"
7881
tester: "arduino"
79-
- name: lcd
80-
url: https://github.com/dhylands/python_lcd/
81-
description: Python code for talking to HD44780 compatible character based dot matrix LCDs.
82-
license: MIT license; Copyright (c) 2013 Dave Hylands
83-
tags: ["display", "LCD"]
82+
license: MIT License
8483
- name: picoservo
8584
url: https://github.com/sandbo00/picoservo
85+
author: sandbo00
8686
description: A simple class for controlling a 9g servo with the Raspberry Pi Pico.
8787
tags: ["servo"]
8888
package_descriptor:
8989
urls:
9090
- [servo.py, github:sandbo00/picoservo/servo.py]
91+
license: MIT License
9192
- name: micropython-DS3231-AT24C32
9293
url: https://github.com/pangopi/micropython-DS3231-AT24C32
94+
author: pangopi
9395
description: MicroPython driver for DS3231 RTC and AT24C32 EEPROM module.
9496
tags: ["time", "RTC"]
9597
package_descriptor:
9698
urls:
9799
- [ds3231.py, github:pangopi/micropython-DS3231-AT24C32/ds3231.py]
100+
license: MIT License
98101
- name: micropython_ahtx0
99102
url: https://github.com/targetblank/micropython_ahtx0
103+
author: targetblank
100104
description: MicroPython driver for the AHT10 and AHT20 temperature and humidity sensors.
101105
tags: ["sensors", "temperature", "humidity"]
102106
package_descriptor:
103107
urls:
104108
- [ahtx0.py, github:targetblank/micropython_ahtx0/ahtx0.py]
109+
license: MIT License
105110
- name: micropython-dfplayer
106111
url: https://github.com/ubidefeo/micropython-dfplayer
112+
author: Ubi de Feo
107113
description: Micropython implementation of DFPlayer control over UART
108114
tags: ["audio", "mp3"]
109115
verification:
110116
- fqbn: "arduino:mbed_nano:nanorp2040connect"
111117
library_version: null
112118
micropython_version: "1.19.1"
113119
tester: "arduino"
120+
license: MIT License
114121
- name: MAX30102-MicroPython-driver
115122
url: https://github.com/n-elia/MAX30102-MicroPython-driver
123+
author: n-elia
116124
description: A port of the SparkFun driver for Maxim MAX30102 sensor to MicroPython.
117125
tags: ["sensors"]
126+
license: MIT License
118127
- name: micropython-i2c-lcd
119128
url: https://github.com/ubidefeo/micropython-i2c-lcd
129+
author: Ubi de Feo
120130
description: This library is designed to support a MicroPython interface for i2c LCD character screens. It is designed around the Pycom implementation of MicroPython
121131
tags: ["display", "LCD", "RGB"]
132+
license: MIT License
122133
- name: micropython-i2c-lcd-monochrome
123134
url: https://github.com/brainelectronics/micropython-i2c-lcd
135+
author: brainelectronics
124136
description: Micropython package to control HD44780 LCD displays 1602 and 2004 via I2C
125137
license: MIT
126138
- name: sh1107-micropython
127139
url: https://github.com/nemart69/sh1107-micropython
140+
author: nemart69
128141
description: Micropython driver for SH1107-based OLED display (64 x 128)
129142
tags: ["display", "OLED"]
130143
package_descriptor:
131144
urls:
132145
- [sh1107.py, github:nemart69/sh1107-micropython/sh1107.py]
133146
- name: SH1106
134147
url: https://github.com/robert-hh/SH1106
148+
author: Robert Hammelrath
135149
description: MicroPython driver for the SH1106 OLED controller
136150
tags: ["display", "OLED"]
137151
package_descriptor:
138152
urls:
139153
- [sh1106.py, github:robert-hh/SH1106/sh1106.py]
154+
license: MIT License
140155
- name: micropython-ir-rx
141156
url: https://github.com/peterhinch/micropython_ir/ir_rx
157+
author: Peter Hinch
142158
description: Nonblocking device drivers to receive from IR (infra red) remotes.
143159
tags: ["IR"]
144160
license: MIT
145161
- name: micropython-ir-tx
146162
url: https://github.com/peterhinch/micropython_ir/ir_tx
163+
author: Peter Hinch
147164
description: Nonblocking device drivers for IR (infra red) blaster apps.
148165
tags: ["IR"]
149166
license: MIT
150167
- name: pi_pico_neopixel
151168
url: https://github.com/blaz-r/pi_pico_neopixel
152-
description: a library for using ws2812b and sk6812 leds (aka neopixels) with Raspberry Pi Pico
169+
author: blaz-r
170+
description: A library for using WS2812b and SK6812 LEDs (aka neopixels) with Raspberry Pi Pico.
153171
tags: ["LED"]
154172
package_descriptor:
155173
urls:
156174
- [neopixel.py, github:blaz-r/pi_pico_neopixel/neopixel.py]
175+
license: MIT License
157176
- name: micropython-thermal-printer
158177
url: https://github.com/ayoy/micropython-thermal-printer
159-
description: This is the MicroPython port of Python Thermal Printer by Adafruit
178+
author: ayoy
179+
description: This is the MicroPython port of Python Thermal Printer by Adafruit.
160180
tags: ["printer"]
161181
package_descriptor:
162182
urls:
163183
- [Adafruit_Thermal.py, github:ayoy/micropython-thermal-printer/Adafruit_Thermal.py]
164184
- name: micropython-tm1637
165185
url: https://github.com/mcauser/micropython-tm1637
186+
author: Mike Causer
166187
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/
167188
tags: ["display"]
168189
verification:
@@ -173,7 +194,7 @@ packages:
173194
- name: MicroPython-Button
174195
author: Ubi de Feo
175196
url: https://github.com/ubidefeo/MicroPython-Button
176-
description: An easy to use MicroPython library to handle Buttons and other devices with digital (LOW/HIGH) output.
197+
description: An easy-to-use MicroPython library to handle buttons and other devices with digital (LOW/HIGH) output.
177198
tags: ["input", "button"]
178199
verification:
179200
- fqbn: "arduino:mbed_nano:nanorp2040connect"
@@ -182,23 +203,26 @@ packages:
182203
tester: "arduino"
183204
- name: micropython-max7219
184205
url: https://github.com/mcauser/micropython-max7219
185-
description: A MicroPython library for the MAX7219 8x8 LED matrix driver, SPI interface, supports cascading and uses framebuf
206+
author: Mike Causer
207+
description: A MicroPython library for the MAX7219 8x8 LED matrix driver, SPI interface, supports cascading and uses framebuf.
186208
tags: ["LED", "matrix"]
187209
license: Licensed under the MIT License.
188210
package_descriptor:
189211
urls:
190212
- [max7219.py, github:mcauser/micropython-max7219/max7219.py]
191213
- name: BME280
192214
url: https://github.com/robert-hh/BME280
193-
description: Micropython driver for the BME280 sensor, target platform Pycom devices
215+
description: MicroPython driver for the BME280 sensor, target platform Pycom devices.
216+
author: Robert Hammelrath
194217
tags: ["pressure", "temperature", "humidity"]
195218
package_descriptor:
196219
urls:
197220
- [bme280_int.py, github:robert-hh/BME280/bme280_int.py]
198221
- [bme280_float.py, github:robert-hh/BME280/bme280_float.py]
199222
- name: HT16K33-Python
200223
url: https://github.com/smittytone/HT16K33-Python
201-
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.
224+
author: smittytone
225+
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.
202226
tags: ["LED", "matrix", "segment", "adafruit"]
203227
license: Licensed under the MIT License.
204228
verification:
@@ -213,6 +237,6 @@ packages:
213237
- name: ucPack-mpy
214238
url: https://github.com/arduino/ucPack-mpy
215239
author: Arduino, Giovanni di Dio Bruno, Lucio Rossi
216-
description: A MicroPython porting of ucPack library.
240+
description: A MicroPython porting of the ucPack library.
217241
tags: ["communication"]
218-
license: Licensed under MPL2.0.
242+
license: Mozilla Public License Version 2.0

tools/create-index.mjs

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ import path from 'path';
33
import { execSync } from 'child_process';
44
import yaml from 'js-yaml';
55

6+
const cloneRepository = (url, directory) => {
7+
try {
8+
// Clone the repository
9+
execSync(`git clone ${url} ${directory}`);
10+
return true;
11+
} catch (error) {
12+
console.error(`Error cloning repository: ${error.message}`);
13+
return false;
14+
}
15+
};
16+
617
const getGitHubUrl = (rootPath) => {
718
try {
819
// Get the GitHub repository URL
@@ -63,12 +74,18 @@ const searchPackages = (directory, outputFilename, indexUrl) => {
6374
} else {
6475
const isPackageJson = file === 'package.json';
6576
const isManifestPy = file === 'manifest.py';
77+
const packageName = path.basename(dir);
78+
79+
if(packageName.startsWith("_")) {
80+
continue; // Skip "private" packages
81+
}
6682

6783
if (isPackageJson || isManifestPy) {
6884
const packageInfo = {
69-
name: path.basename(dir),
85+
name: packageName,
7086
docs: constructGitHubUrl(gitHubUrl, currentBranch, repositoryRoot, dir),
7187
index: indexUrl,
88+
author: 'MicroPython',
7289
};
7390

7491
if (isManifestPy) {
@@ -109,14 +126,22 @@ const searchPackages = (directory, outputFilename, indexUrl) => {
109126
};
110127

111128
// Check if command line arguments are provided
112-
if (process.argv.length < 5) {
129+
if (process.argv.length < 3) {
113130
// Note: Official MicroPython lib index is: https://micropython.org/pi/v2
114-
// Example usage: node create-index.mjs ../micropython-lib/micropython micropython-lib.yml https://micropython.org/pi/v2
115-
console.error('Usage: node create-index.mjs <directory> <outputFilename.yml> <indexUrl>');
131+
// Example usage: node create-index.mjs micropython-lib.yml
132+
console.error('Usage: node create-index.mjs <outputFilename.yml>');
116133
} else {
117-
const directory = process.argv[2];
118-
const outputFilename = process.argv[3];
119-
const indexUrl = process.argv[4];
134+
// Make build directory if it doesn't exist
135+
if (!fs.existsSync('build')) {
136+
fs.mkdirSync('build');
137+
}
138+
139+
if(!fs.existsSync('build/micropython-lib')) {
140+
cloneRepository("git@github.com:micropython/micropython-lib.git", "build/micropython-lib");
141+
}
142+
const directory = "build/micropython-lib";
143+
const indexUrl = "https://micropython.org/pi/v2";
144+
const outputFilename = process.argv[2];
120145

121146
searchPackages(directory, outputFilename, indexUrl);
122147
}

tools/find-license.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
function convertToRawURL(url, suffix = null) {
2+
url = url.replace('https://github.com/', '');
3+
const parts = url.split('/');
4+
const owner = parts[0];
5+
const repoName = parts[1];
6+
const branch = 'HEAD';
7+
let path = parts[2] ? "/" + parts[2] : '';
8+
if (suffix) {
9+
path += "/" + suffix;
10+
}
11+
return `https://raw.githubusercontent.com/${owner}/${repoName}/${branch}${path}`;
12+
}
13+
14+
async function findLicenseURL(url) {
15+
const licenseFileURL = convertToRawURL(url, 'LICENSE');
16+
// Fetch the license file
17+
const licenseResponse = await fetch(licenseFileURL);
18+
if (licenseResponse.ok) {
19+
const licenseText = await licenseResponse.text();
20+
// Get the first line of the license file
21+
const license = licenseText.split('\n')[0];
22+
return license;
23+
}
24+
return null;
25+
}
26+
27+
if(process.argv.length < 3) {
28+
console.error('Usage: node find-license.mjs <GitHub URL>');
29+
process.exit(1);
30+
}
31+
32+
const license = await findLicenseURL(process.argv[2]);
33+
if (license) console.log(license);

0 commit comments

Comments
 (0)