Socket
Socket
Sign inDemoInstall

generator-schlesinger

Package Overview
Dependencies
574
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    generator-schlesinger

Yeoman generator for Flask APIs using Flask-RESTful, Blueprints, ORM/ODM (with SQLalchemy and mongoEngine),


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Flask API Generator using Flask-RESTful and Flask Blueprints

Contents

  • Getting Started
  • Usage
  • Generators
  • Options
  • Notes
  • Contributing
  • License

Getting Started

What is Yeoman?

To get started you must first install Yeoman. Yeoman is available from the npm package repository.

npm install -g yo

npm is needed to do this. If you don't have npm then install it, npm is usually installed with node, best to install nodejs also.

Yeoman Generators

Yeoman generators are like plug-ins and are designed to build particular applications.

To install generator-schlesinger from npm, run:

npm install -g generator-schlesinger

Finally, initiate the generator:

It is best to setup and activate a virtualenv before initializing.

yo schlesinger

Getting Started

Getting Started Guide.

Usage

Create and activate a Python virtual environment if you haven't already:

virtualenv venv
. venv/bin/activate

(You don't HAVE to create a venv, but it's a good idea.)

Make a new directory, and cd into it:

mkdir my-cool-api && cd $_

Run yo schlesinger with your API's name:

yo schlesinger my-cool-api

(API name defaults to app)

Set some environment variables, like your config and database URI:

export MY_COOL_API_CONFIG=development
export MY_COOL_API_DEVELOPMENT_DATABASE_URI=postgres://localhost/mydb

(Prefixed with your app's name, for your convenience.)

Generators

Available generators:

App

Your starting point. You can pass the application name as an argument.

You can choose your database flavor, versioning scheme, and URL structure. It will install your Python dependencies with Pip.

yo schlesinger pretty-fly-for-an-api

Endpoint

Creates a URL endpoint and respective tests, containing the routes for a resource. You get to specify what HTTP methods it supports. You should import it into your API blueprint after creation.

yo schlesinger:endpoint myendpoint

Endpoint URLs are automatically pluralized. Or close to it, at any rate. Sorry in advance, wild goose web services.

Model

Creates a SQLAlchemy model, containing the data about a resource. You should import it into any associated endpoints or schemas.

yo schlesinger:model mymodel

Version

Bumps your API's version, creating a new package and blueprint for it. If you're on a major versioning scheme, it'll bump your major version. If you're on a minor versioning scheme, you'll need to specify which version to bump. If you're not using a versioning scheme, you might be confused.

yo schlesinger:version

Options

  • --help View documentation from the comfort of your terminal.
  • --skip-install Skips installing dependencies via pip and creating requirements file.

Keywords

FAQs

Last updated on 19 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc