Git Product home page Git Product logo

rebblestore-api-python's Introduction

Rebble Store Python API

This is a Python implementation of the Rebble Store api.

If you want to contribute join us on the Pebble Dev Discord server, then head to #appstore.

Usage

Installation

First, you'll need Python > 3. I recommend the latest stable (3.6.0 as of this writing). You can install this either through pyenv, your OS's package manager, or by compiling from source.

Next you'll need PostgreSQL. This should be installed via your OS's package manager if possible. If not, you may install from source.

You'll need a pebble user (with password pebble) and a database to which this user has full rights (called pebble_app) running on the same machine as the server running this project. These values are all overwritable by building a proper config. This is explained below.

Once a python 3.x binary is in your $PATH and PostgreSQL is running with the above mentioned user, password, and database, you should be able to install with pip:

git clone https://github.com/pebble-dev/rebblestore-api-python/
cd rebblestore-api-python
pip install .

N.B: If you intend to develop on this project pip install -e . may be more appropriate, as this installs the project 'editably'. See pip install -h for more information on this functionality.

Configuration

Some application behavior is overridable via a config file. The default implementation for a debug server is at rebble_store/app_debug.cfg.

This config file may be either edited directly (NOT recommended) or copied and then passed as the argument --config option when running flask run.

Currently the following behavior is overridable from this file:

  • PostgreSQL configuration:

    • Host
    • Database
    • Username
    • Password
  • Server Name (This only affects the list_routes flask cli helper currently)

Functionality

Once the package has been installed, you may easily run the development server. In the same directory you changed into above, run:

export FLASK_APP=run.py
flask run

This will start the development server at localhost:5000 and begin responding to requests. Once FLASK_APP has been set (as above), you may inspect these additional commands with flask.

Additionly, there are a number of commands intended to assist in populating the earlier mentioned PostgreSQL database with data. These commands presume that a "source" directory exists on the hard disk somewhere in the same format as is downloadable here.

N.B: This functionality has not been tested throughly enough for my liking. It seems to work for us, but please open an issue (or better yet - a pull request) yshould you encounter any issues.

License

Unless otherwise specified within the header in a specific file, the AGPLv3 license applies to every file within the containing repository.

rebblestore-api-python's People

Contributors

avamander avatar bbenne10 avatar magnusknutas avatar sgerli 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.