Skip to main content

A tool for creating and managing loader projects

Project description

Talos Loader

一个用于创建和管理 Talos 加载器项目的工具。

安装

使用以下命令安装:

pip install talos-loader

使用方法

初始化新项目

talos-loader init

这将启动交互式向导,引导您创建一个新的加载器项目。您需要提供:

  • 项目路径(默认为 ~/Downloads)
  • 项目名称

执行后,将创建以下目录结构:

my_project_name/
├── README.md                # 项目说明文档
├── pyproject.toml           # 项目配置文件(Poetry配置)
├── poetry.toml              # Poetry虚拟环境配置
├── dry_run.py               # 用于测试加载器的脚本
├── my_project_name/         # 主项目目录
│   ├── __init__.py          # 包初始化文件
│   └── loaders/             # 加载器模块目录
│       ├── __init__.py      # 加载器包初始化文件
│       └── my_custom_loaders.py  # 自定义加载器实现

项目初始化后的使用

项目创建完成后,您可以进入项目目录并安装依赖:

cd my_project_name
poetry install --no-root

然后,您可以开始开发自定义加载器。加载器模板已经包含了基本的结构,您只需要实现 load 方法即可。

测试加载器

项目中包含了一个 dry_run.py 文件,您可以用它来测试您的加载器:

python dry_run.py

开发

依赖

  • Python 3.10+
  • click
  • inquirer
  • jinja2
  • pydantic
  • talos-aclient

自定义加载器开发

my_project_name/loaders/my_custom_loaders.py 文件中,您可以看到一个基本的加载器模板:

from talos_loader import TalosLoader, Block, ContentType

class MyCustomLoader(TalosLoader):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def load(self, context) -> list[Block]:
        """Execute the custom operation"""
        return []

您需要实现 load 方法,根据您的需求处理输入并返回适当的 Block 列表。

许可证

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

talos_loader-0.0.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

talos_loader-0.0.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file talos_loader-0.0.3.tar.gz.

File metadata

  • Download URL: talos_loader-0.0.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for talos_loader-0.0.3.tar.gz
Algorithm Hash digest
SHA256 87ffd7282782e6ec5dbe2705c54a7046f516cf4620bb7036f9b3a6305a221095
MD5 869bfa6fee29632679ee2156d164d7a4
BLAKE2b-256 7975c3f8ec7cfc4efab0617cfc5fb4f1ccd06d4bb5aef1c88482308d985bc410

See more details on using hashes here.

File details

Details for the file talos_loader-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: talos_loader-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for talos_loader-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d0dff877a11280f9495f956aee514324ff6f6d4980c9e586c1dfdd81b33373b
MD5 668f0bd731ab96cb69a535e10a84d9f8
BLAKE2b-256 d3059d2216f6810540c627912846e048a2b9474ae90427a5c1b2089c3e1b9c40

See more details on using hashes here.

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