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.1.tar.gz (2.0 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.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pancake_embed-0.1.1.tar.gz
  • Upload date:
  • Size: 2.0 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.1.tar.gz
Algorithm Hash digest
SHA256 55a192295feece39eac1f281bbe2663e807ae492df81bb628698a6f73afe86e4
MD5 8119630f06142303970fd4684650b7d4
BLAKE2b-256 1f899f2585b208bbbd652ca093ad37d25edbc519c7dbfb465c04f89b88d500cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pancake_embed-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pancake_embed-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc2a22934bd5751198c42b26e5e893acefcd90d69efc24378c6d52b7a5cd1f3
MD5 794f4624720e794caccd2e9eb16558f7
BLAKE2b-256 ab01d487a05d95728aced51b455b4bb2d7dd96d5b83b486824322165643f19b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pancake_embed-0.1.1-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