Read files from python packages
Project description
It helps perform file operations over the python package. It installs the python package and returns python file system 2’s OSFS instance.
The idea originates from moban, which uses python package 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
>>> pypi_fs = fs.open_fs("pypi://pypi-mobans-pkg/resources/templates")
>>> pypi_fs.readtext("_version.py.jj2")
'__version__ = "0.0.2"\n__author__ = "C.W."\n'
List files of interest
>>> pypi_fs = fs.open_fs("pypi://pypi-mobans-pkg/resources")
>>> for path in pypi_fs.walk.files(filter=['*.jj2']):
... print(path)
...
/templates/requirements.txt.jj2
/templates/installation.rst.jj2
/templates/test.script.jj2
/templates/conf.py.jj2
/templates/_version.py.jj2
/templates/Pipfile.jj2
/templates/min_requirements.txt.jj2
/templates/README.rst.jj2
/templates/badges.rst.jj2
/templates/__init__.py.jj2
/templates/NEW_BSD_LICENSE.jj2
/templates/MANIFEST.in.jj2
/templates/CHANGELOG.rst.jj2
/templates/travis.yml.jj2
/templates/setup.py.jj2
/templates/gitignore.jj2
/templates/lint.script.jj2
/templates/tests/requirements.txt.jj2
/templates/docs/make.bat.jj2
/templates/docs/Makefile.jj2
/templates/docs/index.rst.jj2
/templates/docs/source/conf.py.jj2
/templates/docs/source/index.rst.jj2
Does it write?
Yes, it will write as you can do so without using pypifs. But, it is never the intention of pypifs.
Installation
You can install pypifs via pip:
$ pip install pypifs
or clone it and install it:
$ git clone https://github.com/moremoban/pypifs.git
$ cd pypifs
$ python setup.py install
Change log
0.0.2 - 13.5.2020
updated
0.0.1 - 18.8.2019
first release
what a feat!
Project details
Release history Release notifications | RSS feed
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 pypifs-0.0.2.tar.gz
.
File metadata
- Download URL: pypifs-0.0.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb3e2bca4a4c370dd212691fa3fc560167d0cd1817013617cfb71e51b6ed4ecd |
|
MD5 | 09f8ed3a717ec49bc37867fd9aba366b |
|
BLAKE2b-256 | 4de264ff2e7e6a3facd5a124645c01a9dbed4bf1218ac151edc8fc41387f7bfd |
File details
Details for the file pypifs-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: pypifs-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d71ed935cdda504b8bae9637d90bfa3458c38997d59baa809b950d5771ade90 |
|
MD5 | 039b4d37ec6c6eeb5ceed4c0da722bc2 |
|
BLAKE2b-256 | 614420538d06dca7be4628642c5d846e72dcffe30d7940d12ae134b1bd510503 |