Skip to main content

Pyblazeb2


Pyblazeb2 is a Python 3 module for accessing the Backblaze B2 API


To install run: 
 pip install pyblazeb2

Examples


from pyblazeb2 import BackBlazeB2
b2 = BackBlazeB2(account_id, app_key)

# Upload an entire directory concurrently
b2.recursive_upload('/path/to/foobar', bucket_name='my-bucket', multithread=True)

# Upload a single file without a password
b2.upload_file('/path/to/file.txt', bucket_name='baz')

# Upload a single file, then download
b2.upload_file('/path/to/secrets.txt', bucket_name='baz')
response = b2.download_file_by_name('/path/to/myfile.txt', 'savedfile.txt')

# List all of your buckets
buckets = b2.list_buckets()

# Create a bucket
response = b2.create_bucket('new-bucket', bucket_type='allPrivate')

# Download a file by name
response = b2.download_file_by_name('/path/to/myfile.txt', 'savedfile.txt')

# Authorize download for a private file
bucket_id = "" # Id of bucket which you want authorize download file
bucket_name = "" # Verbose name of bucket
file_name_prefix = ""
url_authorized_download = b2.get_download_authorization(
    bucket_id=bucket_id, bucket_name=bucket_name,
    file_name_prefix=file_name_prefix)
# The response some looks like this:
# https://f345.backblazeb2.com/file/photos/cute/kitten.jpg?Authorization=3_20160803004041_53982a92f631a8c7303e3266_d940c7f5ee17cd1de3758aaacf1024188bc0cd0b_000_20160804004041_0006_dnld

# Download with authorized url
b2.download_file_with_authorized_url(url_authorized_download, 'file_name.log')

Metadata

Release files for pyblazeb2 0.0.23

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

Source distribution (sdist)

Source distribution for pyblazeb2 0.0.23
File Size Uploaded
pyblazeb2-0.0.23.tar.gz 5.8 kB Details

Built distribution (wheel)

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

Total release size: 12.1 kB

Release files / pyblazeb2-0.0.23.tar.gz

Download URL pyblazeb2-0.0.23.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b88e99c742c2a264ffdb842dc0c31d5153ab1b78ba80e75f7c8b0f773175f996
BLAKE2b-256 checksum
How to use checksums
6b655c40edec6f5e91cd968d22c66419068c9f1c7d185271c107f0c3107c27df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

Release files / pyblazeb2-0.0.23-py3-none-any.whl

Download URL pyblazeb2-0.0.23-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cd1be385e3fd0ad20724d2691233504fe783e1653d4876d8e3f2cc59342ea9c
BLAKE2b-256 checksum
How to use checksums
cb369c733e6c278334f2c0bf17df16fe955fbe8c055c818aa37feb9bee016b48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.23 This release

2 release files

0.0.2

2 release files

0.0.1

1 release file

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