semvec/pypi-packages huggingface dataset:
Microngo 0.1.1
Microngo is small, fast, and lightweight MongoDB toolkit for python
License: MIT

# Microngo

[![Build Status](https://travis-ci.org/emsuryadi/Microngo.svg?branch=master)](https://travis-ci.org/emsuryadi/Microngo)
[![Coverage Status](https://coveralls.io/repos/github/emsuryadi/Microngo/badge.svg?branch=master)](https://coveralls.io/github/emsuryadi/Microngo?branch=master)
[![PyPi Version](https://img.shields.io/pypi/v/Microngo.svg)](https://pypi.org/project/Microngo/)
[![Documentation Status](https://readthedocs.org/projects/microngo/badge/?version=latest)](https://microngo.emsuryadi.com/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/emsuryadi/Microngo/blob/master/LICENSE)
[![Python Version Support](https://img.shields.io/badge/python-3.x-blue.svg)](https://www.python.org/)

Microngo is small, fast, and lightweight MongoDB toolkit for python.

### Install

Install using PIP:

	pip install Microngo

or install from source:

	python setup.py install

### Documentation

The documentation can be found here [https://microngo.emsuryadi.com/](https://microngo.emsuryadi.com/ "Microngo Documentation")

### Testing

Install requirements and package:

	pip install -r requirements-test.txt
	python setup.py install

Test:

	nosetests -v --with-coverage --cover-erase --cover-package=microngo test.py
omg.py 0.3.3
A micro-framework for the OMG, and code written in Python 3.6+.
License: MIT
Requires Python: >=3.6.0


# omg.py

A micro-framework for the excellent **[Open Microservices Guide](https://microservices.guide/)**, 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](https://github.com/microservices?utf8=%E2%9C%93&q=omg.*&type=&language=), as well. If you'd like to help, [let us know](kenneth@storyscript.io)!

# Intended / Example Usage

```shell
$ cat service.py
```
```python
import omg
from uuid import uuid4

service = omg.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(ensure=True)
```

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

If not available on disk, the required `Dockerfile` and `microservice.yml` files will automatically be generated, for your application:

```shell
$ cat microservice.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
omg: 1

```

```shell
$ cat Dockerfile
FROM kennethreitz/pipenv
COPY . /app
CMD ["python3", "service.py"]
```

Now, run your microservice!

```shell
$ 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 './microservice.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](https://docs.pylonsproject.org/projects/waitress/en/stable/)), preconfigured to serve the masses!

Or, use the [omg-cli](https://github.com/microservices/omg-cli):

```shell
$ omg run new -a prefix='user-'
…
```

## Installation

```shell
$ pip install omg.py
```

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

✨ �� ✨