semvec/pypi-packages huggingface dataset:
thinrpc 0.2.0
A Lightweight RPC framework for Python
License: MIT License

thinrpc: A Lightweight RPC Framework for Python
===

This library provides a base class and some decorators to make it easy to build distributed applications. RPC endpoints are defined as class methods and decorated with ```RpcModule.Method```, which registers the endpoint with the event-based RPC server dispatching requests to registered methods. 

The ```RpcRemote``` class is an abstraction allowing applications to invoke methods on remote nodes using method call syntax. See the example below for an illustration!

```python
'''
    Simple RPC server responding to invocations of the
    'hello' method with a pleasant greeting
'''
import sys

from thinrpc import RpcModule, RpcRemote, RpcApplication, OK

class FooNode(RpcApplication):

    def __init__(self, port, name):
        self.addr = ("localhost", port)
        self.name = name

        # Start the RPC server
        self.Start()

    @RpcModule.Method
    def hello(self, sender):
        return OK, "Hi, %s! It's %s" % (sender, self.name)

    
if __name__ == '__main__':
    node = FooNode(9090, "Anson")
```

And now for a simple client script that invokes the ```hello``` method on the server application defined above.

```python

import thinrpc
import sys

# Say hi to the server!
server = thinrpc.RpcRemote(("localhost", 9090))
print(server.hello())
#{'result': "Hi, ('127.0.0.1', 49440)! It's Anson", 'err': False}
```
NetStorageKit 1.0.8
Akamai's NetStorage API communication kit
License: MIT License

NetStorage communication Kit
============================
.. image:: https://img.shields.io/pypi/status/NetStorageKit.svg?style=flat-square
    :target: https://pypi.python.org/pypi/NetStorageKit

Usage
-----

The `tests <tests.py>`_ describe the usage thoroughly, but consider this upload
example.

.. code-block:: python

    import netstoragekit as ns

    # NetStorage connection information
    # The host part is prepended to -nsu.akamaihd.net, i.e. mycdn-nsu.akamaihd.net
    test = dict(key_name='abc', key='abcdefghijk1234'
                cpcode='12345', host='mycdn')

    # Create a Request instance
    request = ns.api.Request(test['key_name'], test['key'],
                             test['cpcode'], test['host'])

    remote_path = 'media/images/products/123.jpg'
    local_path = '/opt/data/products/123.jpg'

    # Upload the local path to the remote one (always relative to the CPCode)
    # The returned data is the XML returned by the API parsed as a python object
    # The response is the object as returned by the requests package
    data, response = request.upload(remote_path, local_path)

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

Development
~~~~~~~~~~~

.. code-block:: shell

    pip install autoenv
    pip install virtualenv
    virtualenv -p /usr/bin/python2.7.9 env
    source env/bin/activate
    python setup.py install
    # Run tests
    py.test tests.py

Production
~~~~~~~~~~

.. code:: shell

    pip install netstoragekit

.. _tests: tests.py