Skip to main content

puppetry with objects

Project description

Gitter Twitter

Remote objects, like puppet.

For a small project I need to communicate between two process. In one process I have a class which create an object. The other process should access the functions and variables of this object. The process play with the object like an puppetry.

Install

pip install puppetry

Basic usage

Example class:

class HelloWorld(object):

    def __init__(self, name=''):
        self.name = name

    def hello(self, name=None):
        if name: return 'Hello ' + name
        return 'Hello ' + self.name

Server:

from puppetry import RemoteServer

server = RemoteServer((HOST, PORT), obj=HelloWorld('world'))
server.start()

Client:

from puppetry import RemoteClient

client = RemoteClient((HOST, PORT))
print(client.hello())

client.name = 'puppetry'
print(client.hello())

See more examples in the example folder.

Development

Clone repo:

git clone https://github.com/axju/puppetry.git

Create virtual environment and update dev-tools:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade wheel pip setuptools twine tox

Install local:

pip install -e .

Publish the packages:

python setup.py sdist bdist_wheel
twine upload dist/*

Run some tests:

tox
python setup.py test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

puppetry-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

puppetry-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file puppetry-0.0.1.tar.gz.

File metadata

  • Download URL: puppetry-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.0

File hashes

Hashes for puppetry-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ff494a5bf045d716bfe2b4f81a60eae07ff792eb7d0fd6704864c0c525720f51
MD5 cd1b158cdff9885b0c61e64cc61efb0d
BLAKE2b-256 1de8ba6ce330e5f6266fa7969dadda705a3e14745a04b10402e74d0b4182e3c7

See more details on using hashes here.

File details

Details for the file puppetry-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: puppetry-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.0

File hashes

Hashes for puppetry-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 94f1dc4526398ef03a8241a38fff012accbb500d47ccd85f7217f36773718195
MD5 02dcf5a7d81b2769467ca5275bf90179
BLAKE2b-256 65b698edb0c53bc8df83cfa2393a23f13fb608a145ec81de3551168321606f74

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page