Skip to main content

A friendly wrapper for boto3.

Project description

Botree: a friendly wrapper for boto3

Botree is a higher level API and text user intercace tool for AWS services.

🧠 Features

  • ✔️ High level and easy to remember API for AWS services.
  • 🔨 TUI (text user interface) powered by Textual.

🧰 Supported AWS services

  • ✔️ S3
  • ✔️ Secrets
  • 🔨 CloudWatch
  • 🔨 EC2

💻 Examples

Until I've written the documentation, some dummie examples may be the best way to get used to the Botree API.

S3

To start a Botree session, use the following:

import botree
session = botree.session("us-east-1", profile="dev")

Create a bucket:

session.s3.create_bucket("sample-bucket")
session.s3.list_buckets()

Note that all S3 operations will use Python's pathlib to handle directory paths, so let's import it:

from pathlib import Path

Download and upload:

source_file = Path("sample_source_file.png")
target_file = Path("sample_target_file.png")
session.s3.bucket("sample-bucket").upload(source_file, target_file)

# downloads are more of the same
session.s3.bucket("sample-bucket").download(source_file, target_file)

Copy files:

source_file = Path("sample_source_file.png")
target_file = Path("sample_target_file.png")
session.s3.bucket("sample-bucket").copy(source_file, target_file)

# you can specify a source bucket to copy a file from
session.s3.bucket("sample-bucket").copy(source_file, target_file, source_bucket="other-bucket")

List files:

session.s3.bucket("sample-bucket").list_objects()

Delete files:

session.s3.bucket("sample-bucket").delete("sample_target_file")

🏗️ Development

Botree relies on Poetry.

Install the Python dependencies with:

poetry install

⚗️ Testing

poetry run pytest --cov=botree tests/

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

botree-0.3.5.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

botree-0.3.5-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

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