Skip to main content

No project description provided

Project description

Another simple ioc framework for python.

Usage

from anyioc import ServiceProvider
provider = ServiceProvider()
provider.register_singleton('the key', lambda x: 102) # x will be scoped ServiceProvider
value = provider.get('the key')
assert value == 102

Need global ServiceProvider ? try from anyioc.g import ioc.

There are some predefined key you can use direct, but you still can overwrite it:

  • ioc - get current scoped ServiceProvider instance.
  • provider - alias of ioc
  • service_provider - alias of ioc

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
anyioc-0.4.2-py3-none-any.whl (8.8 kB) Copy SHA256 hash SHA256 Wheel 3.7
anyioc-0.4.2.tar.gz (5.2 kB) Copy SHA256 hash SHA256 Source None

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page