Skip to content

Chinacolt/backblaze-b2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

backblaze-b2

Python module for accessing the Backblaze B2 API

Examples

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

# Upload an entire directory concurrently, encrypt with a password
b2.recursive_upload('/path/to/foobar', bucket_name='my-bucket', multithread=True, password='p@ssW0rdz')

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

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

# 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')

About

Python module for accessing the Backblaze B2 API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%