All Projects → microservices → oms.py

microservices / oms.py

Licence: MIT license
🔨 A micro-framework for the OMS, and code written in Python 3.6+.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to oms.py

awesome
🎉 An Open Microservice for "awesome" slugs.
Stars: ✭ 25 (-76.42%)
Mutual labels:  oms, open-microservice
avatar-gen
pillow 生成头像,中英文首字母或者随机像素化。Using pillow for generate avatars, first letter of string in Chinese and English or random pixel like avatars.
Stars: ✭ 31 (-70.75%)
Mutual labels:  flask-api
one-workflow
django + vue 一个简单的工作流系统,工单系统
Stars: ✭ 192 (+81.13%)
Mutual labels:  oms
Nectus
A boilerplate Flask API for a Fullstack Project with some additional packages and configuration prebuilt. ⚙
Stars: ✭ 32 (-69.81%)
Mutual labels:  flask-api
rawphp
A powerful, robust and API-first, PHP framework that helps people from different PHP backgrounds work on the same project seamlessly. You can write Laravel, CakePHP, Slim, Symphone and Procedural PHP code inside it and it all works perfectly. Its the PHP Framework for everyone.
Stars: ✭ 31 (-70.75%)
Mutual labels:  micro-framework
adrenaline
A PSR-7 micro framework built on top of the Adroit middleware to speed up your development ;)
Stars: ✭ 31 (-70.75%)
Mutual labels:  micro-framework
KikimR
KikimR the fast PHP micro-framework
Stars: ✭ 13 (-87.74%)
Mutual labels:  micro-framework
Water-classifier-fastai
Deploy your Flask web app classifier on Heroku which is written using fastai library.
Stars: ✭ 37 (-65.09%)
Mutual labels:  flask-api
erdiko
Micro MVC Framework
Stars: ✭ 36 (-66.04%)
Mutual labels:  micro-framework
OneEPA-Standalone-App-Template
Standalone application template for non-www EPA.gov applications
Stars: ✭ 21 (-80.19%)
Mutual labels:  oms
command-pal
The hackable command palette for the web, inspired by Visual Studio Code.
Stars: ✭ 32 (-69.81%)
Mutual labels:  micro-framework
programmingbuddies-api
API backend for Programming Buddies (projects management)
Stars: ✭ 14 (-86.79%)
Mutual labels:  flask-api
braid-go
简单易用的微服务框架 | Ease used microservice framework
Stars: ✭ 34 (-67.92%)
Mutual labels:  micro-framework
ASD-ML-API
This project has 3 goals: To find out the best machine learning pipeline for predicting ASD cases using genetic algorithms, via the TPOT library. (Classification Problem) Compare the accuracy of the accuracy of the determined pipeline, with a standard Naive-Bayes classifier. Saving the classifier as an external file, and use this file in a Flask…
Stars: ✭ 14 (-86.79%)
Mutual labels:  flask-api
recurse
Qt based micro web framework with middleware design
Stars: ✭ 19 (-82.08%)
Mutual labels:  micro-framework
logtoes
Demo of Asynchronous pattern (worker) using Python Flask & Celery
Stars: ✭ 49 (-53.77%)
Mutual labels:  flask-api
flask-skeleton-api
A boilerplate Python API made with Flask used by Ceuma Group developers team.
Stars: ✭ 18 (-83.02%)
Mutual labels:  flask-api
commix
Micro-framework for data-driven composable system architectures
Stars: ✭ 46 (-56.6%)
Mutual labels:  micro-framework
scraped-tvtime-api
A free TVTime API based on scraping TVTime website. No API key required
Stars: ✭ 23 (-78.3%)
Mutual labels:  flask-api
waspy
WASP framework for Python
Stars: ✭ 43 (-59.43%)
Mutual labels:  micro-framework

oms.py

A micro-framework for the excellent Open Microservices Specification, for suppportive code written in Python 3.6+.

Note: this is pre-release software, and is subject to improvement. Contributions are welcome! This framework is being developed for other languages, as well. If you'd like to help, let us know!

Installation

$ pip install --user oms

Intended / Example Usage

$ cat service.py
import oms
from uuid import uuid4

service = oms.Microservice(name='uuid')

@service.register()
def new(prefix: str) -> str:
    """Generates a UUID, with a given prefix."""
    return f'{prefix}{uuid4().hex}'

if __name__ == '__main__':
    service.serve()

register takes some optional arguments: name and path. You can also call service.add(f=new), instead.

Next, run the command $ oms-generate oms.yml files will automatically be generated, for your application:

$ oms-generate service:service
…
'oms.yml' written to disk!
$ cat oms.yml
actions:
  new:
    help: Generates a UUID, with a given prefix.
    arguments:
      prefix:
        in: query
        required: true
        type: string
    http:
      method: get
      path: /new
      port: 8080
    output:
      type: string
lifecycle:
  startup:
    command:
    - python3
    - /app/service.py
oms: 1
$ cat Dockerfile
FROM kennethreitz/pipenv
COPY . /app
CMD ["python3", "service.py"]

Now, run your microservice!

$ python service.py
2019-05-09 14:45:39,342 - micro - DEBUG - Initiating 'uuid' service.
2019-05-09 14:45:39,344 - micro - DEBUG - Registering Flask endpoint: '/new'
2019-05-09 14:45:39,344 - micro - DEBUG - Dockerfile './Dockerfile' already exists!
2019-05-09 14:45:39,345 - micro - DEBUG - Microservice Manifest './oms.yml' already exists!
2019-05-09 14:45:39,346 - micro - INFO - Serving on: '*:8080'

This will spawn a Flask application (using the production-ready waitress web server), preconfigured to serve the masses!

Or, use the oms CLI:

$ oms run new -a prefix='user-'

P.S. Do provide feedback, if you desire! :)

🍰

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].