Transitioning from Python to Spruce

Python development often involves using dynamic scripting languages and various frameworks like Django or Flask. Spruce, on the other hand, uses TypeScript. This guide will help you connect your Python expertise to Spruce’s architecture, showing how to adapt and apply your existing skills in a new environment.

Key Differences between Python and Spruce Development

PythonSpruce
Programming LanguagePythonTypeScript
IDEPyCharm, VS CodeVisual Studio Code
App LifecycleDepends on the framework or contextNo Equivalent
UI DesignTkinter for desktop GUI, Frameworks like Django or Flask for webHeartwood, ViewControllers
Event HandlingEvent loops in frameworks, CallbacksMercury
Data PersistenceSQLite, SQLAlchemy, Django ORMData Stores
Error HandlingTry-Except BlocksTry-Catch Blocks, SpruceErrors
TestingUnittest, PyTestJest, Testing Library
User AuthenticationDepends on the framework; Flask-Login, Django’s auth systemMercury, Authenticator
User PermissionsFramework-specific; Django’s permission framework, Flask-PrincipalMercury, Authorizor

Programming Language

Python

Coming soon...

Spruce

import {
 AbstractSkillViewController,
 CardViewController,
 ViewControllerOptions,
 buildSkillViewLayout,
 SkillView
} from '@sprucelabs/heartwood-view-controllers'

export default class RootSkillViewController extends AbstractSkillViewController {
 public static id = 'root'
 protected cardVc: CardViewController

 public constructor(options: ViewControllerOptions) {
  super(options)
  this.cardVc = this.Controller('card', {
   header: {
    title: 'Hello, World!',
   }
  })
 }

 public render(): SkillView {
  return buildSkillViewLayout('grid', {
   cards: [this.cardVc.render()]
  })
 }
}

IDE

Coming soon...

App Lifecycle

Coming soon...

UI Design

Coming soon...

Event Handling

Coming soon...

Data Persistence

Coming soon...

Error Handling

Coming soon...

Testing

Coming soon...

User Authentication

Coming soon...

User Permissions

Coming soon...

Something Missing?

Request Documentation Enhancement

Now What?

Install the Development Theatre
It looks like you are using Internet Explorer. While the basic content is available, this is no longer a supported browser by the manufacturer, and no attention is being given to having IE work well here.