Skip to main content

from ctypes import pythonapi

        ___       __    __                _       __    __         _____
       / (_)___ _/ /_  / /__      _____  (_)___ _/ /_  / /_   ____|__  /
      / / / __ `/ __ \/ __/ | /| / / _ \/ / __ `/ __ \/ __/  / ___//_ < 
     / / / /_/ / / / / /_ | |/ |/ /  __/ / /_/ / / / / /_   (__  )__/ / 
    /_/_/\__, /_/ /_/\__/ |__/|__/\___/_/\__, /_/ /_/\__/  /____/____/  
        /____/                          /____/                          

lightweight-s3

Ultra-lightweight S3 client. Memory leakage not implemented yet (unlike boto3)

pip install lightweight-s3

Supports:

  • sending existing files
  • sending string as zipped json (data sinks)
  • Operates within a session refreshed every four hours; be sure to shut down the client when you’re done.
Usage Create StorageConnectionParameters:
from lightweight_s3 import StorageConnectionParameters

storage_connection_parameters = StorageConnectionParameters(
    backblaze_access_key_id='access_key_id',
    backblaze_secret_access_key='secret_access_key',
    backblaze_endpoint_url='endpoint_url',
    backblaze_bucket_name='bucket_name'
)

Or just put em into the .env file. Load the .env using load_dotenv()
StorageConnectionParameters() will read all of parameters in format:

BACKBLAZE_ACCESS_KEY_ID=  
BACKBLAZE_SECRET_ACCESS_KEY=  
BACKBLAZE_ENDPOINT_URL=  
BACKBLAZE_BUCKET_NAME=  

or

AZURE_BLOB_PARAMETERS_WITH_KEY=  
AZURE_CONTAINER_NAME=

then:

load_dotenv(env_path)
storage_connection_parameters = StorageConnectionParameters()
s3_client = S3Client(storage_connection_parameters)

s3_client.upload_existing_file(file_path='C:/JohnnySins/Documents/SomeFile.csv')

s3_client.upload_zipped_jsoned_string(
    data='{some_sophisticated_data....}',
    file_name='some_csv_name.csv'
)

s3_client.shutdown()
Sample Main And the final sample main.py would look like:
from lightweight_s3 import S3Client, StorageConnectionParameters


if __name__ == '__main__ ':

    storage_connection_parameters = StorageConnectionParameters(
        backblaze_access_key_id='access_key_id',
        backblaze_secret_access_key='secret_access_key',
        backblaze_endpoint_url='endpoint_url',
        backblaze_bucket_name='bucket_name'
    )

    """
    Or just put em into the .env file. Load the .env using:
    
            load_dotenv(env_path)
    
    and then read it using:
    
            storage_connection_parameters = StorageConnectionParameters()
    """

    s3_client = S3Client(storage_connection_parameters)

    s3_client.upload_existing_file(file_path='C:/JohnnySins/Documents/SomeFile.csv')

    s3_client.upload_zipped_jsoned_string(
        data='some_sophisticated_data....',
        file_name='some_csv_name.csv'
    )

    s3_client.shutdown()

Metadata

Release files for lightweight-s3 0.0.5

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

Source distribution (sdist)

Source distribution for lightweight-s3 0.0.5
File Size Uploaded Provenance
lightweight_s3-0.0.5.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lightweight-s3 0.0.5
File Interpreter ABI Platform
lightweight_s3-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / lightweight_s3-0.0.5.tar.gz

Download URL lightweight_s3-0.0.5.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9ece799242c0fe2a84cef8673bd936c5eaef283c031428c1fbf9604c0586c3cf
BLAKE2b-256 checksum
How to use checksums
caea4af76d2937753ff02b1628aa38a816209cc4681d07d6a01793f542040e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / lightweight_s3-0.0.5-py3-none-any.whl

Download URL lightweight_s3-0.0.5-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d6b7967a2ad24b1f344d61fa1df667c1c2f1ab012ffce8a456c6e8d6b122b9a
BLAKE2b-256 checksum
How to use checksums
e733675fb3f7fe5797d3f2aabfaadc304c03f2c00f5586f7489f01351018cb14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Security for lightweight-s3 0.0.5

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.

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