{"id":13425005,"url":"https://github.com/tidbyt/pixlet","last_synced_at":"2025-05-15T00:10:00.841Z","repository":{"id":37102753,"uuid":"303830736","full_name":"tidbyt/pixlet","owner":"tidbyt","description":"Build apps for pixel-based displays ✨","archived":false,"fork":false,"pushed_at":"2025-05-02T03:24:30.000Z","size":40439,"stargazers_count":802,"open_issues_count":67,"forks_count":119,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-02T04:25:35.443Z","etag":null,"topics":["golang","led-display","led-matrix-displays","pixlet","starlark","tidbyt"],"latest_commit_sha":null,"homepage":"https://tidbyt.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidbyt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-13T21:16:21.000Z","updated_at":"2025-04-29T12:19:01.000Z","dependencies_parsed_at":"2024-03-25T12:51:04.019Z","dependency_job_id":"817998c6-5fa2-4b76-93bf-0773a2dfb859","html_url":"https://github.com/tidbyt/pixlet","commit_stats":null,"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbyt%2Fpixlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbyt%2Fpixlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbyt%2Fpixlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbyt%2Fpixlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidbyt","download_url":"https://codeload.github.com/tidbyt/pixlet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","led-display","led-matrix-displays","pixlet","starlark","tidbyt"],"created_at":"2024-07-31T00:01:01.805Z","updated_at":"2025-05-15T00:09:55.824Z","avatar_url":"https://github.com/tidbyt.png","language":"Go","funding_links":[],"categories":["Go","语言资源库","Users"],"sub_categories":["go"],"readme":"# Pixlet\n[![Docs](https://img.shields.io/badge/docs-tidbyt.dev-blue?style=flat-square)](https://tidbyt.dev)\n[![Build \u0026 test](https://img.shields.io/github/workflow/status/tidbyt/pixlet/pixlet?style=flat-square)](https://github.com/tidbyt/pixlet/actions)\n[![Discourse](https://img.shields.io/discourse/status?server=https%3A%2F%2Fdiscuss.tidbyt.com\u0026style=flat-square)](https://discuss.tidbyt.com/)\n[![Discord Server](https://img.shields.io/discord/928484660785336380?style=flat-square)](https://discord.gg/r45MXG4kZc)\n[![GoDoc](https://godoc.org/github.com/tidbyt/pixlet/runtime?status.svg)](https://godoc.org/github.com/tidbyt/pixlet/runtime)\n\nPixlet is an app runtime and UX toolkit for highly-constrained displays.\nWe use Pixlet to develop applets for [Tidbyt](https://tidbyt.com/), which has\na 64x32 RGB LED matrix display:\n\n[![Example of a Tidbyt](docs/img/tidbyt_1.png)](https://tidbyt.com)\n\nApps developed with Pixlet can be served in a browser, rendered as WebP or\nGIF animations, or pushed to a physical Tidbyt device.\n\n## Documentation\n\n\u003e Hey! We have a new docs site! Check it out at [tidbyt.dev](https://tidbyt.dev). We'll be updating this repo in the coming weeks.\n\n- [Getting started](#getting-started)\n- [How it works](#how-it-works)\n- [In-depth tutorial](docs/tutorial.md)\n- [Widget reference](docs/widgets.md)\n- [Animation reference](docs/animation.md)\n- [Modules reference](docs/modules.md)\n- [Schema reference](docs/schema/schema.md)\n- [Our thoughts on authoring apps](docs/authoring_apps.md)\n- [Notes on the available fonts](docs/fonts.md)\n\n## Getting started\n\n### Install on macOS\n\n```\nbrew install tidbyt/tidbyt/pixlet\n```\n\n### Install on Linux\n\nDownload the `pixlet` binary from [the latest release][1].\n\nAlternatively you can [build from source](docs/BUILD.md).\n\n[1]: https://github.com/tidbyt/pixlet/releases/latest\n\n### Hello, World!\n\nPixlet applets are written in a simple, Python-like language called\nStarlark. Here's the venerable Hello World program:\n\n```starlark\nload(\"render.star\", \"render\")\ndef main():\n    return render.Root(\n        child = render.Text(\"Hello, World!\")\n    )\n```\n\nRender and serve it with:\n\n```console\ncurl https://raw.githubusercontent.com/tidbyt/pixlet/main/examples/hello_world/hello_world.star | \\\n  pixlet serve /dev/stdin\n```\n\nYou can view the result by navigating to [http://localhost:8080][3]:\n\n![](docs/img/tutorial_1.gif)\n\n[3]: http://localhost:8080\n\n## How it works\n\nPixlet scripts are written in a simple, Python-like language called\n[Starlark](https://github.com/google/starlark-go/). The scripts can\nretrieve data over HTTP, transform it and use a collection of\n_Widgets_ to describe how the data should be presented visually.\n\nThe Pixlet CLI runs these scripts and renders the result as a WebP\nor GIF animation. You can view the animation in your browser, save\nit, or even push it to a Tidbyt device with `pixlet push`.\n\n### Example: A Clock App\n\nThis applet accepts a `timezone` parameter and produces a two frame\nanimation displaying the current time with a blinking ':' separator\nbetween the hour and minute components.\n\n```starlark\nload(\"render.star\", \"render\")\nload(\"time.star\", \"time\")\n\ndef main(config):\n    timezone = config.get(\"timezone\") or \"America/New_York\"\n    now = time.now().in_location(timezone)\n\n    return render.Root(\n        delay = 500,\n        child = render.Box(\n            child = render.Animation(\n                children = [\n                    render.Text(\n                        content = now.format(\"3:04 PM\"),\n                        font = \"6x13\",\n                    ),\n                    render.Text(\n                        content = now.format(\"3 04 PM\"),\n                        font = \"6x13\",\n                    ),\n                ],\n            ),\n        ),\n    )\n```\n\nHere's the resulting image:\n\n![](docs/img/clock.gif)\n\n### Example: A Bitcoin Tracker\n\nApplets can get information from external data sources. For example,\nhere is a Bitcoin price tracker:\n\n![](docs/img/tutorial_4.gif)\n\nRead the [in-depth tutorial](docs/tutorial.md) to learn how to\nmake an applet like this.\n\n## Push to a Tidbyt\n\nIf you have a Tidbyt, `pixlet` can push apps directly to it. For example,\nto show the Bitcoin tracker on your Tidbyt:\n\n```console\n# render the bitcoin example\npixlet render examples/bitcoin/bitcoin.star\n\n# login to your Tidbyt account\npixlet login\n\n# list available Tidbyt devices\npixlet devices\n\n# push to your favorite Tidbyt\npixlet push \u003cYOUR DEVICE ID\u003e examples/bitcoin/bitcoin.webp\n```\n\nTo get the ID for a device, run `pixlet devices`. Alternatively, you can\nopen the settings for the device in the Tidbyt app on your phone, and tap **Get API key**.\n\nIf all goes well, you should see the Bitcoin tracker appear on your Tidbyt:\n\n![](docs/img/tidbyt_2.jpg)\n\n## Push as an Installation\nPushing an applet to your Tidbyt without an installation ID simply displays your applet one time. If you would like your applet to continously display as part of the rotation, add an installation ID to the push command:\n\n```console\npixlet render examples/bitcoin/bitcoin.star\npixlet push --installation-id \u003cINSTALLATION ID\u003e \u003cYOUR DEVICE ID\u003e examples/bitcoin/bitcoin.webp\n```\n\nFor example, if we set the `installationID` to \"Bitcoin\", it would appear in the mobile app as follows:\n\n![](docs/img/mobile_1.jpg)\n\n**Note:** `pixlet render` executes your Starlark code and generates a WebP image. `pixlet push` deploys the generated WebP image to your device. You'll need to repeat this process if you want to keep the app updated. You can also create [Community Apps](https://github.com/tidbyt/community) that run on Tidbyt’s servers and update automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbyt%2Fpixlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidbyt%2Fpixlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbyt%2Fpixlet/lists"}