/httpfs

Read file over HTTP(s) protocol via python file system 2 interface

Primary LanguagePythonMIT LicenseMIT

httpfs

https://codecov.io/github/moremoban/httpfs/coverage.png https://pepy.tech/badge/httpfs/month https://img.shields.io/github/stars/moremoban/httpfs.svg?style=social&maxAge=3600&label=Star

What can you do with it?

With Python File System 2, you can do:

>>> import fs
>>> with fs.open_fs('https://www.google.com') as f:
...     print(f.readbytes('index.html'))
b'<!doctype ....'

Have fun!

Why

With httpfs, moban can access any files over http(s) as its template or data file:

$ moban -t 'https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/templates/_version.py.jj2'\
  -c 'https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/config/data.yml'\
  -o _version.py

Installation

You can install httpfs via pip:

$ pip install httpfs

or clone it and install it:

$ git clone https://github.com/moremoban/httpfs.git
$ cd httpfs
$ python setup.py install