Skip to main content

Yet another yaml runner.

Project description

Chamallow

...

Install

...

Local Usage Only

...

(venv)$ pip install chamallow

Distributed Usage

...

(venv)$ pip install chamallow[zmq]

Func Dispatching

...

From YAML

...

# funcs.py
def ping(a, k=None):
    return f"{a} and {k}"


def pong(a):
    print(a)

...

# demo.yml
ping:
  name: "funcs.ping"
  args:
    - "foo"
  kwargs:
    k: "bar"
  tags:
    - "foo"
pong:
  name: "funcs.pong"
  args:
    - _from: "ping"

...

(venv)$ CHAMALLOW_TAGS=foo chamallow demo.yml
foo and bar

With Decorators

...

# demo.py
from chamallow import engine, flow

@flow(tags=("foo",))
def ping(a, k=None):
    return f"{a} and {k}"


@flow()
def pong(a):
    print(a)
    return True


if __name__ == "__main__":
    engine.start()
    assert pong(ping("foo", k="bar")).result() is True
    engine.stop()

...

(venv)$ CHAMALLOW_TAGS=foo python demo.py
foo and bar

Hacking

...

CLI

...

(venv)$ chamallow

Docker

...

$ docker-compose up -d
$ docker-compose exec chamallow bash -c "chamallow examples/simple.yml"
$ docker-compose exec chamallow-client bash -c "cat simple.csv simple.json"
foo;bar
xxx;YYY
{
  "foo": "xxx",
  "bar": "YYY"
}

Settings

  • ADDRESS
  • CACHE_TTL
  • CONNECT_PORT
  • DEBUG
  • LOCAL
  • LOG_FORMAT
  • POLLING_INTERVAL
  • NUMBER_OF_CLIENTS
  • NUMBER_OF_REMOTE_CLIENTS
  • TAGS

Contributing

...

Linting

...

(venv)$ pip install chamallow[lint]
(venv)$ pre-commit run --all-files

Testing

...

(venv)$ pip install chamallow[test]
(venv)$ CHAMALLOW_LOCAL=True pytest tests/

License

MIT

Project details


Download files

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

Source Distribution

chamallow-0.1.1.tar.gz (13.2 kB view hashes)

Uploaded Source

Supported by

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