# Pyro - Python Remote Objects - 4.82

## What is Pyro?

It is a library that enables you to build applications in which objects can talk to each other over the network, with minimal programming effort. You can just use normal Python method calls to call objects on other machines. Pyro is a pure Python library and runs on many different platforms and Python versions.

Pyro is copyright © Irmen de Jong (irmen@razorvine.net | http://www.razorvine.net). Please read Software License and Disclaimer.

It’s on Pypi as Pyro4. Source on Github: https://github.com/irmen/Pyro4 and version 5 as Pyro5 (Source)

Pyro4 is considered feature complete and new development is frozen. Only very important bug fixes (such as security issues) will still be made to Pyro4. New development, improvements and new features will only be available in its successor Pyro5 . New code should use Pyro5 unless a feature of Pyro4 is strictly required. Older code should consider migrating to Pyro5. It provides a (simple) backwards compatibility api layer to make the porting easier.

Contents of this manual:

- Intro and Example
  - About Pyro: feature overview
  - What can you use Pyro for?
  - Simple Example
  - Performance
- Installing Pyro
  - Pyro5
  - Compatibility
  - Obtaining and installing Pyro
  - Third party libraries that Pyro4 uses
  - Stuff you get extra in the source distribution archive and not with packaged versions
- Tutorial
  - Warm-up
  - Pyro concepts and tools
  - Building a Warehouse
  - Building a Stock market simulator
  - Other means of creating connections
  - Ok, what’s next?
- Command line tools
  - Test echo server
  - Configuration check
- Clients: Calling remote objects
  - Object discovery
  - Calling methods
  - Accessing remote attributes
  - Serialization
  - Proxies, connections, threads and cleaning up
  - Oneway calls
  - Batched calls
  - Remote iterators/generators
  - Asynchronous (‘future’) remote calls & call chains
  - Pyro Callbacks
  - Miscellaneous features
- Servers: hosting Pyro objects
  - Creating a Pyro class and exposing its methods and properties
  - Exposing classes and methods without changing existing source code
  - Pyro Daemon: publishing Pyro objects
  - Controlling Instance modes and Instance creation
  - Autoproxying
  - Server types and Concurrency model
  - Serialization
  - Other features
- Name Server
  - Starting the Name Server
  - Starting the Name Server from within your own code
  - Configuration items
  - Name server control tool
  - Locating the Name Server and using it in your code
  - The PYRONAME protocol type
  - The PYROMETA protocol type
  - Resolving object names
  - Registering object names
  - Free connections to the NS quickly
  - Using the name server with pickle, cloudpickle or dill serializers
  - Yellow-pages ability of the Name Server (metadata tags)
  - Other methods in the Name Server API
- Security
  - Pickle, cloudpickle and dill as serialization formats (optional)
  - Network interface binding
  - Running Pyro servers with different credentials/user id
  - Secure communication via SSL/TLS
  - Dotted names (object traversal)
  - Environment variables overriding config items
  - Preventing arbitrary connections
- Exceptions and remote tracebacks
  - Pyro exceptions
  - Remote exceptions
  - Detailed traceback information
- Flame: Foreign Location Automatic Module Exposer
  - Enabling Flame
  - Command line server
  - Flame object and examples
- Tips & Tricks
  - Best practices
  - Logging
  - Multiple network interfaces
  - Same major Python version required when using pickle, cloudpickle, dill or marshal
  - Wire protocol version
  - Asynchronous (‘future’) normal function calls
  - DNS setup
  - Pyro behind a NAT router/firewall
  - ‘Failed to locate the nameserver’ or ‘Connection refused’ error, what now?
  - Binary data transfer / file transfer
  - MSG_WAITALL socket option
  - IPV6 support
  - Pyro and Numpy
  - Pyro via HTTP and JSON
  - Client information on the current_context, correlation id
  - Automatically freeing resources when client connection gets closed
  - Message annotations
  - Connection handshake
  - Efficient dispatchers or gateways that don’t de/reserialize messages
  - Hooking onto existing connected sockets such as from socketpair()
- Configuring Pyro
  - Resetting the config to default values
  - Inspecting current config
  - Overview of Config Items
- Pyro4 library API
  - `Pyro4` — Main API package
  - `Pyro4.core` — core Pyro logic
  - `Pyro4.naming` — Pyro name server
  - `Pyro4.util` — Utilities and serializers
  - `Pyro4.socketutil` — Socket related utilities
  - `Pyro4.message` — Pyro wire protocol message
  - `Pyro4.constants` — Constant value definitions
  - `Pyro4.config` — Configuration items
  - `Pyro4.errors` — Exception classes
  - `Pyro4.test.echoserver` — Built-in echo server for testing purposes
  - `Pyro4.utils.flame` — Foreign Location Automatic Module Exposer
  - `Pyro4.futures` — asynchronous calls
  - Socket server API contract
- Running on alternative Python implementations
  - IronPython
  - Pypy
- Pyrolite - client library for Java and .NET
- Change Log
- Software License and Disclaimer

### Indices and tables

- Index

- Search Page