semvec/pypi-packages huggingface dataset:
pxolly 1.0.3
pxolly API wrapper
License: MIT

# pxolly API Wrapper
![PyPI](https://img.shields.io/pypi/v/pxolly)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pxolly)
![GitHub](https://img.shields.io/github/license/lordralinc/pxolly_api)

## Установка 
```shell
pip install -U pxolly
```
или
```shell
pip install -U https://github.com/lordralinc/pxolly_api/archive/master.zip
```
## Получение токена
N/A

## Использование
```python
from pxolly import PxollyAPI

api = PxollyAPI("access_token")
api.acc.get_info()
api.make_request("method", {"foo": "bar"})
await api.make_request_async("method", {"foo": "bar"})
```

## Методы
N/A
Flask-thumbnails 1.1.0
A simple extension to create a thumbs for the Flask
License: MIT
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*

.. image:: https://github.com/silentsokolov/flask-thumbnails/workflows/build/badge.svg?branch=master
   :target: https://github.com/silentsokolov/flask-thumbnails/actions?query=workflow%3Abuild+branch%3Amaster

.. image:: https://codecov.io/gh/silentsokolov/flask-thumbnails/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/silentsokolov/flask-thumbnails

flask-thumbnails
================

A simple extension to create a thumbs for the Flask


Installation
------------

Use your favorite Python package manager to install the app from PyPI, e.g.

Example:

``pip install flask-thumbnails``


Add ``Thumbnail`` to your extension file:

.. code:: python

    from flask import Flask
    from flask_thumbnails import Thumbnail

    app = Flask(__name__)

    thumb = Thumbnail(app)

Add ``THUMBNAIL_MEDIA_ROOT`` and ``THUMBNAIL_MEDIA_URL`` in your settings:

.. code:: python

    app.config['THUMBNAIL_MEDIA_ROOT'] = '/home/www/media'
    app.config['THUMBNAIL_MEDIA_URL'] = '/media/'


Example usage
-------------

Use in Jinja2 template:

 .. code:: html

    <img src="{{ 'image.jpg'|thumbnail('200x200') }}" alt="" />
    <img src="{{ 'image.jpg'|thumbnail('200x200', crop='fit', quality=100) }}" alt="" />


Options
~~~~~~~

``crop='fit'`` returns a sized and cropped version of the image, cropped to the requested aspect ratio and size, `read more <http://pillow.readthedocs.org/en/latest/reference/ImageOps.html#PIL.ImageOps.fit>`_.

``quality=XX`` changes the quality of the output JPEG thumbnail, default ``90``.


Develop and Production
----------------------

Production
~~~~~~~~~~

In production, you need to add media directory in you web server.


Develop
~~~~~~~

To service the uploaded files need a helper function, where ``/media/`` your settings ``app.config['THUMBNAIL_MEDIA_URL']``:

.. code:: python

    from flask import send_from_directory

    @app.route('/media/<regex("([\w\d_/-]+)?.(?:jpe?g|gif|png)"):filename>')
    def media_file(filename):
        return send_from_directory(app.config['THUMBNAIL_MEDIA_THUMBNAIL_ROOT'], filename)


Option settings
---------------

If you want to store the thumbnail in a folder other than the ``THUMBNAIL_MEDIA_THUMBNAIL_ROOT``, you need to set it manually:

.. code:: python

    app.config['THUMBNAIL_MEDIA_THUMBNAIL_ROOT'] = '/home/www/media/cache'
    app.config['THUMBNAIL_MEDIA_THUMBNAIL_URL'] = '/media/cache/'
    app.config['THUMBNAIL_STORAGE_BACKEND'] = 'flask_thumbnails.storage_backends.FilesystemStorageBackend'
    app.config['THUMBNAIL_DEFAUL_FORMAT'] = 'JPEG'


Migrate 0.X to 1.X
------------------

Since version 1.X all settings have a prefix ``THUMBNAIL_``. Example: ``MEDIA_ROOT`` -> ``THUMBNAIL_MEDIA_ROOT``.
untether-django-jsoneditor 0.1.0
Django form widget form JSONField
License: MIT

# django-jsoneditor-widget

> Django form widget form JSONField

## Demo

It look like this.

![demo image](https://github.com/arthurc0102/django-jsoneditor-widget/blob/master/screenshot/demo.png?raw=true)

## Install

- Install: `pip install django-jsoneditor-widget`
- Settings:
    ```python
    INSTALLED_APPS = [
        # some apps ....
        'jsoneditor',
        # other apps ...
    ]
    ```

## Create model

```python
from django.db import models
from django.contrib.postgres.fields import JSONField


class Book(models.Model):
    name = models.CharField(max_length=150)
    information = JSONField()

    def __str__(self):
        return self.name
```

## Admin site settings

- Use ModelAdmin
    ```python
    from django.contrib import admin

    from jsoneditor.admin import JSONFieldModelAdmin

    from .models import Book


    admin.site.register(Product, JSONFieldModelAdmin)
    ```

- Use mixin
    ```python
    from django.contrib import admin
    
    from jsoneditor.admin import JSONFieldAdminMixin

    from .models import Book


    @admin.register(Book)
    class BookModelAdmin(JSONFieldAdminMixin, admin.ModelAdmin):
        pass
    ```

- Use custom widget to specify jsoneditor options
    ```python
    from django.contrib import admin
    from django.contrib.postgres.fields import JSONField

    from jsoneditor.forms import JSONEditor

    from .models import Book


    class TextJSONEditor(JSONEditor):
        jsoneditor_options = {
            "mode": "text"
        }


    @admin.register(Book)
    class BookModelAdmin(admin.ModelAdmin):
        formfield_overrides = {
            JSONField: {"widget": TextJSONEditor}
        }

    ```