Skip to main content

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

Release files for DZDBuffy 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DZDBuffy 0.7.3
File Size Uploaded
DZDBuffy-0.7.3.tar.gz 943.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DZDBuffy 0.7.3
File Interpreter ABI Platform
DZDBuffy-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 987.4 kB

Release files / DZDBuffy-0.7.3.tar.gz

Download URL DZDBuffy-0.7.3.tar.gz
Size 943.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b5ea8cd490e8dbb4145d5239bacff60d4f48f2f44e42441ab1c0e184b221a8e4
BLAKE2b-256 checksum
How to use checksums
661ac41c67825b5c06313f389360087b32895f988094dab081556e8c54846d06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / DZDBuffy-0.7.3-py3-none-any.whl

Download URL DZDBuffy-0.7.3-py3-none-any.whl
Size 44.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
872f753507fdecbd9e93d27f353e796602ef130a28cb5e5f2767f33a6239fb61
BLAKE2b-256 checksum
How to use checksums
1aea0e0e728335b2faba31c4fabcd90100d84935d00a4ea9673cf009911d36c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.15

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page