Skip to main content

PyPI

🌀 Portal

Fast and reliable distributed systems in Python.

Features

  • 📡 Communication: Portal lets you bind functions to a Server and call them from one or more Clients. Wait on results via Future objects. Clients can automatically restore broken connections.
  • 🚀 Performance: Optimized for throughput and latency. Array data is zero-copy serialized and deserialized for throughput near the hardware limit.
  • 🤸 Flexibility: Function inputs and outputs can be nested dicts and lists of numbers, strings, bytes, None values, and Numpy arrays. Bytes allow applications to chose their own serialization, such as pickle.
  • 🚨 Error handlings: Provides Process and Thread objects that can reliably be killed by the parent. Unhandled exceptions in threads stop the program. Error files can be used to stop distributed systems.
  • 📦 Request batching: Use BatchServer to collect multiple incoming requests and process them at once, for example for AI inference servers. Batching and dispatching happens in a separate process to free the GIL.
  • ✅ Correctness: Covered by over 100 unit tests for common usage and edge cases and used for large scale distributed AI systems.

Installation

pip install portal

Example

This example runs the server and client in the same Python program using subprocesses, but they could also be separate Python scripts running on different machines.

def server():
  import portal
  server = portal.Server(2222)
  server.bind('add', lambda x, y: x + y)
  server.bind('greet', lambda msg: print('Message from client:', msg))
  server.start()

def client():
  import portal
  client = portal.Client('localhost:2222')
  future = client.add(12, 42)
  result = future.result()
  print(result)  # 54
  client.greet('Hello World')

if __name__ == '__main__':
  import portal
  server_proc = portal.Process(server, start=True)
  client_proc = portal.Process(client, start=True)
  client_proc.join()
  server_proc.kill()
  print('Done')

Questions

Please open a separate GitHub issue for each question.

Release files for portal 3.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for portal 3.8.1
File Size Uploaded
portal-3.8.1.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for portal 3.8.1
File Interpreter ABI Platform
portal-3.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 kB

Release files / portal-3.8.1.tar.gz

Download URL portal-3.8.1.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8abf9620f0772272b7e970ffc8ceccae2f282660f5023eeba9a58dbb2d75d2f8
BLAKE2b-256 checksum
How to use checksums
ad5afa3c88a87780d0f9f1ecf643724796cdbf2e217d9600ce7c7738f567b761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / portal-3.8.1-py3-none-any.whl

Download URL portal-3.8.1-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b7417824125fe8a32a20ee1bee9cb0252c83daccfeda58248fd43bca448a435
BLAKE2b-256 checksum
How to use checksums
cf019f1ca5ff9a72154d0f64c37489d5e5f2ea3d94b44af3ba91c8a312b728c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

3.8.1 This release

2 release files

3.8.0

2 release files

3.7.4

2 release files

3.7.3

1 release file

3.7.2

1 release file

3.7.1

1 release file

3.7.0

1 release file

3.6.0

1 release file

3.5.1

1 release file

3.5.0

1 release file

3.4.4

1 release file

3.4.3

1 release file

3.4.2

1 release file

3.4.1

1 release file

3.4.0

1 release file

3.2.4

1 release file

3.2.3

1 release file

3.2.2

1 release file

3.2.1

1 release file

3.2.0

1 release file

3.1.12

1 release file

3.1.11

1 release file

3.1.10

1 release file

3.1.9

1 release file

3.1.8

1 release file

3.1.7

1 release file

3.1.6

1 release file

3.1.5

1 release file

3.1.4

1 release file

3.1.3

1 release file

3.1.2

1 release file

3.1.1

1 release file

3.1.0

1 release file

3.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page