Metadata-Version: 2.1
Name: okmodule
Version: 1.1.0
Summary: okmodule
Home-page: https://github.com/lawley0316/okmodule
Author: Lawley
Author-email: lawley0316@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.0
Description-Content-Type: text/markdown


# okmodule: a very simple modular implementation

## Installation

```shell
pip install okmodule
```

## Usage

### Module

```python
from okmodule import Module


class MyModule(Module):
    def __init__(self, x, y):
        self.x = x
        self.y = y
        
    def main(self):
        self.log(f'Calculating, x = {self.x}, y = {self.y}')
        return self.x + self.y


result1 = MyModule(1, 2)()  # invoke directly
my_module = MyModule(3, 4)  # create Module object
result2 = my_module()  # invoke module
```

### Command

```python
from okmodule import Option, Flag, Command


class Blastn(Command):
    query = Option('-query')
    db = Option('-db')
    outfmt = Option('-outfmt')
    num_threads = Option('-num_threads')
    out = Option('-out')
    help = Flag('-help')

# show help message
Blastn(help=True)()

# invoke blastn
blastn = Blastn(query='test/query.fa', db='test/db/test', outfmt=6, num_threads=6, out='test/result.txt')
blastn()
```
