python-dependency-injector/examples/demo/example.py
2020-09-21 16:46:02 -04:00

24 lines
316 B
Python

import os
class ApiClient:
def __init__(self):
self.api_key = os.getenv('API_KEY')
self.timeout = os.getenv('TIMEOUT')
class Service:
def __init__(self):
self.api_client = ApiClient()
def main() -> None:
service = Service()
...
if __name__ == '__main__':
main()