Skip to main content

Python file system 2 over GitPython

Project description

It helps perform file operations over a git repository. It clones the git repository and returns python file system 2’s OSFS instance.

The idea originates from moban, which uses git repositories as a vehicle to have versioned templates for the creation of a new python package. Surely, it can be implemented in any other ways but moban v0.6.0 mandates python file system 2 interface. Hence this library is written.

Get a file inside a python package

>>> import fs
>>> git_fs = fs.open_fs("git://!/templates")
>>> git_fs.readtext("")
'__version__ = "0.0.3"\n__author__ = "C.W."\n'

Get from a different branch

>>> import fs
>>> git_fs = fs.open_fs("git://!/templates")
'__version__ = "0.0.3"\n__author__ = "C.W."\n'

Checkout submodules recursively

>>> git_fs = fs.open_fs("git://!/templates")

Does it write?

Yes locally, it will write as you can do so without using gitfs2. And no, it does not help commit and push the changes for you.

Plus, the intention is never to write to a repository.




You can install gitfs2 via pip:

$ pip install gitfs2

or clone it and install it:

$ git clone
$ cd gitfs2
$ python install

Change log

0.0.3 - 11.12.2019


  1. #5: support offline
  2. #7: add license text

0.0.2 - 2.10.2019


  1. #4: failed to checkout more than one git repo.

0.0.1 - 19.08.2019

first release

  1. what a feat!

Project details

Download files

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

Source Distribution

gitfs2-0.0.3.tar.gz (7.4 kB view hashes)

Uploaded source

Built Distribution

gitfs2-0.0.3-py2.py3-none-any.whl (6.5 kB view hashes)

Uploaded py2 py3

Supported by

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