Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

The bucket of python shell helpers, no dependencies, simple API.

Project description

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


pip install osome


>>> from osome import path

>>> path('/var/log')

>>> path('/var', 'log')

>>> path('/var/log').own

>>> path('/var/log').is_dir()

>>> for e in path('/var/log'):
...     print e

>>> path('/var/log/').ls('*log')
[/var/log/boot.log, /var/log/faillog, /var/log/kern.log]

>>> path('/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)

>>> path('/home/user/test_tmp_directory').replace('_', '-')

>>> location = path('/home/user/test_tmp_directory')
>>> location.replace('_', '-') )

>>> from osome import run

>>> print run('uname -r').stdout

>>> run('uname -a').status

>>> 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')

>>> 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


Travis CI,

Tests are implemented with py.tests, to run:




Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for osome, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size osome-0.1.2.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page