Giter VIP home page Giter VIP logo

pybuilder-archetype-api's Introduction

PyBuilder Archetype API Plugin

This plugin generates a structure for a project that requieres endpoints (APIs or web services). This plugin needs pybuilder_archetype_base due to its dependancy with one of its tasks (create_archetype_api).

In the following diagram there is every directory and file created during create_archetype_api execution (take note that create_archetype_base task will add more packages and directories -check its README.md file for more information):

src
└── package_name
    ├── api  # For every script related with the web services
    |   ├── __init__.py
    |   └── api_example.py
    ├── config
    |   ├── __init__.py
    |   └── constants.py
    ├── __init__.py
    ├── gunicorn_config.py  # Gunicorn launching configuration
    ├── main.py  # Script with Flask app
    └── wsgi.py  # WSGI file for server launch
requirements.txt

Content from requirements.txt and constants.py files will be added to the currently existing ones, trying to keep the values set by other plugins.

How to use pybuilder_archetype_api

NOTICE: This plugin only works on Windows due to its dependency with pybuilder_archetype_base PyBuilder plugin. Using this plugin in other OS shall not work properly. Multi-platform support soon.

Add plugin dependencies to your build.py (it requires pybuilder_archetype_base and pybuilder_pycharm_workspace to work properly):

use_plugin('pypi:pybuilder_pycharm_workspace')
use_plugin('pypi:pybuilder_archetype_base')
use_plugin('pypi:pybuilder_archetype_api')

Configure the plugin within your init function:

@init
def initialise(project):
    project.set_property('project_base_path', project_path)

This will tell the plugin which is the project location in the filesystem. project_base_path property value should be always the same.

Launch the task with:

(venv) C:\Users\foo\PycharmProjects\bar> pyb create_archetype_api

build.py file recommended

Check pybuilder_archetype_base build.py recommendation.

Properties

Plugin has next properties with provided defaults

Name Type Default Value Description
project_base_path Path None Project's path in filesystem (same as build.py file). Mandatory

pybuilder-archetype-api's People

Contributors

yeuk0 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.