cloudmesh-common-4.3.99
4.3.99
4.3.98
4.3.97
4.3.96
4.3.95
4.3.93
4.3.92
4.3.91
4.3.90
4.3.89
4.3.88
4.3.87
4.3.86
4.3.85
4.3.83
4.3.80
4.3.8
4.3.79
4.3.78
4.3.77
4.3.76
4.3.75
4.3.74
4.3.73
4.3.72
4.3.71
4.3.70
4.3.69
4.3.67
4.3.66
4.3.65
4.3.64
4.3.63
4.3.61
4.3.60
4.3.6
4.3.59
4.3.58
4.3.57
4.3.54
4.3.52
4.3.51
4.3.50
4.3.49
4.3.48
4.3.47
4.3.46
4.3.45
4.3.43
4.3.42
4.3.41
4.3.40
4.3.4
4.3.39
4.3.37
4.3.36
4.3.35
4.3.34
4.3.33
4.3.32
4.3.31
4.3.29
4.3.28
4.3.27
4.3.26
4.3.25
4.3.23
4.3.22
4.3.2
4.3.18
4.3.17
4.3.163
4.3.162
4.3.161
4.3.160
4.3.16
4.3.159
4.3.158
4.3.157
4.3.156
4.3.155
4.3.154
4.3.153
4.3.151
4.3.150
4.3.15
4.3.149
4.3.147
4.3.145
4.3.143
4.3.141
4.3.140
4.3.14
4.3.139
4.3.138
4.3.137
4.3.136
4.3.135
4.3.133
4.3.132
4.3.131
4.3.130
4.3.129
4.3.128
4.3.127
4.3.126
4.3.125
4.3.124
4.3.123
4.3.121
4.3.120
4.3.12
4.3.119
4.3.118
4.3.117
4.3.116
4.3.115
4.3.114
4.3.113
4.3.112
4.3.111
4.3.108
4.3.107
4.3.106
4.3.105
4.3.104
4.3.103
4.3.102
4.3.101
4.3.100
4.2.9
4.2.8
4.2.59
4.2.58
4.2.57
4.2.56
4.2.55
4.2.54
4.2.53
4.2.52
4.2.51
4.2.50
4.2.49
4.2.48
4.2.47
4.2.46
4.2.45
4.2.44
4.2.43
4.2.42
4.2.41
4.2.40
4.2.39
4.2.37
4.2.36
4.2.35
4.2.34
4.2.33
4.2.32
4.2.31
4.2.30
4.2.29
4.2.28
4.2.27
4.2.26
4.2.25
4.2.24
4.2.23
4.2.22
4.2.21
4.2.20
4.2.19
4.2.18
4.2.17
4.2.16
4.2.15
4.2.14
4.2.13
4.2.12
4.2.11
4.2.10
4.1.29
4.1.20
4.1.2
4.1.18
4.1.10
4.1.1
4.0.51
4.0.49
4.0.47
4.0.44
4.0.43
1.5.3
1.5.0
1.4.3
1.4.22
1.4.10
4.3.99
4.3.98
4.3.97
4.3.96
4.3.95
4.3.93
4.3.92
4.3.91
4.3.90
4.3.89
4.3.88
4.3.87
4.3.86
4.3.85
4.3.83
4.3.80
4.3.8
4.3.79
4.3.78
4.3.77
4.3.76
4.3.75
4.3.74
4.3.73
4.3.72
4.3.71
4.3.70
4.3.69
4.3.67
4.3.66
4.3.65
4.3.64
4.3.63
4.3.61
4.3.60
4.3.6
4.3.59
4.3.58
4.3.57
4.3.54
4.3.52
4.3.51
4.3.50
4.3.49
4.3.48
4.3.47
4.3.46
4.3.45
4.3.43
4.3.42
4.3.41
4.3.40
4.3.4
4.3.39
4.3.37
4.3.36
4.3.35
4.3.34
4.3.33
4.3.32
4.3.31
4.3.29
4.3.28
4.3.27
4.3.26
4.3.25
4.3.23
4.3.22
4.3.2
4.3.18
4.3.17
4.3.163
4.3.162
4.3.161
4.3.160
4.3.16
4.3.159
4.3.158
4.3.157
4.3.156
4.3.155
4.3.154
4.3.153
4.3.151
4.3.150
4.3.15
4.3.149
4.3.147
4.3.145
4.3.141
4.3.140
4.3.14
4.3.139
4.3.138
4.3.137
4.3.136
4.3.135
4.3.133
4.3.132
4.3.131
4.3.130
4.3.129
4.3.128
4.3.127
4.3.126
4.3.125
4.3.124
4.3.123
4.3.121
4.3.120
4.3.12
4.3.119
4.3.118
4.3.117
4.3.116
4.3.115
4.3.114
4.3.113
4.3.112
4.3.111
4.3.108
4.3.107
4.3.106
4.3.105
4.3.104
4.3.103
4.3.102
4.3.101
4.3.100
4.2.9
4.2.8
4.2.59
4.2.58
4.2.57
4.2.56
4.2.55
4.2.54
4.2.53
4.2.52
4.2.51
4.2.50
4.2.49
4.2.48
4.2.47
4.2.46
4.2.45
4.2.44
4.2.43
4.2.42
4.2.41
4.2.40
4.2.39
4.2.37
4.2.36
4.2.35
4.2.34
4.2.33
4.2.32
4.2.31
4.2.30
4.2.29
4.2.28
4.2.27
4.2.26
4.2.25
4.2.24
4.2.23
4.2.22
4.2.21
4.2.20
4.2.19
4.2.18
4.2.17
4.2.16
4.2.15
4.2.14
4.2.13
4.2.12
4.2.11
4.2.10
4.1.29
4.1.20
4.1.2
4.1.18
4.1.10
4.1.1
4.0.51
4.0.49
4.0.47
4.0.44
4.0.43
1.5.3
1.5.0
1.4.3
1.4.22
1.4.10
توضیحات
A set of useful APIs for cloudmesh
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | cloudmesh-common-4.3.99 |
| نام | cloudmesh-common |
| نسخه کتابخانه | 4.3.99 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Gregor von Laszewski |
| ایمیل نویسنده | laszewski@gmail.com |
| آدرس صفحه اصلی | https://github.com/cloudmesh/cloudmesh-common |
| آدرس اینترنتی | https://pypi.org/project/cloudmesh-common/ |
| مجوز | Apache 2.0 |
# Cloudmesh Common
[](https://pypi.org/project/cloudmesh-common/)
[](https://pypi.python.org/pypi/cloudmesh-common)
[](https://github.com/cloudmesh/cloudmesh-common/blob/main/LICENSE)
[](https://pypi.python.org/pypi/cloudmesh-common)
[](https://pypi.python.org/pypi/cloudmesh-common)
[](https://travis-ci.com/cloudmesh/cloudmesh-common)
## Installation and Documentation
Please note that several packages are available which are pointed to in the
installation documentation.
| | Links |
|---------------|-------|
| Documentation | <https://cloudmesh.github.io/cloudmesh-cloud> |
| Code | <https://github.com/cloudmesh/cloudmesh-cloud> |
| Installation Instructions | <https://github.com/cloudmesh/get> |
## Highlighted features
This library contains a number of useful functions and APIs that we highlight
here. They are used to interact with the system and provide a number of
functions to implement command line programs and shells.
## Console
The console provides convenient way to print colored messages types in the
terminal, such as errors, info, and regular messages
* [cloudmesh.common.console](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/console.py)
```python
from cloudmesh.common.console import Console
Console.error("this is an error printed in red wth prefix ERROR:")
Console.msg("this is a msg printed in black")
Console.ok("this is an ok message printed in green")
```
## Shell
We have lots of shell commands that call linux commands, but also have a
convenient execution command that returns the results in a string.
For more information we like you to inspect the source code:
* [cloudmesh.common.Shell](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/Shell.py)
```python
from cloudmesh.common.Shell import Shell
shell = Shell()
print(shell.terminal_type())
# prints after the command is finished
r = shell.execute('pwd')
print(r)
# prints while the command is executed
r = shell.live('pwd')
print(r)
# open a new terminal and start the command ls in it (for OSX and Gnome)
shell.terminal("ls")
# an example of a build in command
shell.pip("install cloudmesh-common")
```
We have many such build in commands, please see the source
## Printer
A convenient way to print dictionaries and lists with repeated
entries as tables, csv, json, yaml. The dictionaries can even be hierarchical.
* [cloudmesh.common.Printer](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/Printer.py)
Let us assume we have
```python
data = [
{
"name": "Gregor",
"address": {
"street": "Funny Lane 11",
"city": "Cloudville"
{
},
{
"name": "Albert",
"address": {
"street": "Memory Lane 1901",
"city": "Cloudnine"
}
}
]
```
Then we can print it nicely with
```python
print(Printer.flatwrite(self.data,
sort_keys=["name"],
order=["name", "address.street", "address.city"],
header=["Name", "Street", "City"],
output="table")
)
```
Other formats such as csv, json, dict are also supported.
In addition we have also printers for printing attribute lists. Please consult
the source code.
## StopWatch
See: https://colab.research.google.com/drive/1tG7IcP-XMQiNVxU05yazKQYciQ9GpMat#scrollTo=TZAjATZiQh4q&uniqifier=1 for an example
### Using Cloudmesh StopWatch Inline
```python
from cloudmesh.common.StopWatch import StopWatch
import time
StopWatch.start("a")
time.sleep(3)
StopWatch.stop("a")
StopWatch.status("a", True)
StopWatch.benchmark()
```
### Using Cloudmesh Benchmark wrapped in Functions
If it is not wrapped in functions, do not use it this way.
``` python
from cloudmesh.common.Benchmark import Benchmark
import time
def b():
Benchmark.Start()
time.sleep(3)
Benchmark.Stop()
def c():
Benchmark.Start()
time.sleep(1)
Benchmark.Stop()
b()
c()
Benchmark.print()
```
* See also: [cloudmesh.common.StopWatch](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/StopWatch.py)
## dotdict
* [cloudmesh.common.dotdict](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/dotdict.py)
One dimensional Dictionaries in dot format.
```python
from cloudmesh.common.dotdict import doctict
# convert a simple dict to a dotdict
d = dotdict({"name": "Gregor"})
# Now you can say
print(d["name"])
print(d.name)
```
## ssh
* [cloudmesh.common.ssh](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/ssh)
* managing ssh config files
* managing authorized keys
## util
Very useful functions are included in util
* [cloudmesh.common.util](https://github.com/cloudmesh/cloudmesh-common/blob/main/cloudmesh/common/util.py)
Especially useful are
* generating passwords
* banners
* yn_choices
* path_expansion
* grep (simple line matching)
* HEADING() which without parameter identifies the name of the function and
prints its name within a banner
## Changes
* added support for terminals with dark background
## Acknowledgments
Continued work was in part funded by the NSF
CyberTraining: CIC: CyberTraining for Students and Technologies
from Generation Z with the awadrd numbers 1829704 and 2200409.
نیازمندی
| مقدار | نام |
|---|---|
| - | psutil |
| - | pytz |
| - | python-hostlist |
| - | simplejson |
| - | oyaml |
| - | colorama |
| - | humanize |
| - | python-dateutil |
| - | tabulate |
| - | requests |
| - | pyfiglet |
| - | tqdm |
نحوه نصب
نصب پکیج whl cloudmesh-common-4.3.99:
pip install cloudmesh-common-4.3.99.whl
نصب پکیج tar.gz cloudmesh-common-4.3.99:
pip install cloudmesh-common-4.3.99.tar.gz