python-simples: A Python Library that Helps You Do Some Simple Works
installation
pip install python-simples
features
SimpleStructure, simple directory structure that store data and output files.SimpleCellar, simple command line application installation that not in PATH environment.SimpleTask, simple task that you and create it in somewhere, run it in another place.
usage
1. SimpleStructure
SimpleStructure is a suggested directory structure for command line software to run. I often have such a need, there is a directory /path/to/root, and several subdirectories are saved in this directory, which are:
- Data: The original data directory of the software running
- Output: software running output directory
from simples import SimpleStructure
ss = SimpleStructure('/path/to/root')
ss('stdout.txt')
ss('stderr.txt')
ss('status.txt')
ss.data_dir
ss.data('expression.txt')
ss.output_dir
ss.output('diff-exprs.txt')
2. SimpleCellar
SimpleCellar was written to solve the problem of running some command line software that is not in the PATH environment variable. For example, bioinformatics often needs to use blast. If your BLAST is not in the environment variable, it is very troublesome to call it.
from simples import SimpleCellar
sc = SimpleCellar('/path/to/blast/install')
sc.bin_dir
sc.bin('blastn')
sc.bin('blastp')
3. SimpleTask
The original intention of SimpleTask is to solve the problem of remote running of command line software. That is, the parameter specification of the command line software is not in the same place as the operation (the most typical case is the web, for example, the user specifies the parameters in the view, and the executed process is a Celery Task).
The solution is to:
- Create a serializable task type
- This type supports serialization and deserialization
- The task object knows how to run it
So there is SimpleTask.
from simples import SimpleTask, Option, Argument
# you create task in some place
st = SimpleTask('/path/to/root', 'ls')
st.add_param(Option('-l'))
st.add_param(Argument('-D', '%Y-%m-%d'))
st.add_param(Option('.))
file = st.save()
# you run in another place
new_st = SimpleTask.load_file(file)
new_st.run()
Files that SimpleTask generate:
task.json, task serialization json, you can deserialize task object by this filestdout.txt, standard output message of this taskstderr.txt, standard error message of this taskstatus.txt, task status, -1 represents run failed, 0 represents running, 1 represent successful.
Metadata
Release files for python-simples 1.0.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 | |
|---|---|---|---|---|
| python-simples-1.0.0.tar.gz | 5.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_simples-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / python-simples-1.0.0.tar.gz
| Download URL | python-simples-1.0.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60a4bd8348e04ec9164b7d8d179747f9cf69113c150e1fee27b482ced89c12a5
|
|
BLAKE2b-256 checksum How to use checksums |
b8c5e53588ce7e62350a169e6d44d29c190c85dcaacc255bbd669f44d8e0ccfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.59.0 importlib-metadata/4.11.1 keyring/23.0.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.7.9
|
Release files / python_simples-1.0.0-py3-none-any.whl
| Download URL | python_simples-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f99bad6eb4e56ab1f704170168afdd45b4e2fef683478916651386f058893460
|
|
BLAKE2b-256 checksum How to use checksums |
853a45d8bf1e21ea4c103f44636a2e0debe1ca509c6f71ca95b0c099e0c8cdc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.59.0 importlib-metadata/4.11.1 keyring/23.0.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.7.9
|
Security for python-simples 1.0.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.