Documentation coming in version 0.1.4
Features
- Easy to use with object oriented syntax.
- Intellisense support with typehints and docstrings.
- High flexibility with configuration options.
- Supports newer versions of Python.
- Self explanatory error messages.
Upcoming features
- Enhanced docstrings
- Documentation
- Proxys
- CLI
Installation
To install hoist, run one of these commands, depending on your OS.
Linux/Mac
python3 -m pip install -U hoist3
Windows
py -3 -m pip install -U hoist3
Credits
This project was developed by ZeroIntensity, under the MIT License.
Dependencies
Examples
Basic Server Example
# file1.py
import hoist
client = hoist.Client()
server = client.create_server('localhost', 5000)
@server.received('hi')
def receive(message):
return 'Hello!'
@server.received()
def catch_all(message):
print(f'{message} was received.')
# file2.py
import hoist
client = hoist.Client()
server = client.find_server('localhost', 5000)
resp = server.send('hi')
server.send('test') # Prints out "test was received" in file1
print(resp) # Prints out "Hello!"
Basic API Example
# file1.py
import hoist
client = hoist.Client()
server = client.create_server('localhost', 6000)
schema: dict = {
'hello': 'hi',
'hi': 'hello',
'message', 'response'
}
server.add_auto_return(schema)
@server.received()
def not_found(message):
return hoist.Error('not found', 404)
# file2.py
import hoist
client = hoist.Client()
server = client.find_server('localhost', 6000)
resp = server.send('hi')
print(resp) # prints out "hello"
resp_2 = server.send('a') # raises "hoist.ServerResponseError"