Skip to main content

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


Download files

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

Source Distribution

DZDBuffy-0.2.1.tar.gz (192.6 kB view details)

Uploaded Source

Built Distribution

DZDBuffy-0.2.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file DZDBuffy-0.2.1.tar.gz.

File metadata

  • Download URL: DZDBuffy-0.2.1.tar.gz
  • Upload date:
  • Size: 192.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for DZDBuffy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aab8a607e829e9d77fc10c887a41270763f10b13a6ad3381163ae5e5bb15a29e
MD5 b4b85639602003a9b8bf41715aa5cd66
BLAKE2b-256 533432898332817040677582bca309777551b569f6dfe6b88b043a290f1ae71e

See more details on using hashes here.

File details

Details for the file DZDBuffy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: DZDBuffy-0.2.1-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

Hashes for DZDBuffy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c9f0829290cb30b7050b09353cf56d285926e567eb7be207d6bdf6b6f7c18bd
MD5 fb91cc52e8114ab7f04ca89ec8b72384
BLAKE2b-256 eb8ff7fdb1542716f5a4811f02083cb8f7e8035de53a0a3fd658b2bf047f4671

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page