osome
The bucket of python shell wrappers around os library, no dependencies, simple API.
Python2.6
Python2.7
Python3.3
PyPy1.9
osome: (python os module wrappers)
path - path wraper around all methods related to path manipulation
run - subprocess wrapper
Documentation
Code
Install
pip install osome
osome.path
>>> from osome import path
>>> path('/var/log')
/var/log
>>> path('/var', 'log')
/var/log
>>> path('/var/log').own
'766'
>>> path('/var/log').is_dir()
True
>>> for e in path('/var/log'):
... print e
/var/log/boot.log
/var/log/dmesg
/var/log/faillog
/var/log/kern.log
/var/log/gdm
>>> path('/var/log/').ls('*log')
[/var/log/boot.log, /var/log/faillog, /var/log/kern.log]
>>> path('/var/log') / 'syslog'
/var/log/syslog
>>> (path('/var/log') / 'syslog').exists
>>> path('/var/log','syslog').open('r')
<open file '/var/log/syslog', mode 'r' at 0x294c5d0>
>>> path('/var/log').cp('copy', r=True)
copy
>>> path('/home/user/test_tmp_directory').replace('_', '-')
'/home/user/test-tmp-directory'
>>> location = path('/home/user/test_tmp_directory')
>>> location.mv( location.replace('_', '-') )
osome.run
>>> from osome import run
>>> print run('uname -r').stdout
3.7.0-7-generic
>>> run('uname -a').status
0
>>> print run('rm not_existing_directory').stderr
rm: cannot remove `not_existing_directory': No such file or directory
>>> print run('ls -la', 'wc -l', 'wc -c')
3
>>> print run('ls -la').stdout.lines
['total 20',
'drwxrwxr-x 3 user user 4096 Dec 20 22:55 .',
'drwxrwxr-x 5 user user 4096 Dec 20 22:57 ..',
'drwxrwxr-x 2 user user 4096 Dec 20 22:37 dir',
'-rw-rw-r-- 1 user user 0 Dec 20 22:52 file']
from osome import run
run('grep something', data=run.stdin)
$ ps aux | python script.py
tests
Travis CI, https://travis-ci.org/xando/osome
Tests are implemented with py.tests, to run:
python runtests.py
based on/inspired by
contributors
Jakub (kuba.janoszek@gmail.com)
Angel Ezquerra
Metadata
Release files for osome 0.1.2
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 |
|---|---|---|---|---|
| osome-0.1.2.tar.gz | 9.5 kB | Without provenance | Details for osome-0.1.2.tar.gz |
Release files / osome-0.1.2.tar.gz
| Download URL | osome-0.1.2.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2fcbdcfcab1e2d503c0e2998a4e6e5e2ea3e4d1e583db02eb34d85f6573e038c
|
|
BLAKE2b-256 checksum How to use checksums |
62a641122bca8e574d0efa4ce617a7470038fcc921a9e28e62ab5cce13911690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for osome 0.1.2
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.