Skip to main content

Python Version MIT License Coverage

Fluke Logo

What is Fluke?

Fluke is a Python package that acts as a higher-level API to cloud services that primarily relate to object storage and messaging. Fluke manages to hide away much of the complexity that derives from working with said services, aiding you in completing your tasks fast and hassle-free! Fluke achieves this by:

  • Wrapping object storage services within a File/Dir API inspired by the more familiar file storage, through which you are able to interact with your data no matter where they reside, be it the local file system, a remote server, or a bucket in the cloud.

  • Greatly reducing the intricacies of working with message queues by viewing them as mere data structures that support three elementary operations, that is, push, peek, and poll.

Installation

You can start using Fluke by installing it via pip. Note that fluke requires Python >= 3.9.

pip install fluke-api

Usage Example

In this example, we will be using Fluke in order to:

  1. Poll an Amazon SQS queue every minute for new messages. Each of these messages contains the path of a newly uploaded file to an Amazon S3 bucket.
  2. Use said messages in order to locate the corresponding files and transfer them to a remote server.

First things first, we need to be able to authenticate with both AWS and the remote server. In order to achieve this, we will be importing from fluke.auth:

from fluke.auth import AWSAuth, RemoteAuth

# This object will be used to authenticate
# with AWS.
aws_auth = AWSAuth(
    aws_access_key_id="aws_access_key",
    aws_secret_access_key="aws_secret_key")

# This object will be used to authenticate
# with the remote machine.
rmt_auth = RemoteAuth.from_password(
    hostname="host",
    username="user",
    password="password")

Next, we just need to import from fluke.queues and fluke.storage so that we gain access to any necessary resources in order to perform the data transfer:

from fluke.queues import AmazonSQSQueue
from fluke.storage import AmazonS3Dir, RemoteDir

with (
    AmazonSQSQueue(auth=aws_auth, queue='queue') as queue,
    AmazonS3Dir(auth=aws_auth, bucket='bucket') as bucket,
    RemoteDir(auth=rmt_auth, path='/home/user/dir', create_if_missing=True) as rmt_dir
):
    for batch in queue.poll(polling_frequency=60):
        for msg in batch:
            bucket.get_file(path=msg).transfer_to(dst=rmt_dir)

And that's basically it!

You can learn more about Fluke by visiting the Fluke Documentation Page.

Release files for fluke-api 0.5.0

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

Source distribution (sdist)

Source distribution for fluke-api 0.5.0
File Size Uploaded
fluke-api-0.5.0.tar.gz 62.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fluke-api 0.5.0
File Interpreter ABI Platform
fluke_api-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.2 kB

Release files / fluke-api-0.5.0.tar.gz

Download URL fluke-api-0.5.0.tar.gz
Size 62.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a5fdccdbf4c8d9545103d3957fe4fcf1643a842480c88a4333cfe6915b7fa69d
BLAKE2b-256 checksum
How to use checksums
f5984da9d96a313e6d19ec9187115f7a91737bcba3e33f34620d58ef7c687794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / fluke_api-0.5.0-py3-none-any.whl

Download URL fluke_api-0.5.0-py3-none-any.whl
Size 40.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99df382f73f5d7908f2838717a9dce554997b39d1978b2f4a6c9f608aa0f83f4
BLAKE2b-256 checksum
How to use checksums
926e92cd8309ae5ff69f090ab88abae6e162747b2dd2f2e9fc51fb37cfe9d522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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