semvec/pypi-packages huggingface dataset:
swift_rpc 2.5
tornado rpc
License: MIT
Keywords: tornado,fengyun

# swift_rpc

swift_rpc是用tornado实现的rpc服务,现在开放了四个调度接口:  

[更多的关于swift的开发信息](http://xiaorui.cc)

1. register 普通接口调用模式,最纯粹最简单    
2. register_async 借助于tornado gen.coroutine实现的非堵塞调用  
3. register_pool  借助于futures.ThreadPoolExecutor实现线程池  
4. register_mq 通过mq异步调用方法，适合后端长时间运算或耗时的调用

Change Log:  

Version: 2.1  
1. 解决Nginx针对RPC负载均衡时，无法正常获取remote_ip

Version: 2.2  
1. rq enqueue塞入任务队列时的一个bug,已经绕过解决

Version: 2.3  
1. 解决了curl调用rq的get_result时出现的0x80 code异常

Version: 2.4  
1. 日志及加密模式

Version: 2.5   
1. 加入自定义的AES加密算法支持

Future:  
1. 统一配置配置文件  
2. 使用rsa保证rpc通信安全  
3. swift_rpc完善RQ异步任务队列  
4. 增加request json body的识别,在这基础上做安全的封装


测试json body的args,kwargs:  
```
curl -H "Content-Type: application/json" -H "User-Agent: swift_rpc" -X GET -d '{"args":"[123,456]","kwargs":{"name":1}}' http://localhost:8080/test_args
curl -H "Content-Type: application/json" -H "User-Agent: swift_rpc" -X GET -d '{"args":"123"}' http://localhost:8080/test
```

测试选择加密模式:  
```
curl -H "Encryption: base64" -H "Content-Type: application/json" -H "User-Agent: swift_rpc" -X GET -d '{"args": [123, 456], "kwargs": {"name": 1}}'  http://localhost:8080/test_args
```

测试arguments的args,kwargs:  
```
curl -H "User-Agent: swift_rpc" -X GET -d "args=123" http://localhost:8080/test
```

Tornado RPC Server Usage:

```
#coding:utf-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8") 

import time
from tornado import gen
from swift_rpc.server import RPCServer
from swift_rpc.mq import rq_conn
from swift_rpc.mq import redis_conn
from swift_rpc.mq import fetch
from config import *
from api import *

def test(args):
    return "this is test %s"%(args)

def test_args(a,b,name='xiaorui.cc'):
    print a,b,name
    return "this is test %s %s"%(a,name)

def get_result(job_id):
    return redis_conn.hgetall(job_id)

def test_block(args):
    time.sleep(5)
    return "You said "

@gen.coroutine
def test_async(arg):
    return gen.Return("this is test_async async %s" % arg)

if __name__ == "__main__":
    server = RPCServer()
    server.register(test)
    server.register(test_args)
    server.register(get_result)
    server.register_async(test_async)
    server.register_pool(test_block)
    server.register_mq(test_mq)
    server.register_mq(go)
    server.start(RPC_HOST,RPC_PORT)
```

swift_rpc client Usage:

```
from swift_rpc.client import RPCClient

client = RPCClient('localhost:8080')
print client.test('hi')
print client.test_args('welcome','xiaorui.cc',name='nima')
```
Flask-Styleguide 0.4.0
A living Styleguide for your Flask application.
License: MIT
Keywords: flask live styleguide

Flask-Styleguide
================

Extension provides an easy way to automatically generate living styleguide
for your application from `KSS documentation <http://warpspire.com/kss/>`_
format.

What is KSS
-----------

KSS is a documentation for humans. It's human readable, machine parsable, and
easy to remember. `Learn the syntax in less then 5 minutes
<http://warpspire.com/kss/>`_.

Contributing
------------

Don't hesitate to create a `GitHub issue
<https://github.com/vitalk/flask-styleguide/issues>`_ for any **bug** or
**suggestion**.

Links
-----

* Documentation: http://flask-styleguide.readthedocs.org
* GitHub: https://github.com/vitalk/flask-styleguide
* PyPI: https://pypi.python.org/pypi/flask-styleguide
* Example: https://vitalk.github.io/flask-styleguide-example
pyuploadcare-wtforms 0.5
Custom fields for working with Uploadcare service.
License: MIT
Keywords: pyuploadcare wtforms

Pyuploadcare-wtforms
=======================

.. image:: https://img.shields.io/pypi/v/pyuploadcare-wtforms.svg
    :target: https://pypi.python.org/pypi/pyuploadcare-wtforms
    :alt: Latest PyPI version

.. image:: https://travis-ci.org/uploadcare/pyuploadcare-wtforms.svg?branch=master
    :target: https://travis-ci.org/uploadcare/pyuploadcare-wtforms
    :alt: Build status


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

.. code:: bash

    $ pip install pyuploadcare-wtforms

Usage
-----

Package provides several fields for ``WTForms`` which made integration with Uploadcare little more easily:

* ``FileWidget``
* ``FileField``
* ``ImageField`` - you can set manual cropping for uploaded images
* ``FileGroupField``

In common case for usage you need:

* Use one of these fields in your form like this:

.. code:: python

    # your_app/forms.py

    from wtforms import Form
    from pyuploadcare_wtforms import ImageField

    class YourSuperForm(Form):
        image = ImageField(manual_crop='200x200')
        ...

* Set up keys:

.. code:: python

    # your_project_config.py
    from pyuploadcare import conf

    conf.pub_key = 'demopublickey'
    conf.secret = 'demoprivatekey'


* Put script to `your templates <https://uploadcare.com/quick_start/>`_:

.. code:: html

    <script src="https://ucarecdn.com/widget/2.5.5/uploadcare/uploadcare.full.min.js" charset="utf-8"></script>

Look at `that simplest example <https://github.com/uploadcare/pyuploadcare-wtforms/tree/master/example>`_ for getting quick start. You can easily install it locally by:

.. code:: bash

    $ make run_example

Contributing
------------

1. Fork the ``pyuploadcare-wtforms`` repo on GitHub.
2. Clone your fork locally:

.. code:: bash

    $ git clone git@github.com:your_name_here/pyuploadcare-wtforms.git

3. Install your local copy into a virtualenv. Assuming you have ``virtualenvwrapper`` installed, this is how you set up your fork for local development:

.. code:: bash

    $ mkvirtualenv pyuploadcare-wtforms
    $ cd pyuploadcare-wtforms/
    $ python setup.py develop

4. Create a branch for local development:

.. code:: bash

    $ git checkout -b name-of-your-bugfix-or-feature

   Now you can make your changes locally.

5. When you're done making changes, check that your changes pass the tests, including testing other Python versions with tox:

.. code:: bash

    $ pip install tox
    $ tox

6. Commit your changes and push your branch to GitHub:

.. code:: bash

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.