Skip to main content

Python Filesystem Api helpers

Project description


Python Filesystem Api helpers

.. image::
:alt: Build Status

Dealing with the filesystem in Python is clunky. Those of us who have an almost
emotional engagement with the elegance of the APIs we use, feel that it shouldn't
have to be this way. Not in Python.


This dance started waaay back. Frist there was Jason Orendorff's, back
in 2004. Then in 05-06 Reinhold Birkenfeld and Björn Lindqvist tweaked it for
PEP 355, which tried to get something like that into the Standard Library. The
attempt failed miserably. Then in 2007 there was Mike Orr's Unipath, which added
a test suite and made it setuptoolsable.


Question (short): So why are you doing it again?

Question (by implication): The idea has been solidly rejected by python-dev, with
strong objections from that community, and there's already a 3rd party module that
does a pretty good job of this stuff for those people who like This Kind Of Thing.
Why should I care?

Answer (short): The name is way more fun.

Answer (less facetiously): The name is way more fun. And four less characters to type.
And you know, if you're going to do something that's arguably a Bad Idea (TM) that
goes against the One True Way, you have to at leas market it properly, and in my life
at least, "FFS Python" is already a well established phrase.

Answer (oh, right, I just looked up what facetious means):

This kind of thing is about APIs. And the APIs that are out there, could *still be
better*. In fact, the APIs *were* better before all the operator overloading got taken
out in a misguided attempt to get the thing into the standard library.

Unipath is self-proclaimed stable since 2007, and hasn't even seen a bugfix release
since 2009. It's used in production by Real People's software that does Real Work.
Right now, I'm not even sure what the *right* API even is, yet alone in a position to
attempt to get patches into a package that's had a stable API for 5 years. That's
Stick-A-Fork-In-It-It's-Done-style stability.

The api for the Path class in ffs *Will* change, without depreciation warnings, on
minor point releases. Hell, this thing's only *on* PyPi at this stage so I can pull it
into a CI system without having to maintain my own cheeseshop.




.. _Docs:
.. _Source:
.. _Issues:



Add a GNU cp clone to nix.
Add the --recursive argument to the filesystem cp implementation
Add a cp(target) method to the Path class

When touching a subpath where some parents do not exist, Path().touch('this/that/theother.txt')
should create them and assume the caller knows their own mind. This is consistent with the
behaviour of << and open().

0.0.3 (Sep 11 2012)

Reduce the level of String duck-typing to sane levels. Although we do inherit
from str, we bail with AttributeErrors when we think that we're being used
for something absurd - e.g. what's the sane use of Path().splitlines() ?

Overload the / operator to be equivalent to path addition.

Add a mkdir() method to Path. This (and now also touch()) take starargs of
child nodes to the current Path, assuming it is a directory. This allows creating
many directories with one call::

>>> p = Path(rpmroot)
>>> p.mkdir('BUILD', 'SOURCES', 'SPECS', 'RPM', 'SRPMS')

Maintain immutability for in-place append and update tests to catch this regression.

Add a Filesystem abstraction layer that allows us to use *nix semantics and
metaphors with anything that uses Path-like structures.

0.0.2 (Aug 21 2012)

Added the Path class - string-like with shortcuts! doubles as a function and a contextmanager
Many extra aliases in ffs.nix

0.0.1 (Jul 20 2012)

Initial release. Minimal useful feature set. Known incomplete implementations.

Project details

Release history Release notifications

History Node

History Node

History Node


History Node

History Node

History Node

History Node

History Node

History Node


History Node

History Node


History Node


This version
History Node

History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
ffs- (28.8 kB) Copy SHA256 hash SHA256 Source None Sep 12, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page