Skip to main content

Pancake Embed Plugin - 零 import 机制,通过 Dough 生命周期自动注入 builtins

Project description

Pancake Embed

零 import 插件 — 配合 DoughMeta 实现框架 API 自动注入

工作原理

  1. Embed 插件加载时(init_order=-10,最先执行),将装饰器注册到 muffin_flour
  2. 用户定义 Dough 子类时,DoughMeta 自动从 muffin_flour/muffin_water 注入已注册的名称到模块命名空间
  3. 用户代码无需 import 即可使用所有装饰器和基类
from pancake.dough import Dough

# 定义子类后,Singleton、Service、DoughFactory 等自动可用
@Singleton
class UserService(Service):
    async def on_init(self):
        self.db = DoughFactory.get().resolve("DatabaseService")

注册的名称

装饰器 (muffin_flour)

  • @Singleton / @Prototype / @Lazy — 作用域
  • @DoughDecorator — 标记类为 Bean
  • @DependsOn("A", "B") — 声明依赖
  • @Import(Cls) — 自动注册外部类
  • @Maker / @noMaker — 控制方法 Bean 注册
  • @inject — 自动注入依赖
  • @Config — 从配置注入字段

基类 (muffin_water)

  • Configuration — 配置类
  • Service — 服务类
  • Function — 方法类
  • Struct — 数据结构类
  • DoughFactory — Bean 工厂

安装

pip install pancake-embed

或在 pancake.xml 中添加:

<dependency>
    <groupId>io.pancake</groupId>
    <artifactId>embed</artifactId>
</dependency>

开源协议

MIT

Project details


Download files

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

Source Distribution

pancake_embed-0.1.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pancake_embed-0.1.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pancake_embed-0.1.2.tar.gz.

File metadata

  • Download URL: pancake_embed-0.1.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pancake_embed-0.1.2.tar.gz
Algorithm Hash digest
SHA256 342cc7a57317559a193fee6d11e9950173ba8cad9fd6d5b0d5d2f08fa9b714ee
MD5 6722cc448dae10a20a843d263915bbb8
BLAKE2b-256 892b1e5da3612b2b9bdfc2d07b40b055a6b2c058f81bfa76ed302e78debeed43

See more details on using hashes here.

Provenance

The following attestation bundles were made for pancake_embed-0.1.2.tar.gz:

Publisher: publish.yml on PancakeFramework/Pancake-Embed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pancake_embed-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pancake_embed-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pancake_embed-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1905ba52f37a1828de154fc8bc2ef467356e4bb0cf932ccb861e43427752b4f
MD5 cb4ef3bab5f3683943cc4ffd06d1b1c5
BLAKE2b-256 ae6ad9492748b655fa569bc862a3f5e5aaf973e3bdc0256f29455c0bcb593783

See more details on using hashes here.

Provenance

The following attestation bundles were made for pancake_embed-0.1.2-py3-none-any.whl:

Publisher: publish.yml on PancakeFramework/Pancake-Embed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page