承接 isemary/sheet-cast 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

isemary/sheet-cast

最新稳定版本:v1.0.0

Composer 安装命令:

composer require isemary/sheet-cast

包简介

A CLI tool to import XML data to Google Sheets with FTP support

README 文档

README

Sheet Cast

About

Sheet Cast is a simple command line tool that reads XML files and sends the data to Google Sheets. It works with local files or files from FTP servers.

Features

  • XML Processing: Parse XML files with dynamic field extraction
  • FTP Integration: Fetch XML files from remote FTP servers
  • Google Sheets API: Push data directly to Google Spreadsheets
  • Comprehensive Logging: Detailed logging with Monolog
  • Error Handling: Robust error handling and recovery
  • Unit Testing: Complete test coverage with PHPUnit

Technologies

  • PHP 8.4
  • Symfony Console
  • PHPUnit

Packages Used

  • Google Sheets API
  • Monolog
  • vlucas/phpdotenv

Get Started

Installation

Install via Composer

# install in your project
composer require isemary/sheet-cast

Quick Start

After installation, you can use the command directly:

# If installed globally
sheet-cast app:import-spreadsheet --file=your-file.xml --limit=10

# If installed in project
./vendor/bin/sheet-cast app:import-spreadsheet --file=your-file.xml --limit=10

Environment Configuration

Create a .env file with your configuration:

# Application Settings
APP_NAME="Sheet Cast"
APP_VERSION="1.0.0"
APP_DEBUG=true

# Google Sheets API Configuration
GOOGLE_SHEETS_SPREADSHEET_ID=your_spreadsheet_id_here
GOOGLE_SHEETS_CREDENTIALS_PATH=config/google-credentials.json

# Logging
LOG_LEVEL=debug
LOG_FILE=logs/app.log

# FTP Configuration
FTP_HOST=your.ftp.server.com
FTP_USERNAME=your_username
FTP_PASSWORD=your_password
FTP_FILE=your_file.xml

Google Sheets Setup

  1. Create a Google Cloud Project

  2. Create Service Account

    • Go to "APIs & Services" > "Credentials"
    • Create a Service Account
    • Download the JSON credentials file
    • Place it in config/google-credentials.json
  3. Share Your Spreadsheet

    • Open your Google Spreadsheet
    • Click "Share"
    • Add the service account email (from the JSON file)
    • Grant "Editor" permissions

Basic Usage

# Process FTP XML file + Push to Google Sheets
sheet-cast app:import-spreadsheet --file=coffee_feed.xml --push-to-sheets --limit=100

# Process local XML file + Push to Google Sheets
sheet-cast app:import-spreadsheet --file=test_data.xml --push-to-sheets --limit=3

# Display data without pushing to sheets
sheet-cast app:import-spreadsheet --file=test_data.xml --limit=10

Testing

Run Tests

# Run all tests
./vendor/bin/phpunit

Docker

Build and Run

# Build the Docker image
docker build -t sheet-cast .

Logging Configuration

// Custom log levels
LOG_LEVEL=debug

// Custom log file
LOG_FILE=logs/custom.log

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-09-30