engin 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- engin/__init__.py +2 -0
- engin/_engin.py +0 -4
- engin-0.0.2.dist-info/METADATA +56 -0
- {engin-0.0.1.dist-info → engin-0.0.2.dist-info}/RECORD +6 -6
- {engin-0.0.1.dist-info → engin-0.0.2.dist-info}/WHEEL +1 -1
- engin-0.0.1.dist-info/METADATA +0 -5
- {engin-0.0.1.dist-info → engin-0.0.2.dist-info}/licenses/LICENSE +0 -0
engin/__init__.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
from engin import ext
|
1
2
|
from engin._assembler import Assembler
|
2
3
|
from engin._block import Block, invoke, provide
|
3
4
|
from engin._dependency import Entrypoint, Invoke, Provide, Supply
|
@@ -16,6 +17,7 @@ __all__ = [
|
|
16
17
|
"Option",
|
17
18
|
"Provide",
|
18
19
|
"Supply",
|
20
|
+
"ext",
|
19
21
|
"invoke",
|
20
22
|
"provide",
|
21
23
|
]
|
engin/_engin.py
CHANGED
@@ -35,13 +35,9 @@ class Engin:
|
|
35
35
|
async def run(self):
|
36
36
|
await self.start()
|
37
37
|
|
38
|
-
# lifecycle startup
|
39
|
-
|
40
38
|
# wait till stop signal recieved
|
41
39
|
await self._stop_event.wait()
|
42
40
|
|
43
|
-
# lifecycle shutdown
|
44
|
-
|
45
41
|
async def start(self) -> None:
|
46
42
|
LOG.info("starting engin")
|
47
43
|
assembled_invocations: list[AssembledDependency] = [
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: engin
|
3
|
+
Version: 0.0.2
|
4
|
+
Summary: An async-first modular application framework
|
5
|
+
License-File: LICENSE
|
6
|
+
Requires-Python: >=3.10
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
|
9
|
+
# Engin 🏎️
|
10
|
+
|
11
|
+
Engin is a zero-dependency application framework for modern Python.
|
12
|
+
|
13
|
+
## Features ✨
|
14
|
+
|
15
|
+
- **Lightweight**: Engin has no dependencies.
|
16
|
+
- **Async First**: Engin provides first-class support for applications.
|
17
|
+
- **Dependency Injection**: Engin promotes a modular decoupled architecture in your application.
|
18
|
+
- **Lifecycle Management**: Engin provides an simple, portable approach for implememting
|
19
|
+
startup and shutdown tasks.
|
20
|
+
- **Ecosystem Compatability**: seamlessly integrate with frameworks such as FastAPI without
|
21
|
+
having to migrate your dependencies.
|
22
|
+
- **Code Reuse**: Engin's modular components work great as packages and distributions. Allowing
|
23
|
+
low boiler-plate code reuse within your Organisation.
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Engin is available on PyPI, install using your favourite dependency manager:
|
28
|
+
|
29
|
+
- **pip**:`pip install engin`
|
30
|
+
- **poetry**: `poetry add engin`
|
31
|
+
- **uv**: `uv add engin`
|
32
|
+
|
33
|
+
## Getting Started
|
34
|
+
|
35
|
+
A minimal example:
|
36
|
+
|
37
|
+
```python
|
38
|
+
import asyncio
|
39
|
+
|
40
|
+
from httpx import AsyncClient
|
41
|
+
|
42
|
+
from engin import Engin, Invoke, Provide
|
43
|
+
|
44
|
+
|
45
|
+
def httpx_client() -> AsyncClient:
|
46
|
+
return AsyncClient()
|
47
|
+
|
48
|
+
|
49
|
+
async def main(http_client: AsyncClient) -> None:
|
50
|
+
print(await http_client.get("https://httpbin.org/get"))
|
51
|
+
|
52
|
+
engin = Engin(Provide(httpx_client), Invoke(main))
|
53
|
+
|
54
|
+
asyncio.run(engin.run())
|
55
|
+
```
|
56
|
+
|
@@ -1,8 +1,8 @@
|
|
1
|
-
engin/__init__.py,sha256=
|
1
|
+
engin/__init__.py,sha256=AIE9wnwvfXwS1mwp6Sa9xtatBYyYzhWa36GKfAkEx_M,508
|
2
2
|
engin/_assembler.py,sha256=Py159y4HvI54QuDcmbjL2kfXtbucYDE2KFBOgoC4qCM,5243
|
3
3
|
engin/_block.py,sha256=XrGMFEeps_rvOGsYTlsefUkJGAY6jqdp71G8jE9FbwU,1109
|
4
4
|
engin/_dependency.py,sha256=cL1qQFKDt7Rgg7mx8IXVkCZlUigg5cvhPFF9g2LNrgg,4749
|
5
|
-
engin/_engin.py,sha256=
|
5
|
+
engin/_engin.py,sha256=KHjtncm0bG_N4sAFt7haxUBMeuLp0zP8Bxpftp7Zgy8,3109
|
6
6
|
engin/_exceptions.py,sha256=nkzTqxrW5nkcNgFDGoZ2TBtnHtO2RLk0qghM5LNAEmU,542
|
7
7
|
engin/_lifecycle.py,sha256=0hk24fiwaBos5kaZrnG_Qm0VmUhWKnGtwYCjc007XDk,729
|
8
8
|
engin/_type_utils.py,sha256=naEk-lknC3Fdsd4jiP4YZAxjX3KXZN0MhFde9EV-Fmo,1835
|
@@ -10,7 +10,7 @@ engin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
engin/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
engin/ext/asgi.py,sha256=7viV6YgEwa0KatypDUrEYZT3YIQ3URQbzfVTGG7OuZE,1931
|
12
12
|
engin/ext/fastapi.py,sha256=vf7eB5no6eVuZyYdJZdvDYZmjJAmoKbrKhskgiSWg5g,1005
|
13
|
-
engin-0.0.
|
14
|
-
engin-0.0.
|
15
|
-
engin-0.0.
|
16
|
-
engin-0.0.
|
13
|
+
engin-0.0.2.dist-info/METADATA,sha256=CxEA114Eb2DF_voKUqPITeZiU1KWfSZaqvzIVNXaUAw,1491
|
14
|
+
engin-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
engin-0.0.2.dist-info/licenses/LICENSE,sha256=XHh5LPUPKZWTBqBv2xxN2RU7D59nHoiJGb5RIt8f45w,1070
|
16
|
+
engin-0.0.2.dist-info/RECORD,,
|
engin-0.0.1.dist-info/METADATA
DELETED
File without changes
|