Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Convenient File Handling Library

Project Description

Py7File wraps and unifies the python stdlib file handling modules with a simple and intuitive high-level api.

Think: os.path, shutil etc. via object based method access.

Author: Titusz (tp@py7.de) Source Code: http://github.com/titusz/py7file License: BSD

Installation

Use easy_install or pip:

pip install py7file

Usage

Here some hopefully self explaining examples of Py7File usage:

from py7file import Py7File

the_file = Py7File('a_file.txt')

# Copy and Move
copied_file = the_file.copy('d_file.txt')  # copied_file is also a Py7file
the_file.move('moved_file.txt')  # moves the file and mutates the reference

# Backup and Restore
the_file.backup()  # creates a_file_backup_001.txt
the_file.backup()  # creates a_file_backup_002.txt
the_file.delete()  # removes a_file.txt from disk (ups...)
the_file.restore() # recovers file from a_file_backup_002.txt

# Unzip and Rezip
zfile = Py7File('a_file.zip')
zfile.unzip() # creates a subfolder a_file with contents of zipfile
zfile.rezip() # repackages subfolder a_file to a_file.zip

See test_py7file.py for more examples.

Testing

To run the tests:

python test_py7file.py

Status

Alpha - Use at own risk…

Background

As a started learning programming with python I found the different modules for handling files very confusing and cumbersome to use. While writing my first scripts I found myself writing os.path.join(…) way to often. I still keep mixing up os and shutil based file operations like copy, move, rename. So I started this little module to make things easier…

News

0.2

Release date: 08-May-2011

  • Fixed for tests on OSX

0.1

Release date: 08-May-2011

  • Initial release
Release History

Release History

History Node

0.7.4

History Node

0.7.3

History Node

0.7.2

History Node

0.7.1

History Node

0.7

History Node

0.6

History Node

0.5.1

History Node

0.4

This version
History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
py7file-0.3.zip (5.6 kB) Copy SHA256 Checksum SHA256 Source May 8, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting