Versioning Caching kinda-Proxy for decoupling external responses
Project description
Buffy
Versioning and caching kinda-proxy for decoupling external HTTP resources
Maintainer: Tim Bleimehl
Status: alpha (WIP - do not use productive yet)
Source: https://git.connect.dzd-ev.de/dzdpythonmodules/buffy
User documentation: https://dzd-ev.github.io/buffy-docs.github.io/
Public issue tracker: https://github.com/dzd-ev/buffy-docs.github.io/issues
What is this?
Buffy is a server/client framework to buffer/cache your http requests.
Buffy decouples your dependency on external webservers that are not under your control.
Buffy manages HTTP downloads in the background.
You can ignore any issues with external webservers and just focus on your application.
Features
- Caching of remote http resources (a.k.a.
files you downloaded from the web
) - Versioning of remote http resources
- Managing of remote http resources with grouping, tagging and pinning
- Background pre-download of remote http resources
- "Smart"-Downloader
- Resume broken downloads
- Retry corrupted downloads
Intended purpose
- Make your software resiliant against changing (transformation,discontinuation,outage,...) external http resources
- Dampen load on external servers - prevent
429 Too Many Requests
errors - Pre-cache long running downloads before you need them
Clients
At the moment there is only a python client library.
But the Buffy-server has a REST API that can be consumed from any coding language.
You are very welcome to contribute a client in your language 👋😃
Quick Start Client
Lets have a small example how your Buffy client code could look like.
Install Buffy
pip install DZDBuffy
Example
Lets write some code using the Buffy client
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(dir="/tmp")
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.
See the documenation for more detailed examples on how to use the client
Quick Start Server
Requirements
Server start
- Download the buffy docker-compose file
wget -O docker-compose.yaml https://git.connect.dzd-ev.de/dzdpythonmodules/buffy/-/raw/main/docker-compose.yaml?inline=false
- Start the Buffy-server with docker compose
docker-compose up -d
Connecting the BuffyPyClient
Create a python script.
# connect to Buffy-server
from buffy.buffypyclient import BuffyPyClient
# connect to Buffy-server
c = BuffyPyClient(host="localhost", port=8008, ssl=False)
See the documentation for more detailed examples on how to use the client
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.7.1.tar.gz
.
File metadata
- Download URL: DZDBuffy-0.7.1.tar.gz
- Upload date:
- Size: 943.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f07ea081088948ef4c9f92129270a5d8e5a3bfe4dc35d3eb6251d22886857775 |
|
MD5 | 8db9479b4c67977febcea7b9c1e6eefb |
|
BLAKE2b-256 | b37f88c6d4be1862186b44a1999827435b3b1c191d06a2a4c2462877f2343b70 |
File details
Details for the file DZDBuffy-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: DZDBuffy-0.7.1-py3-none-any.whl
- Upload date:
- Size: 44.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5ee856de24652d28fdd0b4dfe7bd3729999638da4e3b7bbc7111a7056112c3 |
|
MD5 | 1e34cc95736e96bbe478ffab8d285b09 |
|
BLAKE2b-256 | 0410121449768a4610880adddd3ac0c0fca486543a9cb739275563d98c45cf01 |