Skip to main content

Build native mobile apps in python

Project description

# enaml-native-cli

[![Build Status](https://travis-ci.org/codelv/enaml-native-cli.svg?branch=master)](https://travis-ci.org/codelv/enaml-native-cli)

Cli for [enaml-native](https://github.com/codelv/enaml-native). This is for the new build system
which allows more modular app builds.

This is used to:

1. create new apps
2. install and remove app packages and dependencies
3. build and run your apps

Includes customized versions of python-for-android and python-for-ios (kivy-ios).

### Installation

Install via pip using the `--user` flag.

```bash

#: Do either
pip install --user enaml-native-cli


```


### Usage

Start a new enaml-native project:`

```bash

enaml-native init <AppName> <bundle.id> <dest/folder>

```

for example

```bash

#: Note: the apps/ folder must exist!
enaml-native init HelloWorld com.example.helloworld apps/

```

Once done, cd to the app folder and activate the app's virtual environment.

```bash
cd apps/HelloWorld
source venv/bin/activate
```

Now install any app requirements (or use `pip install` and `enaml-native link`)

```bash

enaml-native install enaml-native-icons

```

List apps requirements (or use pip list)

```bash
enaml-native list
```

Build and run your app

```bash

#: Build python requirements
enaml-native build-python # Build python

#: Run the app (or build-android) to build
enaml-native run-android

```



### Creating an Enaml Package

The `enaml-native-cli` was designed to be as configurable as
possible without over complicating the code. A package is simply a regular
python package that typically includes android and ios resources as `data_files`.

Enaml packages are customizable using setuptool's `entry_points`. The following
entry points are supported:

1. `p4a_recipe` - Entry point that installs a python-for-android recipe. See the p4a docs for examples.
2. `enaml_native_post_install` - Entry point that defines a function that is called when a user runs `enaml-native install <your-package>`
3. `enaml_native_linker` - Entry point that defines a function that is called to link your package to the user's android and ios projects.
4. `enaml_native_unlinker` - Entry point that defines a function that is called to unlink your package from the user's android and ios projects.
5. `enaml_native_pre_uninstall` - Entry point that defines a function that is called when a user runs `enaml-native uninstall <your-package>`

All of these are optional. Search the `enaml-native` script commands for where exactly they are called.


### Adding commands to the CLI

Commands can be added by using the `enaml_native_command` entry point.

The entry point must return a subclass (NOT an instance) of the `Command` class.

This command will be added to the cli and can be accessed from the context (via `ctx.cmds['cmd-name']`)
whenever your package is installed.



Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

enaml_native_cli-1.4.0-py3-none-any.whl (780.1 kB view details)

Uploaded Python 3

enaml_native_cli-1.4.0-py2-none-any.whl (780.1 kB view details)

Uploaded Python 2

File details

Details for the file enaml_native_cli-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for enaml_native_cli-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fccfb8dca08e61dfc3d375bac85943495084ca310fd798be0ee668ac92c25b2
MD5 b291fc95473a4ded26b6e2641549a348
BLAKE2b-256 4c2b5ce40c0075c456fda8c5fc2d7ed8b692038865202443091486a27e20815d

See more details on using hashes here.

File details

Details for the file enaml_native_cli-1.4.0-py2-none-any.whl.

File metadata

File hashes

Hashes for enaml_native_cli-1.4.0-py2-none-any.whl
Algorithm Hash digest
SHA256 73f57e1a2e833be0d4634e0448fa69421ca65a0bfff3d5cfe4390d9c4858540c
MD5 67566b98175b0b8e5515841328feb10d
BLAKE2b-256 516f228cb37b128fde25c9316c0d3d2debc100f7eaf56ca40a4600efd6fc7429

See more details on using hashes here.

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