Difference between revisions of "Hatchery"
(→API) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 34: | Line 34: | ||
===API=== | ===API=== | ||
− | There's an api available, used by [[SHA2017Badge/woezel|woezel]] and [[SHA2017Badge/Installer|Installer]] | + | There's an api available, used by [[SHA2017Badge/woezel|woezel]] and [[SHA2017Badge/Installer|Installer]]: |
<nowiki>/eggs/get/[app]/json - get json data for a the egg named [app] | <nowiki>/eggs/get/[app]/json - get json data for a the egg named [app] | ||
/eggs/list/json - a list of all eggs with name, slug, description, revision | /eggs/list/json - a list of all eggs with name, slug, description, revision | ||
Line 40: | Line 40: | ||
/eggs/categories/json - json list of categories | /eggs/categories/json - json list of categories | ||
/eggs/category/[cat]/json - json data for category [cat]</nowiki> | /eggs/category/[cat]/json - json data for category [cat]</nowiki> | ||
+ | |||
+ | Since the badge.team merger there are now baskets for different badges | ||
+ | <nowiki> | ||
+ | /basket/[badge]/list/json - a list of all eggs for specific [badge] | ||
+ | /basket/[badge]/search/json - [badge] specific search for [words] | ||
+ | /basket/[badge]/category/[cat]/json - json data for category [cat] on [badge]</nowiki> | ||
+ | |||
+ | You can play with this API here at: https://badge.team/api | ||
===Code=== | ===Code=== |
Latest revision as of 17:22, 10 September 2019
Contents
badge.team[edit]
The hatchery lives at badge.team and is a repository of apps for use on your badge.
Registration[edit]
Registration is simple, email can be whatever, for example test@test.com, it is only used for password resets.
App model[edit]
Apps are folders with as a minimal requirement a __init__.py
file.
Hatchery will add an empty version of that file for you.
main()[edit]
This is what should be run after import
by the Launcher.
on_boot.py[edit]
This is what will be started on boot (if present) like so from app import on_boot
You can use this to run TSR apps (take a look at the flashlight app for an example of this..
metadata.json[edit]
Unless you upload or create such a file, Hatchery will generate one . .
This contains at-minimum the description of the app and weather or not it should be shown in the Launcher.
Hatching eggs[edit]
Installation of apps on the badge is done with woezel via REPL or with help of a graphical Installer on the badge.
API[edit]
There's an api available, used by woezel and Installer:
/eggs/get/[app]/json - get json data for a the egg named [app] /eggs/list/json - a list of all eggs with name, slug, description, revision /eggs/search/[words]/json - json data for search query [words] /eggs/categories/json - json list of categories /eggs/category/[cat]/json - json data for category [cat]
Since the badge.team merger there are now baskets for different badges
/basket/[badge]/list/json - a list of all eggs for specific [badge] /basket/[badge]/search/json - [badge] specific search for [words] /basket/[badge]/category/[cat]/json - json data for category [cat] on [badge]
You can play with this API here at: https://badge.team/api
Code[edit]
Original documentation SHA2017Badge/Hatchery