Versioning Caching kinda-Proxy for decoupling external responses
Project description
Buffy
Versioning Caching kinda-Proxy for decoupling external HTTP responses
Maintainer: Tim Bleimehl
status: alpha (WIP - do not use productive yet)
What is this?
Buffy is a server/client framework to buffer/cache your http requests. It decouples your dependency on external webservers that are not under your control. It manages downloads from slow and unreliable webservers in the background:
- Resume broken downloads
- Retry corrupted downloads
- Versioning of changing downloads
You can ignore any issues with external webservers and just focus on your application.
At the moment there is only a python client library. But the server has a REST API that can be consumed from any coding language. You are welcome to write a client in your language.
Example use
from buffy.buffypyclient import BuffyPyClient
# connect to buffy server
c = BuffyPyClient(ssl=False)
# create a request
req = c.create_request(
url="https://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0003.xml.gz"
)
# save requested file
req.download_response_content_to("/tmp/pubmed22n0003.xml.gz")
# or alternatively stream requested file
with open("/tmp/pubmed22n0003_2.xml.gz", "wb") as f:
for chunk in req.download_response_content():
f.write(chunk)
This is all it takes to request a file. Next time the webserver at ftp.ncbi.nlm.nih.go
should be down the buffy client will just serve you the cached answer.
Should your Buffy server be down, the client will fall back to direct downloading the request from the source.
Setup Server
docker run -v ${PWD}/buffy-server:/data -p 8008:8008 registry-gl.connect.dzd-ev.de:443/dzdpythonmodules/buffy:prod
Python Client API
todo
Server REST API
todo
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 DZDBuffy-0.2.0.tar.gz
.
File metadata
- Download URL: DZDBuffy-0.2.0.tar.gz
- Upload date:
- Size: 192.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cf8deaf1bc7fd0d1b4263c0dd877de05bf863e7c4578f1e1b71d6e66d4a6077 |
|
MD5 | 89f36d8beaff10f2c2b67008e3b1ec94 |
|
BLAKE2b-256 | 411e6ed668aedcc343e34209678c61f8978e5c569832b45d31e54e6dfb596548 |
File details
Details for the file DZDBuffy-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: DZDBuffy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e337160b3099d3a00733a7412b57c696a957d8be39058d1f354b81eec328d691 |
|
MD5 | 7912d489fe7fada8aa77d4470d2fb32e |
|
BLAKE2b-256 | 82438b0746128d4f3f408b779b1b0cfc815996dd29fd7a500b14ff20e5159d2e |