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()
Metadata
Release files for okmodule 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| okmodule-1.2.0.tar.gz | 3.2 kB | Without provenance | Details for okmodule-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| okmodule-1.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for okmodule-1.2.0-py2.py3-none-any.whl |
Total release size: 5.7 kB
Release files / okmodule-1.2.0.tar.gz
| Download URL | okmodule-1.2.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9708468dd5943ad4b1f82b646575b65c7a829f0f49f3b9812b2c12ff0e49c7a6
|
|
BLAKE2b-256 checksum How to use checksums |
2d2acf9bfb7ccd0ba8df22231c68ff0278fdd0b1960c4752eebed9e1421547fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.9
|
Release files / okmodule-1.2.0-py2.py3-none-any.whl
| Download URL | okmodule-1.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bc7a009ec0f0bd254125f9209694c223b8500c0131c90e517369e6d47c3ff467
|
|
BLAKE2b-256 checksum How to use checksums |
28fdcbb3262361e0d9e45a0d5a6c9ac1ea95af4ae6ba4a9fd2eab3ddd52bc3d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.9
|
Security for okmodule 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.