A bunch tools I have created over the years
Project description
Slurm
This is a collection of tools I have used over the years collected together.
Storage
from slurm import storage
pick = storage.read("file.pickle")
yaml = storage.read("file.yaml")
json = storage.read("file.json")
json = storage.read("file", "json")
data = [1,2,3,4]
storage.write("tom.pickle", data)
storage.write("bob.json", data)
storage.write("guess.file", data, "yml")
Network
from slurm import network
ip = network.get_ip()
print(ip)
Sleep Rate
Will sleep for a prescribed amount of time inside of a loop irregardless of how long the loop takes
from slurm.rate import Rate
rate = Rate(10) # let loop run at 10 Hz
while True:
# so some processing
rate.sleep()
Files
from slurm.files import rmdir, mkdir, run, rm, find
mkdir("some/path")
rmdir("some/path")
rm("/path/file.txt")
rm(["path/a.txt", "path/2/b.txt", "path/3/c.txt"])
find("/path/to/somewhere", "file_to_find") # -> list
find("/path/to/somewhere", "*.html") # -> list
run("ls -alh") # -> output
MIT License
Copyright (c) 2014 Kevin J. Walchko
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
Built Distribution
File details
Details for the file slurm-0.4.4.tar.gz
.
File metadata
- Download URL: slurm-0.4.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.5 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b5e34b71459e55dd1c0b0975a75517eb6c0f2fef87d53deb902c89a2c319c73 |
|
MD5 | f17ecd48b0cb47387fcf71440bd67b7d |
|
BLAKE2b-256 | 5091a2424df885cd51f65ddcb619dc11489c8f532bfb389c035b32ef0083b160 |
File details
Details for the file slurm-0.4.4-py3-none-any.whl
.
File metadata
- Download URL: slurm-0.4.4-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.5 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac5af3c2172634b792ea66cfc170d4d97386f324c9a56fdb21f806c9cebd6ed5 |
|
MD5 | 4666fb1f5e6a326dfc4d9ba04caf831e |
|
BLAKE2b-256 | 418de83925663411832012226d3442cd72e44800ca27e2772168240ab1e4cd49 |