Skip to main content

Asyncio feature-toggle utility

Project description

Python/Asyncio Feature Toggle

Note: tested only on Python version 3.6+

Supported clients

  • Unleash

Installation:

pip install toggler

Usage with aiohttp

from aiohttp import web
import toggler


async def handle(request):
    enabled = await request.app['feature'].is_enabled('MY_FEATURE', False)
    return web.Response(text=f'Feature is {"enabled" if enabled else "disabled"}')


def main():
    app = web.Application()
    app.add_routes([web.get('/', handle)])

    toggler.unleash_setup(
        app=app,
        unleash_host='<UNLEASH_HOST>',
        cache=toggler.RedisCache('<REDIS_CONNECTION_STRING>')
    )

    return app


if __name__ == '__main__':
    web.run_app(main())

Available Feature Toggle solutions

Unleash

Project details


Download files

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

Files for toggler, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size toggler-0.0.6.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page