SkillAgentSearch skills...

PikaPython

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. Similar project: MicroPython, JerryScript.

Install / Use

/learn @pikasTech/PikaPython

README

<p align="center"> <img alt="logo" src="document/image/144221063-a85b2cb0-0416-493f-9afb-56cff31e977d.jpg" width="300"> </p> <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">PikaPython</h1> <h4 align="center">Cross platform ultra lightweight embedded Python engine</h4> <p align="center"> <a href="https://gitee.com/lyon1998/pikapython/stargazers"><img src="https://gitee.com/lyon1998/pikapython/badge/star.svg?theme=gvp"></a> <a href="https://gitee.com/lyon1998/pikapython/members"><img src="https://gitee.com/lyon1998/pikapython/badge/fork.svg?theme=gvp"></a> <a href="https://github.com/pikastech/pikapython/stargazers"><img src="https://img.shields.io/github/stars/pikastech/pikapython?style=flat-square&logo=GitHub"></a> <a href="https://github.com/pikastech/pikapython/network/members"><img src="https://img.shields.io/github/forks/pikastech/pikapython?style=flat-square&logo=GitHub"></a> <a href="https://github.com/pikastech/pikapython/watchers"><img src="https://img.shields.io/github/watchers/pikastech/pikapython?style=flat-square&logo=GitHub"></a> <a href="https://github.com/pikastech/pikapython/issues"><img src="https://img.shields.io/github/issues/pikastech/pikapython.svg?style=flat-square&logo=GitHub"></a> <a href="https://github.com/pikastech/pikapython/blob/master/LICENSE"><img src="https://img.shields.io/github/license/pikastech/pikapython.svg?style=flat-square"></a> <a href="https://github.com/pikasTech/pikapython/actions/workflows/CI.yml"><img src="https://github.com/pikasTech/pikapython/actions/workflows/CI.yml/badge.svg"> </a> <a href="https://app.codecov.io/gh/pikasTech/PikaPython"><img src="https://codecov.io/gh/pikasTech/PikaPython/branch/master/graph/badge.svg"> </a> </p> <p align="center"> <a href="README_zh.md" >中文页</a> | <a href="https://whycan.com/f_55.html" >Forum</a> | <a href="https://pikadoc-en.readthedocs.io/en/latest/index.html" >Documents</a> | <a href="https://space.bilibili.com/5365336/channel/detail?cid=202329">Videos</a> | <a href="../../tree/master/bsp#platform-support">BSP</a> | <a href="https://pikadoc-en.readthedocs.io/en/latest/%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%AE%A1%E7%90%86.html">Package Manager</a> | <a href="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" >Contribute</a> | <a href="https://pikadoc-en.readthedocs.io/en/latest/%E5%95%86%E4%B8%9A%E5%90%88%E4%BD%9C%E6%96%B9%E5%BC%8F.html">Business</a> </p>

image

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.

<img src="https://user-images.githubusercontent.com/88232613/147799704-d79345da-a2b9-4593-b1eb-ff9de127429a.png" width="500"/>

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.

image-20220520233540245

Get pikapython:

Use Online Project Generator

Generator url: http://pikascript.com

Note: You need the Community Edition license (Now Free) 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 to quick start without hardware,or use the out-of-the-box develop board Pika-Pi—Zero.

image

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.

Related Projects

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 - core code

bsp - mcu/board support

port - OS and package manager

test - unit test

document - developt document

examples - example scripts

package - packages and moudles

pikaCompiler - pre-compiler write by Rust, used to bind C function to python moudle.

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|√ | √ | √ | √ | √ | √ | √ | √ | |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|√|√|√|√|√|√|√|√|√|

|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.

<img src="assets/1641178790145-2f026e70-4ba1-4e9a-b05f-c602b2bd8cad.png" width="400" alt="微信交流群"/><br/>

Support run and program python scripts by serial.

<img src="document/image/134841230-85de6734-8467-4245-93a5-d452b5022b42.gif" width="400" alt="微信交流群"/><br/>

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.

<details><summary>More Details About Syntax Support</summary>

|Syntax|Compile-Time|Run-Time|Shell| |---|---|---|---| |Module Define |√|-|-| |Module Import |√|√|√| |Class Define |√|√|√| |Class Inherit |

Related Skills

View on GitHub
GitHub Stars1.7k
CategoryDevelopment
Updated3d ago
Forks165

Languages

C

Security Score

100/100

Audited on Mar 19, 2026

No findings