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'
Metadata
Release files for airmise 3.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airmise-3.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / airmise-3.2.2-py3-none-any.whl
| Download URL | airmise-3.2.2-py3-none-any.whl |
|---|---|
| Size | 31.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e440be5b8bab0d0255258b4d57f525101ce466ecb95262700ad7c00d295aecd
|
|
BLAKE2b-256 checksum How to use checksums |
bdb9b5fdc6e8d325b78261548c73fa987aa7606741d790a82250dca81572da58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|