Skip to main content

Flower service client

Project description

[![Build Status](https://travis-ci.org/puntonim/service-flower.svg?branch=master)](https://travis-ci.org/puntonim/service-flower)

# Flower service client

This package is service client for Flower API used to monitor Celery.

## Client usage

```python
# Configure settings.
import service_flower.conf
d = dict(
BASE_URL='https://inspire-qa-worker3-task1.cern.ch/api',
REQUEST_TIMEOUT=30,
HTTP_AUTH_USERNAME='user',
HTTP_AUTH_PASSWORD='pass',
)
service_flower.conf.settings.configure(**d)

# Use the client.
from service_flower.client import FlowerClient
client = FlowerClient()
response = client.get_workers(workername='celery@inspire-qa-worker3-task5.cern.ch')
response.raise_for_result()
queues = response.get_active_queues_names('celery@inspire-qa-worker3-task5.cern.ch')
```

## Development

```bash
# Create a venv and install the requirements:
$ make venv

# Run isort and lint:
$ make isort
$ make lint

# Run all the tests:
$ make test # tox against Python27 and Python36.
$ tox -e py27 # tox against a specific Python version.
$ pytest # pytest against the active venv.

# Run a specific test:
$ make test/tests/test_client.py # tox against Python27 and Python36.
$ tox -e py27 -- tests/test_client.py # tox against a specific Python version.
$ pytest tests/test_client.py # pytest against the active venv.
```

To publish on PyPi, first set the PyPi credentials:

```bash
# Edit .pypirc:
$ cat $HOME/.pypirc
[pypi]
username: myuser
password: mypass
```

```bash
# Edit the version in `setup_gen.py`.
# ... version=pep440_version('1.1.1'),
# Then generate setup.py with:
$ make setup.py
# Commit, tag, push:
$ git commit -m '1.1.1 release'
$ git tag 1.1.1
$ git push origin master --tags

# Finally publish:
$ make publish
```

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

service-flower-1.0.1.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file service-flower-1.0.1.tar.gz.

File metadata

  • Download URL: service-flower-1.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.10

File hashes

Hashes for service-flower-1.0.1.tar.gz
Algorithm Hash digest
SHA256 31c65d33a325d1e03b6a06de787580e786239aa982cc22974f13a290a6053166
MD5 39007cd1417c54930f4a0460dcf447c0
BLAKE2b-256 2aa38c40bfb17a6df781dcfd2d08e5ad91ad526f1cec52b55d05d29f8c6ce099

See more details on using hashes here.

Supported by

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