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 Argument, Option, Flag, Command
# command
class Fastqc(Command):
outdir = Option('--outdir')
threads = Option('--threads')
extract = Flag('--extract')
seqfile = Argument()
# sub command
class SamtoolsView(Command):
bam = Flag('-b')
min_mq = Option('-q')
threads = Option('-@')
output = Option('-o')
input = Argument()
# invoke fastqc
fastqc = Fastqc(
outdir='xxx',
threads=4,
extract=True,
seqfile='xxx',
)
fastqc()
# invoke samtools view
samtools_view = SamtoolsView(
bam=True,
min_mq=60,
threads=4,
output='xxx',
input='xxx'
)
samtools_view()
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.2.0.tar.gz
(3.2 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.2.0.tar.gz.
File metadata
- Download URL: okmodule-1.2.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9708468dd5943ad4b1f82b646575b65c7a829f0f49f3b9812b2c12ff0e49c7a6
|
|
| MD5 |
875e0aff11457436f7c9ded4e403a4e8
|
|
| BLAKE2b-256 |
2d2acf9bfb7ccd0ba8df22231c68ff0278fdd0b1960c4752eebed9e1421547fd
|
File details
Details for the file okmodule-1.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: okmodule-1.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc7a009ec0f0bd254125f9209694c223b8500c0131c90e517369e6d47c3ff467
|
|
| MD5 |
c4961daf433d7e24c054cb38c6e3f4a6
|
|
| BLAKE2b-256 |
28fdcbb3262361e0d9e45a0d5a6c9ac1ea95af4ae6ba4a9fd2eab3ddd52bc3d7
|