okmodule
Project description
okmodule: a very simple modular implementation
Installation
pip install okmodule
Usage
Module
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
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
okmodule-1.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file okmodule-1.1.0.tar.gz.
File metadata
- Download URL: okmodule-1.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8884cff44e8d552992469ebda9fd61d6001216c3d302f9ea5dbb4d80cea9c7a
|
|
| MD5 |
a8d26f3c05f50052343c4d3821479fb7
|
|
| BLAKE2b-256 |
ecadf633a8df0fc07ed2449515b9c060290ca3e1608af602cb3c4c042432179d
|
File details
Details for the file okmodule-1.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: okmodule-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90bc56ba69b20ef8b7dd9ebd9436c084a7a632c6fa5e5e0dca9cf8f2dcffaa23
|
|
| MD5 |
0c383a76f7bc24a0bd30867b81e8f5c0
|
|
| BLAKE2b-256 |
4bdc5417b38feddc16fb9a5b07ca26aa6f77b59da858ccc678134857cc9a2faf
|