Skip to main content

The native experience of calling remote functions, like local ones.

Project description

Airmise

Expose local runtime namespace to local network area. Others who have access to the network can call functions, instantiate classes, use variables, import modules etc.

How to use

Access variables

# server.py
import airmise as air
a = 'alpha'
b = []
air.run_server(globals(), port=...)
# client.py
import airmise as air
air.connect(host=..., port=...)
c = air.exec(
    '''
    print(a)
    print(b)
    b.append(a)
    return b
    '''
)
print(c)  # -> ['alpha']

Call functions

# server.py
import airmise as air

def foo(bar):
    print(bar)
    return 'ok'
    
air.run_server(globals(), port=...)
# client.py
import airmise as air
air.connect(host=..., port=...)
air.exec("return foo('bar')")

Iterator

# server.py
import airmise as air

def foo(count: int):
    for i in range(count):
        yield i
    
air.run_server(globals(), port=...)
# client.py
import airmise as air
air.connect(host=..., port=...)
for i in air.call('foo', 10):
    print(i)

Share codebase

Server and client can use the same code base, but with different if __name__ == '__main__':

# server.py
import airmise as air

class Bar:
    def __init__(self, name: str):
        self.name = name
    def baz(self):
        return f'{self.name} 123'  

if __name__ == '__main__':
    air.register(Bar)
    air.run_server(port=...)
# client.py
import airmise as air

class Bar:
    def __init__(self, name: str):
        self.name = name
    def baz(self):
        return f'{self.name} 123'  

if __name__ == '__main__':
    remote_bar = air.delegate(Bar, 'Alice')
    print(remote_bar)  # -> <airmise.RemoteCall>
    print(remote_bar.baz())  # -> 'Alice 123'

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airmise-3.0.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file airmise-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: airmise-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for airmise-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 521d8753910ecabb01e9ad6a206906501fe886f39fd4db34ffc5845d428c1932
MD5 c2b7dd9450a8bf1a559e158f7b84e29a
BLAKE2b-256 2b39e45ae42593797d5d5fc9d27286e80fd9ed972f3f9c50ea4e268cd11dd873

See more details on using hashes here.

Supported by

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