Skip to content

Morph is a python-centric full-stack framework for building and deploying data apps.

License

Notifications You must be signed in to change notification settings

morph-data/morph

Repository files navigation

Header

Features

Morph is a python-centric full-stack framework for building and deploying data apps.

  • Fast to start 🚀 - Allows you to get up and running with just three commands.
  • Deploy and operate 🌐 - Easily deploy your data apps and manage them in production. Managed cloud is available for user authentication and secure data connection.
  • No HTML/CSS knowledge required🔰 - With Markdown-based syntax and pre-made components, you can create flexible, visually appealing designs without writing a single line of HTML or CSS.
  • Customizable 🛠️ - Chain Python and SQL for advanced data workflows. Custom CSS and custom React components are available for building tailored UI.

Quick start

  1. Install morph
pip install morph-data
  1. Create a new project
morph new
  1. Start dev server
morph serve
  1. Visit http://localhsot:9002 on browser.

How it works

Understanding the concept of developing a data app in Morph will let you do a flying start.

  1. Develop the data processing in Python and give it an alias.
  2. Create an .mdx file. Each .mdx file becomes a page of your app.
  3. Place the component in the MDX file and specify the alias to connect to.
.
├─ pages
│  └─ index.mdx
├─ python
│  └─ closing_deals_vis.py
└─ sql
   └─ closing_deals.sql

Building Data Apps

A little example

  1. Create each files in sql, python and pages directories.

SQL: Using DuckDB to read CSV file.

{{
    config(
        name = "example_data",
        connection = "DUCKDB"
    )
}}

select
    *
from
    read_csv("example.csv")

Python: Using Plotly to create a chart.

import plotly.express as px
import morph
from morph import MorphGlobalContext
@morph.func
@morph.load_data("example_data")
def example_chart(context: MorphGlobalContext):
    df = context.data["example_data"].groupby("state").sum(["population"]).reset_index()
    fig = px.bar(df, x="state", y="population")
    return fig

MDX: Define the page and connect the data.

export const title = "Starter App"

# Starter App

Morph is a full-stack framework for building data apps using Python, SQL and MDX.

## Data

<Grid cols="2">
  <div>
    <DataTable loadData="example_data" height={300} />
  </div>
  <div>
    <Embed loadData="example_chart" height={300} />
  </div>
</Grid>
  1. Run morph serve to open the app!

Data App

Documentation

Visit https://docs.morph-data.io for more documentation.

Lisence

Morph is Apache 2.0 licensed.