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 details)

Uploaded Source

File details

Details for the file chamallow-0.1.1.tar.gz.

File metadata

  • Download URL: chamallow-0.1.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for chamallow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 16f87d879de853f5260c6721f04c8ac32e6de4610878b3d27b489d89779c1116
MD5 7253beefb4ac91db1acf3c665e6bda6e
BLAKE2b-256 89cc97c796d947fa2824f8e931b041a8cddbf2e275573ddcd8e5f98958fffed3

See more details on using hashes here.

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