Skip to main content

Sweetpotato provides an intuitive wrapper around React Native.

Project description

Sweetpotato 🥔

alt text alt text Documentation Status Code style: black

This project is still in early stages of development and is not stable.

Sweetpotato provides an intuitive wrapper around React Native, making cross-platform development (iOS, Android, Web) accessible from Python.


See https://sweetpotato.readthedocs.io for documentation.


You can view the below example at the following link: https://snack.expo.dev/@greysonlalonde13/amused-crackers

from sweetpotato.app import App
from sweetpotato.components import Image, StyleSheet, Text, Button, View
from sweetpotato.config import settings
from sweetpotato.navigation import create_bottom_tab_navigator

settings.USE_NAVIGATION = True

styles = StyleSheet.create({
    "image": {"height": 200, "width": 200, "borderRadius": 50},
    "layout": {
        "justifyContent": "center",
        "alignItems": "center",
        "flex": 1,
    },
    "text": {"margin": 25},
})

tab = create_bottom_tab_navigator(name="tab")

image_url = "https://raw.githubusercontent.com/greysonlalonde/sweetpotato/main/media/sweetpotatoes.JPG"
home_page = View(
    style=styles.layout,
    children=[
        Image(style=styles.image, source={"uri": image_url}),
        Text(style=styles.text, text="Sweet, Sweet Potatoes"),
        Button(title="Info", on_press="() => alert('This app was made with sweetpotato')")
    ]
)

tab.screen(
    screen_name="Home",
    children=[home_page],
)
app = App(component=tab, theme="dark")

if __name__ == "__main__":
    app.run()

iOS, Android, and web:

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

sweetpotato-0.7.0a0.tar.gz (220.7 kB view hashes)

Uploaded Source

Built Distribution

sweetpotato-0.7.0a0-py3-none-any.whl (229.2 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