Skip to content

This is a command line interface for easy operation with blobs in Azure Blob Storage.

License

Notifications You must be signed in to change notification settings

rnakamine/blobcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blobcli

release status PyPI version MIT License

This is a command line interface for easy operation with blobs in Azure Blob Storage.

Installation

$ pip install blobcli

Usage

Set connection string to environment variable

$ export AZURE_STORAGE_CONNECTION_STRING="<yourconnectionstring>"
$ blobcli
Usage: blobcli [OPTIONS] COMMAND [ARGS]...

  blob storage easy operation cli (v*.*.*)

Options:
  --help  Show this message and exit.

Commands:
  cp  Copy blob.
  ls  List containers or blobs.
  mv  Move blob.
  rm  Delete blob.

List containers or blobs

$ blobcli ls <target>

Show list of containers

$ blobcli ls
2021-04-04 12:41:09+00:00 samplecontainer01
2021-04-04 12:41:19+00:00 samplecontainer02
2021-04-04 12:41:26+00:00 samplecontainer03

Show list of blobs for the specified container

$ blobcli ls samplecontainer01
                            PRE sample-dir01/
                            PRE sample-dir02/
2021-04-04 12:43:49+00:00    0B sample01.txt
2021-04-04 12:43:54+00:00    0B sample02.txt
2021-04-04 12:43:58+00:00    0B sample03.txt
$ blobcli ls samplecontainer01/sample-dir01/
2021-04-04 12:56:27+00:00    0B sample04.txt
2021-04-04 12:57:27+00:00    0B sample05.txt

Delete blob

$ blobcli rm <target>

Delete the specified blob

$ blobcli rm blob://samplecontainer01/sample03.txt
delete: blob://samplecontainer01/sample03.txt

Move blob

$ blobcli mv <source> <target> 

Move blob from local to container

$ blobcli mv sample05.txt blob://samplecontainer01/sample-dir01/
move: sample05.txt to blob://samplecontainer01/sample-dir01/

container to local

$ blobcli mv blob://samplecontainer01/sample-dir01/sample05.txt .
move: blob://samplecontainer01/sample-dir01/sample05.txt to .

container to container

$ blobcli mv blob://samplecontainer01/sample01.txt blob://samplecontainer02/sample11.txt
move: blob://samplecontainer01/sample01.txt to blob://samplecontainer02/sample11.txt

Copy blob

$ blobcli cp <source> <target>

Copy blob from local to container

$ blobcli cp sample05.txt blob://samplecontainer01/sample-dir01/
copy: sample05.txt to blob://samplecontainer01/sample-dir01/

container to local

$ blobcli cp blob://samplecontainer01/sample-dir01/sample05.txt .
copy: blob://samplecontainer01/sample-dir01/sample05.txt to .

container to container

$ blobcli cp blob://samplecontainer01/sample01.txt blob://samplecontainer02/sample11.txt
copy: blob://samplecontainer01/sample01.txt to blob://samplecontainer02/sample11.txt

License

This project are released under the MIT License

About

This is a command line interface for easy operation with blobs in Azure Blob Storage.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages