Skip to main content

MimeBytes

Installation

pip install mime-bytes-py

Usage

from mime_bytes import MimeBytes

this_script: MimeBytes = MimeBytes.from_file(__file__)
print(this_script)  # <MimeBytes text/x-python (... bytes)>
print(this_script.to_base64())  # ZnJvbSBtaW1lX2J5dGVzIGltcG9ydCBNaW1lQnl0ZXMNC...
print(this_script.to_file("hardlink", guess_suffix=True, link_mode="hardlink_only"))  # ...\hardlink.py
from mime_bytes import MimeBytes
import openai

image: MimeBytes = MimeBytes.from_file("my_image.png")
openai.chat.completions.create(
    model="gpt-4o",
    messages=[
        {
            "role": "user", 
            "content": [
                { "type": "image_url", "image_url": { "url": image.to_data_url() } },
                { "type": "text", "text": "Please describe the image." }
            ]
        }
    ]
)

Metadata

Release files for mime-bytes-py 0.1.1

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

Source distribution (sdist)

Source distribution for mime-bytes-py 0.1.1
File Size Uploaded Provenance
mime_bytes_py-0.1.1.tar.gz 2.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mime-bytes-py 0.1.1
File Interpreter ABI Platform
mime_bytes_py-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / mime_bytes_py-0.1.1.tar.gz

Download URL mime_bytes_py-0.1.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
148fcf411bf37603f203f41ddead60c60bc6ed212bcc6454ba0127c7d1f864e8
BLAKE2b-256 checksum
How to use checksums
177da7ab8929bf1f392c507731300834d45cbb99fe0d65d56963ade5b4d074df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mime_bytes_py-0.1.1-py3-none-any.whl

Download URL mime_bytes_py-0.1.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eb93237803402d08fa1b5b3b5b0174cf4d2d643d5884b23464a2b7b0a658f15
BLAKE2b-256 checksum
How to use checksums
52939e303e9b886c1d5d743e6c3c775e2727f7ffca166505c34501bc2ae11569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mime-bytes-py 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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