Skip to content

vishalbandre/pyuploadcare

 
 

Repository files navigation

PyUploadcare: a Python library for Uploadcare

image

Documentation Status

The most important thing for us at Uploadcare is to make file uploading on the web really easy. Everyone is used to the routine work, related to allowing users upload their userpics or attach resumes: from installing image processing libraries to creating folder with right permissions to ensuring the server never goes down or out of space to enabling CDN. Feature like ability to simply use a picture from Facebook or manual cropping are much more burdensome, hence rare. Uploadcare's goal is to change the status quo.

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

A simple Uploadcare ImageField can be added to an existing Django project in just a couple of simple steps. As a result, your users are going to be able to see the progress of the upload, choose files from Google Drive or Instagram, and edit form while files are uploading asynchronously.

from django import forms
from django.db import models

from pyuploadcare.dj 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/documentation/widget/#configuration
class CandidateForm(forms.Form):
    photo = ImageField(widget=FileWidget(attrs={
        'data-cdn-base': 'https://cdn.super-candidates.com',
        'data-image-shrink': '1024x1024',
    }))

image

Features

Installation

To install it, just run:

$ pip install pyuploadcare

or, if you're into vintage:

$ easy_install pyuploadcare

Testing

Besides the Travis CI we use tox. In order to run tests just:

$ pip install tox
$ tox

About

Python library for uploadcare

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%