Code Monkey home page Code Monkey logo

generate-p4a-recipe's Introduction

Recipe Generator for python-for-android

Python-CLI to easily create recipes for python-for-android. I use it for building a kivy-app with buildozer.

This is useful if the installation with pip fails or you don't want to add all requirements manually to your buildozer.spec file, only to note on building that the dependencies itself have unmet dependencies.

  • Searches PyPI or Github for source-url by api-request
  • Prompts the user with a choice for possible versions
  • Fetches the dependencies of a package recursively by use of pipdeptree on the locally installed version of the package

The generated recipe should be seen as a template, even though in simple cases it can work out of the box. See Troubleshooting

๐Ÿšง Setup

Installation

pip install git+https://github.com/david-fischer/generate-p4a-recipe.git

Local recipes with buildozer

We need to add the path of our recipes in the apropriate place in the buildozer.spec of the project:

p4a.local_recipes = ./src/python-for-android/recipes/

๐Ÿ”ง Usage

Usage example:

python -m generate_p4a_recipe --package-name="some_package" --project-dir="/path/to/kivy-project/"

Help text:

python /path/to/script/generate_p4a_recipe.py -h

NAME
    generate_p4a_recipe.py - Recipe Generator for python-for-android

SYNOPSIS
    generate_p4a_recipe.py --package_name=PACKAGE_NAME <flags>

DESCRIPTION
    Obtains the necessary data to fill a recipe template for a package and saves it
    under <project_dir>/scr/python-for-android/recipes/<package_name>/__init__.py

    For full functionality <package_name> (in the desired version) and pipdeptree
    should be installed in the current python environment.

    For further info see https://github.com/david-fischer/generate-p4a-recipe#-troubleshooting .

ARGUMENTS
    PACKAGE_NAME
        Name of the package for which the recipe should be generated.

FLAGS
    --url=URL
        Source of the package. If not set, user is prompted with possible options.
    --version=VERSION
        If url is not set, user is prompted with possible options.
    --recipe_class=RECIPE_CLASS
        If not set, user is prompted with possible options.
    --project_dir=PROJECT_DIR
        Directory where the recipe should be saved. Defaults to ".".

๐ŸŽฏ Troubleshooting

๐Ÿ“ฆ Dependencies

generate-p4a-recipe's People

Contributors

david-fischer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.