python-dependency-injector/examples/demo/example.py

24 lines
316 B
Python
Raw Normal View History

2020-08-14 22:45:30 +03:00
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()
2020-08-15 18:01:58 +03:00
2020-09-21 23:46:02 +03:00
def main() -> None:
2020-08-15 18:01:58 +03:00
service = Service()
2020-09-21 23:46:02 +03:00
...
if __name__ == '__main__':
main()