Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PikaPython

> 编程语言
Open source

An ultra-lightweight Python interpreter that runs with only 4KB of RAM, zero dependencies. It is ready to use out of the box without any configuration required

1.7K stars0 likes0 views
WebsiteGitHub

About

An ultra-lightweight Python interpreter that runs with only 4KB of RAM, zero dependencies. It is ready to use out of the box without any configuration required

PikaPython

Cross platform ultra lightweight embedded Python engine

> PikaPython V2 is now available with a redesigned kernel, higher execution performance, > lower Flash and static RAM usage, a unified project CLI, and Code Agent workflows. > [Explore PikaPython V2](https://github.com/pikasTech/PikaPython/tree/v2).

中文页 | Forum | Documents | Videos | BSP | Package Manager | Contribute | Business

# 1. Abstract PikaPython is an ultra-lightweight Python interpreter that runs with only 4KB of RAM, zero dependencies. It is ready to use out of the box without any configuration required and easy to extend with C. PikaPython also known as PikaScript and PikaPy. It's very easy to bind C function to python module with the help of Pika Pre-compiler.Only write the API of python in `.pyi` and the bindings are autoly generated by Pre-compiler. # Get pikapython: ## Use Online Project Generator Generator url: http://pikascript.com Note: You need the [Community Edition license (Now Free)](https://www.keil.com/pr/article/1299.htm) to build Keil projects, and the version of Keil should be newer than v5.36. ## PikaPython studio PikaPython serial terminal, script download and package menage tool. # Quick Start You can use [simulation project](https://pikadoc-en.readthedocs.io/en/latest/Keil%20%E4%BB%BF%E7%9C%9F%E5%B7%A5%E7%A8%8B.html) to quick start without hardware,or use the out-of-the-box develop board [Pika-Pi—Zero](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-23991764791.11.37216340XZtYt9&id=738387991209). The board based on STM32G030C8T6 MCU, only 64kB Flash, 8kB RAM can run pikapython with total peripheral device (GPIO、TIME、IIC、RGB、KEY、LCD、RGB). CH340 is deployed to support USB to serial with Type-C USB, support download python script py serial, there are 4 RGB on the board and support the [LCD](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-23991764791.12.16f97c58fsLjVk&id=660745643102). # Related Projects - [MicroLink](https://github.com/Aladdin-Wang/MicroLink) 一款集多功能于一体的嵌入式系统开发工具 - ▶️ [pikapython Binding For LVGL](https://github.com/lvgl/lv_binding_pikascript) - ⭐ [pikapython Bluepill Demo In PlatformIO — Python-like REPL ](https://github.com/maxgerhardt/pikascript-pio-bluepill) - ⭐ [pikapython Bluepill Demo In GCC ](https://github.com/Chandler-Kluser/pikascript_gcc_bluepill) - ⏩ [pika_startup_demo](https://gitee.com/kcfkwok/pika_startup_demo) This program demonstrate the 5 startup methods of pikapython. - [PikaPython-OpenHardware](https://gitee.com/Lyon1998/pikapython_openhardware) PikaPython 开源硬件 - [pikapython-msvc-qt](https://gitee.com/zuto360_460135301/pikapython-msvc-qt) 移植pikapython到windows平台,基于QT,采用MSVC编译器,移植pthread库,支持多线程。 # Document https://pikadoc-en.readthedocs.io/en/latest/index.html ## How to contribute https://pikadoc-en.readthedocs.io/en/latest/%E5%A6%82%E4%BD%95%E5%8F%82%E4%B8%8E%E7%A4%BE%E5%8C%BA%E8%B4%A1%E7%8C%AE.html ## Folders [src](../../tree/master/src) - core code [bsp](../../tree/master/bsp) - mcu/board support [port](../../tree/master/port) - OS and package manager [test](../../tree/master/port/linux/test) - unit test [document](../../tree/master/document) - developt document [examples](../../tree/master/examples) - example scripts [package](../../tree/master/package) - packages and moudles [pikaCompiler](../../tree/master/tools/pikaCompiler) - pre-compiler write by Rust, used to bind C function to python moudle. [pikaPackageManager](../../tree/master/tools/pikaPackageManager) - pacakge manager # 2.Platform support ## MCU support |MCU |bsp|gpio|time|uart|pwm|adc|i2c|dac| |--- |---|--- |--- |--- |---|---|---|---| |stm32g030c8 |√ |√ |√ |√ |√ |√ |√ | | |stm32g070cB |√ |√ |√ |√ |√ |√ |√ | | |stm32f103c8 |√ |√ |√ |√ |√ |√ |√ | | |stm32f103rb |√ |√ |√ |√ |√ |√ |√ | | |stm32f103ze |√ |√ |√ |√ |√ |√ |√ | | |stm32f103rc |√ |√ |√ |√ |√ |√ |√ | | |stm32f401cc |√ |√ |√ |√ |√ |√ |√ | | |stm32f411ce |√ |√ |√ |√ |√ |√ |√ | | |stm32f407ze |√ | | | | | | | | |stm32f407zg |√ | | | | | | | | |stm32h750vb |√ | | | | | | | | |stm32f051r8 |√ | | | | | | | | |air32f103cb |√ |√ |√ | | | | | | |ch582 |√ |√ |√ |√ | |√ |√ | | |ch32v103r8t6 |√ |√ |√ | | | | | | |cm32m101a |√ | | | | | | | | |w806 |√ |√ |√ |√ |√ |√ |√ | | |apm32f030r8 |√ | | | | | | | | |apm32e103vb |√ | | | | | | | | |bl-602 |√ |√ | | |√ |√ | |√ | |bl-706 |√ | | | | | | | | |[bl-618](https://verimake.com/d/285-bl618-pikapython-led)|√ | √ | √ | √ | √ | √ | √ | √ | |Raspberry Pico |√ | | | | | | | | |ESP32C3 |√ |√ |√ | | | | | | |TC264D |√ | | | | | | | | |devc |√ | | | | | | | | |visual-studio |√ | | | | | | | | |EC600N |√ | | | | | | | | |mm32f5277e9p |√ |√ | | | | | | | |xr806(openharmony)|√ | | | | | | | | ## Board support |Board|bsp|gpio|uart|pwm|adc|i2c|rgb|lcd|arm-2d| |---|---|---|---|---|---|---|---|---|---| |[Pika-Pi-Zero](https://item.taobao.com/item.htm?spm=a230r.1.14.1.4f2e27a8R0qWJn&id=654947372034&ns=1&abbucket=15#detail)|√|√|√|√|√|√|√|√|√| |Board|bsp|pika_lvgl| |---|---|---| |lvgl-vs-simu|√|√| |swm320|√|√| |Board|bsp|arm-2d| |---|---|---| |QEMU-arm2d|√|√| |Board|bsp|LED|KEY| |---|---|---|---| |SmartLoong|√|√|√|√| ## OS support |OS|port|GPIO|TIME|PWM| |---|---|---|---|---| |RT-Thread|√|√|√|√| |vsf|√|√| | | |OS|port|Google Test|Benchmark| |---|---|---|---| |linux|√|√|√| # 3.Characteristic ### (1)Run environment Support run in mcu without OS or file system. Can run in everywhere with **RAM ≥ 4kB** and **FLASH ≥ 64kB**,such as stm32g030, stm32f103c8t6,esp8266. ### (2)Develop enviroment #### Support REPL by serial.
#### Support run and program python scripts by serial.
Support IDEs like Keil, IAR, RT-Thread studio and segger embedded studio to develop C moudle. Support build tools like CMake, makeFile and Scons. Zero dependencies, zero configuration, out-of-the-box, easy to integrated into privious C projcet. Eazy to extern customized C moudles. Support linux. ### (3)Syntax Support subaggregate of python 3 standard syntax. Support class and method define, encapsulation-inheritance-polymorphism and moudles in `.pyi ` of C module. More Details About Syntax Support |Syntax|Compile-Time|Run-Time|Shell| |---|---|---|---| |Module Define |√|-|-| |Module Import |√|√|√| |Class Define |√|√|√| |Class Inherit |√|√|√| |Method Define |√|√|√| |Method Override |√|√|√| |Method Invoke |√|√|√| |Argument Define |√|√|√| |Argument Assignment |√|√|√| |Object New |√|√|√| |Object Free |√|√|√| |Object Nest |√|√|√| |Control flow |√|√|√| #### Operator | + | - | * | / | == | > | < | >= | <= | % | ** | // | != | & | >> | << | and | or | not | in | += | -= | *= | /= | |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| |√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√| #### Control flow | Syntax | State | | --- | --- | | if | √ | | while | √ | | for in [list] | √ | | for in range(a, b) | √ | | for in [dict] | √ | | if elif else | √ | | for break/continue | √ | | while break/continue | √ | #### Module | Syntax | Python Module | C Module | | --- | --- | --- | | import [module] | √ | √ | | import [module] as | √ | - | | from [module] import [class/function>]| √ | - | | from [module] import [class/function>] as | √ | - | | from [module] import * | - | PikaObj Module Only | #### List/Dict | Syntax | State | | --- | --- | | l = list() | √ | | l = [a, b, c] | √ | | d = dict() | √ | | d = {'a':x, 'b':y, 'c':z} | √ | #### Exception | Syntax | State | | --- | --- | |try:| √ | |except:| √ | |except [Exception]:| - | |except [Exception] as [err]: | - | |except: ... else:| - | |raise:| √ | |raise [Exception]:| - | |finally:| - | #### Slice | Syntax | str | bytes | list | | --- | --- | --- | --- | | test[i] | √ | √ | √ | | test[a : b] | √ | √ | √ | | test[a :] | √ | √ | √ | #### Other keywords/Syntax | yield | is | comprehensions | | --- | --- | --- | | - | √ | - | ### (4)Develop standard. Readability first, nearly never use macro function and global argument. Complete unit testes based on google test. # 4.Both talk and show the code: ## E-mail: [email protected] # 5.Demo The scripts in demos are in the [examples](examples) folder. ## Demo 01 GPIO View Code ``` python import PikaStdLib import STM32G0 mem = PikaStdLib.MemChecker() io1 = STM32G0.GPIO() time = STM32G0.Time() io1.setPin('PA8') io1.setMode('out') io1.enable() io1.low() print('hello pikapython') print('mem.max :') mem.max() print('mem.now :') mem.now() while True: io1.low() time.sleep_ms(500) io1.high() time.sleep_ms(500) ``` ## Demo 02 USART View Code ``` python import PikaStdLib import STM32G0 time = STM32G0.Time() uart = STM32G0.UART() uart.setId(1) uart.setBaudRate(115200) uart.enable() while True: time.sleep_ms(500) readBuff = uart.read(2) print('read 2 char:') print(readBuff) ``` ## Demo 03 ADC View Code ``` python import PikaStdLib import STM32G0 time = STM32G0.Time() adc1 = STM32G0.ADC() adc1.setPin('PA1') adc1.enable() while True: val = adc1.read() print('adc1 value:') print(val) time.sleep_ms(500) ``` ## Demo 04 PWM output View Code ``` python import PikaStdLib import STM32G0 time = STM32G0.Time() pwm = STM32G0.PWM() pwm.setPin('PA8') pwm.setFrequency(2000) pwm.setDuty(0.5) pwm.enable() while True: time.sleep_ms(500) pwm.setDuty(0.5) time.sleep_ms(500) pwm.setDuty(0.001) ``` ## Demo 05 RGB View Code ``` python import STM32G0 import PikaPiZero import Pika

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Cembeddedesp32esp8266iot

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言