Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

filesystem module

import filesystem as fs

Testing if a path is a file (shortcut for try/with open):

fs.isfile('something')
fs.isfile('something', mode='r')

Shortcut for rsync -a

Uses `sh module <https://pypi.python.org/pypi/sh/>`__.

fs.sync('name@somehost:~/somedir/', 'local_path')
fs.sync('~/somedir', '.')

Returns exit code and does not catch any exceptions raised by sh.

Check if a file is the same based on modified time

Example use: determine if a file is the same based on a HEAD HTTP request using the Last-Modified header.

from urllib2.request import urlopen

req = urlopen('http://i.imgur.com/sgon5YP.jpg')
req.get_method = lambda: 'HEAD'
last_modified = None

for line in str(req.info()).split('\n'):
    if 'last-modified' in line.lower():
        last_modified = line.split(': ')[1].strip()
        last_modified = time.strptime(last_modified.replace(' GMT', ''), '%a, %d %b %Y %H:%M:%S')
        break

# Actual check
fs.has_same_time('./sgon5YP.jpg', last_modified)

Delete a set of files

Use fs.rm_files(list_of_files, raise_on_error=bool_val).

pushd usage with the with statement

from osext.pushdcontext import pushd

with pushd('some_dir') as context:
    pass

Metadata

Release files for OSExtension 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for OSExtension 0.1.5
File Size Uploaded Provenance Actions
OSExtension-0.1.5.tar.gz 3.1 kB Without provenance Details for OSExtension-0.1.5.tar.gz

Release files / OSExtension-0.1.5.tar.gz

Download URL OSExtension-0.1.5.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
646550ff2a221c5d4d2109c556f24698f20aa5fa610f6d5ac4679853f905b7c0
BLAKE2b-256 checksum
How to use checksums
e2508be93935690a00edf4f6a0e6c114bed9a77f5c4ac1585f7cf9892a20c54a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for OSExtension 0.1.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page