barite v0.1.0

Crystal language interface to the Backblaze B2 native API.

Barite is a library to access the Backblaze B2 API.

It is far from complete, but will have functions added as I need them. Contributions are welcome if you need a feature that isn't covered.

It currently supports enough to be able to transfer individual files to and from B2 buckets.


  1. Add the dependency to your shard.yml:

        github: gundy818/barite
  2. Run shards install


require "barite"

# Initialise the API.
b2 ="my key id", "my key")

# Define a file in a specific bucket.
b2file = b2.file("bucket_name", "the/file.txt")

# Upload the file from a local copy.

# Download the file to a local copy."/where/to/put/the/download/file.txt")

If there are exceptions, they'll probably be 'Barite::Exception' subclasses. The most likely ones are 'Barite::Exception::AuthenticationException' if there is a problem with your key, or a 'Barite::Exception::NotFoundException' if something you were trying to access couldn't be found. Hopefully the accompanying message will help you understand the problem.


There are no special requirements. There are no real tests at the moment, as I'm figuring out the best way to do this against the actual API, or by mocking it somehow. Suggestions are welcome!

I will be adding functionality to be able to remove files and work with file versions, and also to set life cycle rules to automatically remove old versions.


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • darryl - creator and maintainer
github statistic
  • 0
  • 0
  • 0
  • 3
  • 1 day ago
  • June 7, 2021

MIT License

Synced at

Sat, 19 Jun 2021 08:06:54 GMT