pyuploadcare icon indicating copy to clipboard operation
pyuploadcare copied to clipboard

Build file handling in minutes. Upload or accept user-generated content, store, transform, optimize, and deliver images, videos, and documents to billions of users.

.. image:: https://ucarecdn.com/2f4864b7-ed0e-4411-965b-8148623aa680/-/inline/yes/uploadcare-logo-mark.svg :target: https://uploadcare.com/?utm_source=github&utm_campaign=pyuploadcare :height: 64 px :width: 64 px :align: left

============================================= PyUploadcare: a Python library for Uploadcare

.. image:: https://badge.fury.io/py/pyuploadcare.svg :target: https://badge.fury.io/py/pyuploadcare .. image:: https://github.com/uploadcare/pyuploadcare/actions/workflows/test.yml/badge.svg :target: https://github.com/uploadcare/pyuploadcare/actions/workflows/test.yml :alt: Build Status .. image:: https://readthedocs.org/projects/pyuploadcare/badge/?version=latest :target: https://readthedocs.org/projects/pyuploadcare/?badge=latest :alt: Documentation Status .. image:: https://coveralls.io/repos/github/uploadcare/pyuploadcare/badge.svg?branch=master :target: https://coveralls.io/github/uploadcare/pyuploadcare?branch=master :alt: Coverage .. image:: https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat :target: https://stackshare.io/uploadcare/stacks/ :alt: Uploadcare tech stack

Uploadcare Python & Django integrations handle uploads and further operations with files by wrapping Upload and REST APIs.

Simple file uploads for the web are of most importance for us. Today, everyone is used to the routine of allowing users to upload their pics or attach resumes. The routine covers it all: installing image processing libraries, adjusting permissions, ensuring servers never go down, and enabling CDN.

This library consists of the Uploadcare API interface and a couple of Django goodies.

Simple as that, Uploadcare ImageField can be added to an existing Django project in just a couple of simple steps_. This will enable your users to see the upload progress, pick files from Google Drive or Instagram, and edit a form while files are being uploaded asynchronously.

You can find an example project here <https://github.com/uploadcare/pyuploadcare-example>_.

.. code-block:: python

from django import forms
from django.db import models

from pyuploadcare.dj.models import ImageField
from pyuploadcare.dj.forms import FileWidget


class Candidate(models.Model):
    photo = ImageField(blank=True, manual_crop="")


# optional. provide advanced widget options: https://uploadcare.com/docs/uploads/widget/config/#options
class CandidateForm(forms.Form):
    photo = ImageField(widget=FileWidget(attrs={
        'data-cdn-base': 'https://cdn.super-candidates.com',
        'data-image-shrink': '1024x1024',
    }))

.. image:: https://ucarecdn.com/dbb4021e-b20e-40fa-907b-3da0a4f8ed70/-/resize/800/manual_crop.png

Documentation

Detailed documentation is available here <https://pyuploadcare.readthedocs.io/en/latest/>_.

Feedback

Issues and PRs are welcome. You can provide your feedback or drop us a support request at [email protected]_.

.. [email protected]: mailto:[email protected] .. _Uploadcare: https://uploadcare.com/?utm_source=github&utm_campaign=pyuploadcare .. _simple steps: https://pyuploadcare.readthedocs.org/en/latest/quickstart.html .. [email protected]: mailto:[email protected]