Metadata-Version: 2.1
Name: quackquack
Version: 1.0.5
Summary: Quack Quack: A simple application framework
Home-page: https://github.com/socek/quackquack
License: MIT
Author: Dominik Dlugajczyk
Author-email: msocek@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: alembic
Provides-Extra: celery
Provides-Extra: developer
Provides-Extra: pyramid
Provides-Extra: redis
Provides-Extra: sqlalchemy
Requires-Dist: alembic (>=1.0.9,<2.0.0); extra == "alembic" or extra == "developer"
Requires-Dist: celery (>=5.0.0,<6.0.0); extra == "celery" or extra == "developer"
Requires-Dist: marshmallow_dataclass (>=8.0.0,<9.0.0)
Requires-Dist: pyramid (>=1.10.4,<2.0.0); extra == "pyramid" or extra == "developer"
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: redis (>=3.2.1,<4.0.0); extra == "redis" or extra == "developer"
Requires-Dist: sqlalchemy (>=1.3.3,<2.0.0); extra == "sqlalchemy" or extra == "developer"
Description-Content-Type: text/x-rst

About
=====

`Documentation <https://qqpy.org/>`_


Overview
--------

This project aims to resolve problem of configuring an application, which needs to
have initialization step (for example: for gathering settings or establishing
connections) and use Python style code (context managers and decorators) to get
those data.

For example, normally you would need to use two separate mechanism for settings
in celery application and web application, because you should not use web
application startup process in the celery app. This package provide a solution
for this problem, by giving one simple and independent of other frameworks
mechanism to implement everywhere.

Quick Using Example
-------------------

To use Quack Quack you need to create the application class (inherited from
``qq.Application``\ ) in which you need to add plugins. After configuring, you need to "start"
the application. After that you can use the configurator as context manager.

.. code-block:: python

    from qq import Application, Context, InjectApplication, SimpleInjector
    from qq.plugins import SettingsPlugin
    from qq.plugins.types import Settings

    class MyApplication(Application):
        def create_plugins(self):
            self.plugins["settings"] = SettingsPlugin('settings')

    application = MyApplication()
    application.start('application')

    with Context(application) as ctx:
        print(ctx["settings"])

    @InjectApplication(application)
    def samplefun(settings: Settings = SimpleInjector("settings")):
        print(settings)



``context.settings`` in above example is variable made by the SettingsPlugin.
If you would like to know more, please go to the `Tutorial <https://qqpy.org/docs/tutorial.html>`_

Installation
------------

.. code-block:: bash

   pip install quackquack

