Giter VIP home page Giter VIP logo

pyuploadcare's Introduction

PyUploadcare: a Python library for Uploadcare

Build Status Documentation Status Coverage Code Health

Simple file uploads for the web are of most importance for us at Uploadcare. 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. Features like uploading from Facebook or manual crop are weighty, hence rare. Our goal is to change the status quo.

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.

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',
    }))

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

Features

  • Python wrapper for Uploadcare REST and Upload APIs.
  • Django widget with useful manual crop and multi-upload.
  • ucare console utility.
  • hosted assets (Kudos to Sławek Ehlert!).

Requirements

pyuploadcare requires Python 2.7, 3.4, 3.5 or 3.6.

If you're using pyuploadcare with Django, check .travis.yml for supported Python-Django combinations.

Obsolete versions of Python and Django are officially not supported, but chances are everything still works. If you have to use those, modify tox.ini, test and run at your own risk ;) Or, you may use older versions of the library.

Installation

In order to install pyuploadcare, simply run:

$ pip install pyuploadcare

or, if you prefer it the old way:

$ easy_install pyuploadcare

Testing

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

$ pip install tox
$ tox

Contributors

pyuploadcare's People

Contributors

andrewshkovskii avatar caxap avatar dayton1987 avatar dimier avatar dmitry-mukhin avatar evgkirov avatar homm avatar khazamov avatar marselester avatar sharov avatar slafs avatar valyagolev avatar yumitsu avatar zerc avatar zmoki avatar zowie avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.