Skip to main content

django-s3-file-field-client

PyPI

A Python client library for django-s3-file-field.

Installation

pip install django-s3-file-field-client

Usage

import mimetypes
import pathlib
import requests
from s3_file_field_client import S3FileFieldClient

api_client = requests.Session()  # This can be used to set authentication headers, etc.

s3ff_client = S3FileFieldClient(
    'http://localhost:8000/api/v1/s3-upload/',  # The path mounted in urlpatterns
    api_client,  # This argument is optional
)

file_to_upload = pathlib.Path('/path/to/my_file.txt')
with file_to_upload.open('rb') as file_stream:  # Open in binary mode
    field_value = s3ff_client.upload_file(
        file_stream=file_stream,  # This can be any file-like object
        file_name=file_to_upload.name,
        file_content_type=mimetypes.guess_type(file_to_upload)[0],
        field_id='core.File.blob',  # The "<app>.<model>.<field>" to upload to
    )

api_client.post(
    'http://localhost:8000/api/v1/file/',  # This is particular to the application
    json={
        'blob': field_value,  # This should match the field uploaded to (e.g. 'core.File.blob')
        ...: ...,   # Other fields for the POST request
    }
)

Metadata

Release files for django-s3-file-field-client 1.1.0

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

Source distribution (sdist)

Source distribution for django-s3-file-field-client 1.1.0
File Size Uploaded
django_s3_file_field_client-1.1.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-s3-file-field-client 1.1.0
File Interpreter ABI Platform
django_s3_file_field_client-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / django_s3_file_field_client-1.1.0.tar.gz

Download URL django_s3_file_field_client-1.1.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7313b1e5147b3aa199916586daf07c82ef93dc3aef44e539c311efa2b1edd518
BLAKE2b-256 checksum
How to use checksums
6f0051a13a70b0fde0b58b0bf3ca53adc23a7e4fc179791aa56856bd3244a34c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2025.

Transparency log

Release files / django_s3_file_field_client-1.1.0-py3-none-any.whl

Download URL django_s3_file_field_client-1.1.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a44512995ff69c2f687d31bed3d92f340123b56930de32e78f9db671b39faf64
BLAKE2b-256 checksum
How to use checksums
608819b97746251647fd1287d58a013647a3ed03ab6c6e2d7bf26fd13c2a287a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.23

2 release files

0.0.21

2 release files

0.0.20

2 release files

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