Skip to main content

CherryPy REST webservice framework with MongoDB ORM support

Project description

MoCherry

MoCherry is built around CherryPy & mongoengine to support REST webserivces with very low memory footprint, support for MongoDB ORM, built-in production ready WSGI server and faster initilization.

Features

  • In-built REST webservice support
  • MongoDB ORM support with MongoEngine plugin
  • Similar usability & file system structure like Django to reduce the learning curve
  • Low memory footprint
  • In-built CherryPy WSGI server
  • Built-in basic encryption support
  • MIT licensed

Installation

MoCherry is already a part of python PyPi repository. So the following command will download and install MoCherry from PyPi repository and all it's required dependencies to your system or virtualenv.

$ pip install mocherry

Create Your First Project

Now MoCherry consists of a cli script which will enable developers to create a sample project / app from command-line without manually download it from github. Steps as follows:

Create project skeleton

$ mocherry-cli startproject "my_project_001"
Downloading sample project: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/project.zip?raw=true
Creating new project: my_project_001
$ cd my_project_001
$ python manage.py runserver  # start WSGI server
[20/Jan/2020:00:52:20] ENGINE Listening for SIGTERM.
[20/Jan/2020:00:52:20] ENGINE Bus STARTING
[20/Jan/2020:00:52:20] ENGINE Set handler for console events.       
[20/Jan/2020:00:52:20] ENGINE Started monitor thread 'Autoreloader'.
[20/Jan/2020:00:52:21] ENGINE Serving on http://localhost:9090
[20/Jan/2020:00:52:21] ENGINE Bus STARTED

Create application skeleton

Lets assume you have already created a project by following above steps, then you have to go inside that project and create app skeleton as per your requirements.

# Application name: app_001
$ mocherry-cli startapp "app_001"
Downloading sample app: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/app.zip?raw=true
Creating new app: app_001

# Application name: app_002
$ mocherry-cli startapp "app_002"
Downloading sample app: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/app.zip?raw=true
Creating new app: app_002

$ python manage.py runserver  # start WSGI server
[20/Jan/2020:00:52:20] ENGINE Listening for SIGTERM.
[20/Jan/2020:00:52:20] ENGINE Bus STARTING
[20/Jan/2020:00:52:20] ENGINE Set handler for console events.       
[20/Jan/2020:00:52:20] ENGINE Started monitor thread 'Autoreloader'.
[20/Jan/2020:00:52:21] ENGINE Serving on http://localhost:9090
[20/Jan/2020:00:52:21] ENGINE Bus STARTED

MoCherry Management Commands

MoCherry framework also support custom management commands to enhance its CLI capabilities. With the framework sample code we have provided a test command to verify how it works

$ python manage.py testcmd
Success: This is a test command

MoCherry Sample Dataset

MoCherry provides sample data from the version 1.0.9 onwards. This should help developers to play around with the framework immediately without writing any code. You can create sample data by using following management command.

$ python manage.py load_sample_data
Database: mongodb://localhost:27017/mocherry_sample_app

New Sample Data: 5e9abd4ab22cfec440086e60
New Sample Data: 5e9abd4ab22cfec440086e61
New Sample Data: 5e9abd4ab22cfec440086e62
New Sample Data: 5e9abd4ab22cfec440086e63
New Sample Data: 5e9abd4ab22cfec440086e64
New Sample Data: 5e9abd4ab22cfec440086e65
New Sample Data: 5e9abd4ab22cfec440086e66
New Sample Data: 5e9abd4ab22cfec440086e67
New Sample Data: 5e9abd4ab22cfec440086e68
New Sample Data: 5e9abd4ab22cfec440086e69
New Sample Data: 5e9abd4ab22cfec440086e6a
New Sample Data: 5e9abd4ab22cfec440086e6b
New Sample Data: 5e9abd4ab22cfec440086e6c
New Sample Data: 5e9abd4ab22cfec440086e6d
New Sample Data: 5e9abd4ab22cfec440086e6e

Sample Applications

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 Distribution

mocherry-1.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file mocherry-1.2-py3-none-any.whl.

File metadata

  • Download URL: mocherry-1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for mocherry-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e01747ebf80ee0c560f889d6424a89decbb992f94d850b1fa3c99ee9545417cc
MD5 41c8f2d12aaf282d02a15f0377030534
BLAKE2b-256 54c97d2aee2dca314437a3baf9406754cfd75c3146fe4192428cffe88fc0ea6c

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