EYWA & Python
#
EYWA Python Client#
InstallationTo communicate with EYWA from your Python script you can use eywa-reacher-client Python package. To install the client, run this command in your terminal:
pip install eywa-reacher-client
#
UsageThe main usage of this client is to execute queries and mutations on a certain EYWA instance. This is accomplished using the eywa.graphql()
function. Below is a simple example:
import eywa
query = """searchUser{ euuid name}"""
response = eywa.graphql({"query": query, "variables": {}})
#
Running a script via EYWA#
Setting up the environmentTo set an environment for running scripts via EYWA use this command:
eywa env
After running this command, you will be prompted to enter url of an EYWA instance (e.x. https://example.eywaonline.com), username and password. Username and password must be of an existing EYWA user on the aforementioned EYWA instance. If everything went OK, environment for running scripts via EYWA is now successfully set up.
#
UsageTo run a script use the eywa run
command. Command (or commands) which execute the script are specified using the -c flag. Below is an example:
eywa run -c "py script.py"
eywa run
With eywa run command you can run scripts no matter the programming language. It does not need to be Python. Just use the appropriate commands for the language under the -c flag.