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://github.com/moremobans/pypi-mobans.git!/templates" )
>>> git_fs . readtext ( "_version.py.jj2" )
'__version__ = "0.0.4" \n __author__ = "C.W." \n '
Get from a different branch
>>> import fs
>>> git_fs = fs . open_fs ( "git://github.com/moremobans/pypi-mobans.git?branch=master!/templates" )
>>> git_fs . read ( "_version.py.jj2" )
'__version__ = "0.0.4" \n __author__ = "C.W." \n '
Checkout submodules recursively
>>> git_fs = fs . open_fs ( "git://github.com/moremobans/pypi-mobans.git?branch=master&submodule=true!/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.
Primary use case
You can do the following with moban:
$ moban -t 'git://github.com/moremoban/pypi-mobans.git!/templates/_version.py.jj2' \
-c 'git://github.com/moremoban/pypi-mobans.git!/config/data.yml' \
-o _version.py
Info: Found repo in /Users/jaska/Library/Caches/gitfs2/repos/pypi-mobans
Templating git://github.com/moremoban/pypi-mobans.git!/templates/_version.py.jj2 to _version.py
Templated 1 file.
$ cat _version.py
__version__ = "0.1.1rc3"
__author__ = "C.W."
License
MIT
Installation
You can install gitfs2 via pip:
$ pip install gitfs2
or clone it and install it:
$ git clone https://github.com/moremoban/gitfs2.git
$ cd gitfs2
$ python setup.py install
0.0.4 - 10.11.2024
Added
#12 :fix github protocol
timeout problem
0.0.3 - 11.12.2019
Added
#5 : support offline
#7 : add license text
0.0.2 - 2.10.2019
Fixed
#4 : failed to checkout more
than one git repo.
0.0.1 - 19.08.2019
first release
what a feat!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages .
Source Distribution
Built Distribution
File details
Details for the file gitfs2-0.0.4.tar.gz
.
File metadata
Download URL:
gitfs2-0.0.4.tar.gz
Upload date:
Nov 9, 2024
Size: 9.5 kB
Tags: Source
Uploaded using Trusted Publishing? Yes
Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Hashes for gitfs2-0.0.4.tar.gz
Algorithm
Hash digest
SHA256
ca157f6d3a330898b7d6e3b1db09fed62efe3bcdb6aa2a31d2d8fa178e148a44
Copy
MD5
8a1556c0a75d9f72229af7fc9e470459
Copy
BLAKE2b-256
729431e3dd551b291426542f7ba153d8fa42126e54436e0686f4e50e167c2033
Copy
See more details on using hashes here.
Provenance
The following attestation bundles were made for gitfs2-0.0.4.tar.gz
:
File details
Details for the file gitfs2-0.0.4-py2.py3-none-any.whl
.
File metadata
Download URL:
gitfs2-0.0.4-py2.py3-none-any.whl
Upload date:
Nov 9, 2024
Size: 6.9 kB
Tags: Python 2, Python 3
Uploaded using Trusted Publishing? Yes
Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Hashes for gitfs2-0.0.4-py2.py3-none-any.whl
Algorithm
Hash digest
SHA256
eccfd0d991b8d71cba41da18af37a4d265623bc6df434f3cbda76727e6b00222
Copy
MD5
2655fda1cb2095acf030e6e292e08648
Copy
BLAKE2b-256
2684a1d46c51496c2085d00824b7d570e280bd3d16ce8a49bd89e8cb99798be5
Copy
See more details on using hashes here.
Provenance
The following attestation bundles were made for gitfs2-0.0.4-py2.py3-none-any.whl
: