Skip to main content

Embeddable code editor for python apps

Project description

Cupcake: Embeddable Code Editor

Cupcake is an Embeddable modern-looking code editor for python tkinter applications. It has rich Autocompletions, Minimap and Semantic Syntax highlighting. Cupcake is written in pure python with the tkinter library. It is the code editor which powers Biscuit.

import tkinter as tk
from cupcake import Editor, Languages

root = tk.Tk()
root.minsize(800, 600)

e = Editor(root, language=Languages.TYPESCRIPT)
e.pack(expand=1, fill=tk.BOTH)

e.content.insert("end", """
// check this out
import "./theme.scss";
import "./global.css";
import App from './App.svelte';

const app = new App({
	target: document.body
});

export default app;
""")

root.mainloop()

see examples for instructions on Diff viewer, Image viewer and Theming

Syntax Highlighting & Minimap

Auto completions

Installation

Cupcake can be installed by running:

pip install cupcake-editor

Cupcake requires Python 3.10+ to run.

Quick start

Here is a quick example of embedding cupcake in your project:

import tkinter as tk
from cupcake import Editor 

root = tk.Tk()
root.minsize(800, 600)

editor = Editor(root)
editor.pack(expand=1, fill=tk.BOTH)

root.mainloop()

Examples!

Examples demonstrating how to use cupcake are in the examples directory. You can learn how to integrate the editor to your app with these. You can run the examples like python -m examples.hello

Features

  • Syntax Highlighting (over 500+ languages supported)
  • Auto=Completions (words + keywords)
  • Auto-Indentation
  • Diff Viewer
  • Minimap
  • Breadcrumbs and Pathview tree
  • Image Viewer
  • Fully Customizable and Themable
  • Language Detection from File Extensions
  • Code Folding

Contributing

Your contributions and support are greatly appreciated! 🧡 See contributing for further details such as coding guidelines and tools used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cupcake_editor-0.25.5.tar.gz (32.0 kB view hashes)

Uploaded Source

Built Distribution

cupcake_editor-0.25.5-py3-none-any.whl (42.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page