Skip to main content

Python - AnyCall (core library)

This directory contains the AnyCall core library for Python (published as anycall-py). Call functions across Python services using Redis, with no .proto files, exposed ports, or extra service plumbing to maintain.

../example-consumer/ and ../example-supplier/.

Structure

  • src/anycall/ - AnyCall core library package
  • pyproject.toml - Package metadata and dependencies
  • TESTING.md - How to run the test suite

How to use

Install

# Using uv (recommended)
uv sync

# Or using pip
pip install -e .

Quick usage

  • Supplier: decorate methods with @supply, register the class, and start the server.
  • Consumer: create an AnyCall client and call the supplier method by name.
server = AnyCall.server(redis_uri)
server.register(SentimentAnalyzer())
server.start()

client = AnyCall.client(redis_uri)
sentiment = client.call("analyze-sentiment", request, Sentiment)

For details on how to use as a supplier or consumer, see USAGE.md.

Modules

lib

Core library implementing an RPC framework via Redis (Lists as queues). Uses the AnyCall factory class to create clients and servers:

  • AnyCall Client: Interface for invoking remote methods, blocking or not (client.aio). Serializes the request to JSON and publishes it to a Redis queue; every response comes back on the client's own queue, where a single reader hands it to the call waiting for it. Takes default CallOptions (timeout, queue-depth limit) in AnyCall.client(...), which a call's own CallOptions replace; closing it stops everything at once.

  • AnyCall Server: Listener that processes requests from Redis. Each registered method gets its own read loop, and taken requests run on a shared worker pool. Methods are discovered via the @supply decorator on registered classes. Each method's concurrency is optionally capped by @supply(max_concurrency=...) (default 1), with an optional server-wide cap via AnyCall.server(redis_uri, ServerOptions(max_concurrency=...)).

example-consumer

Client application demonstrating the use of AnyCallClient. Makes one call to the analyze-sentiment method and logs the response.

example-supplier

Server application that registers suppliers via AnyCall.server(). The SentimentAnalyzer class contains an analyze_sentiment method decorated with @supply("analyze-sentiment"), which handles sentiment analysis. Starts listeners for each registered method.

Metadata

Release files for anycall-py 0.10.0

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

Source distribution (sdist)

Source distribution for anycall-py 0.10.0
File Size Uploaded Provenance Actions
anycall_py-0.10.0.tar.gz 38.6 kB Without provenance Details for anycall_py-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anycall-py 0.10.0
File Interpreter ABI Platform Actions
anycall_py-0.10.0-py3-none-any.whl Python 3 none any Details for anycall_py-0.10.0-py3-none-any.whl

Total release size: 84.9 kB

Release files / anycall_py-0.10.0.tar.gz

Download URL anycall_py-0.10.0.tar.gz
Size 38.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fcc71d2960393788d1601425acd55c3f472b2a2cf993f140c086be654d756f06
BLAKE2b-256 checksum
How to use checksums
9a6a000320924976c00eb970d3dca638930ff8759778e8439a39df9c101f29fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / anycall_py-0.10.0-py3-none-any.whl

Download URL anycall_py-0.10.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6aa39276d14d0937b43045874a81cd6a66a4d3a7dc46a3ff372089ecf6422c1
BLAKE2b-256 checksum
How to use checksums
33294ea7d1613ea15c27f45f38f9c0e9da57dbe59d0b1d05d9bbc0da54e418a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for anycall-py 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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