This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Description

This module is designed to relief and simplify interaction of your python modules with the file system.

Installation

python setup.py install

or

pip install -e .

or

pip install fs-manager

How to use

For example, you can inherit your class from FSManager class

from fs_manager import FSManager

class Foo(FSManager, ...):
  FSManager.__init__(self, base_path="/some/base", mode=0o744, temporary=True)
    ...

Or you can just use it as an object

from fs_manager import FSManager

with FSManager(base_path="/tmp/base", mode=0o744, temporary=True) as fsm:
  fsm.mkdir(alias="tom", path="tom_dir", mode=0o744, temporary=True)
  fsm.cd("tom")
  fsm.mkdir("tom_dir")
  fsm.mkfile("jerry", "jerry_file", 0o644, True)
  fsm.ls()
  fsm.up()
  fsm.ls()
  fsm.rm("tom")

Save what you did

from fs_manager import FSManager

with FSManager(base_path="/tmp/base", mode=0o744, temporary=True) as fsm:
  fsm.mkdir(alias="tom", path="tom_dir", mode=0o744, temporary=True)
  fsm.cd("tom")
  fsm.mkdir("tom_dir")
  fsm.mkfile("jerry", "jerry_file", 0o644, True)
  fsm.ls()
  fsm.save_all()

...
shutil.copy("/tmp/base/.fs-structure-full.json", "/tmp/another_base/.fs-structure-full.json")
...

with FSManager(base_path="/tmp/another_base", mode=0o744, temporary=True) as fsm:
  fsm.load_all()

Structure will be saved at root to “.fs-structure-full.json”. But structure saves automatically when temporary=False. So if you initialize from the same directory, structure loads anyway.

Initialize you fs-manager from the directory on your disk

from fs_manager import FSManager

with FSManager(base_path="/tmp/base", mode=0o744, temporary=False) as fsm:
  fsm.snappy(root_binded=True)
  fsm.cd("some/path")

Thus, if root_binded=True your structure will be initialized from one root. In other words, you’ll be able to cd right from the root fs-manager object.

Also you can verify hashsum of files under any prefix like that

from fs_manager import FSManager

with FSManager(base_path="/tmp/base", mode=0o744, temporary=False) as fsm:
  fsm.snappy(root_binded=True)
  fsm.cd("some/path")
  fsm.save_hashsums("sha1")
  ...
  mismatches = fsm.check_hashsums(type="sha1", log_warnings=False)

There is much more inside :)

Release History

Release History

0.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fs-manager-0.3.0.zip (21.8 kB) Copy SHA256 Checksum SHA256 Source Sep 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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