Skip to main content

Input a base64 string and return BytesIO

Project description

base64_bytesio

This library provides functionality to decode base64 encoded files and return them as BytesIO objects.

Scenario

When your website using base64 as image format. And front-end will upload some images to your django back-end. In django framework mostly using file object to recieve image. In this moment, you may need to convert base64 to a bytes io object. Meantime, In our scenario I don't need to save my file on server. Just upload AWS s3 bucket that will fine.

Installation

You can install the library via pip:

pip install base64_bytesio

Usages

Example of using the library

from base64_bytesio import base64_bytesio

data = "data:image/jpeg;base64,..."
decoder = base64_bytesio()
file_object, filename = decoder.base64_bytesio(data)

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

base64_bytesio-0.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

base64_bytesio-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file base64_bytesio-0.0.2.tar.gz.

File metadata

  • Download URL: base64_bytesio-0.0.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for base64_bytesio-0.0.2.tar.gz
Algorithm Hash digest
SHA256 163c053ce42fc8a123ac1a6bc899c6a10f2fe1e8d63126acaae653213663177b
MD5 8816f8473b457cdba6f6e3966697641f
BLAKE2b-256 2318cfe04aad8b7267583095562b0fdbf8c015cb18cca86c8b398790cd55a4ec

See more details on using hashes here.

File details

Details for the file base64_bytesio-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: base64_bytesio-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for base64_bytesio-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f5674eaf927f8e005df1068872f552f86745a4dcb254e0880e91c17b955b18b
MD5 a8ba3e31bb2bc2f77283a006048d61a9
BLAKE2b-256 86f8085ab84d0f172da4c7f900fbd8845b1256db2c61ee2aadb6112110265097

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page