stepupdream/spread-sheet-converter
Composer 安装命令:
composer require stepupdream/spread-sheet-converter
包简介
support package
关键字:
README 文档
README
Introduction
You can read the information in Google Sheets and convert it to a Yaml file.
It's hard to handwrite Yaml files, so it's perfect for people who want to manage with Google Spreadsheet.
You can freely change the character string and count of the header line of the Google Spreadsheet to be read.
The contents of the exported yaml file can be freely formatted with the Laravel blade file.
Features
- Supports 3 types of pattern input methods
- Execution time is short because the number of accesses to Google Spreadsheet is minimal
- You can freely perform the output location and processing after output
- You can also perform input validation of Google Spreadsheet by replacing the class using the service provider
Requirements
The requirements to Spreadsheet converter application is:
- PHP - Supported Versions: >= 8.0
- Laravel - Supported Versions: >= 9.0
Installation
Require this package with composer using the following command:
composer require --dev stepupdream/spread-sheet-converter
Arrangement
- Please log in to your Google account. Then, while logged in, access the Google API Console
- Create a new project. Feel free to decide the project name
- Click APIs and Services in the menu on the left side of the page. Enable APIs and services
- Search for the Google Sheets API and enable its use. Then click "Create Credentials" on the right side of the page
- API to use : Google Sheets API
- Where to call the API : Web server
- Types of data to be accessed : Application data
- Are you planning to use this API on App Engine or Compute Engine? : No
- Enter the content of "Add Credentials to Project"
- Service account name: Owner
- Key type : JSON
- The JSON file required for authentication will be downloaded
- Rename it credentials.json and put it in the "storage/app/json" folder
- Create a Google Spreadsheet
- Add shared members to the created Google Spreadsheet
- json file Add the members listed in "dev-test@****************.iam.gserviceaccount.com"
- Check the file ID of the created Google Spreadsheet
Usage
- You can publish the config file (php artisan vendor:publish) and set the default directories
- Feel free to modify the config file
Run Locally
Generate yaml files
php artisan spread-sheet-converter:create-definition-document
Example Config
- credentials_path : Specify the location of the json file obtained in the preparation stage
- request_rule_column_name : Enter the name of the column that manages Laravel's validation rules
- request_rule_sheet_name : Enter the name of the sheet that manages Laravel's validation rules
- category_tag : Please enter the classification name of the corresponding Spreadsheet. Duplicate names are prohibited
- read_type : "SingleGroup" or "MultiGroup" or "Other"
- use_blade : Please enter the name of the template file to use
- output_directory_path : Enter the output destination of the Yaml file
- definition_directory_path : Specify the path of the directory where only the Yaml files you actually use are stored
- separation_key : Enter the column name that separates the parent group and the child group
- attribute_group_column_name : Enter the column name that separates the parent group and the child group
return [ 'credentials_path' => storage_path('app/json/credentials.json'), 'request_rule_column_name' => 'RequestRule', 'request_rule_sheet_name' => 'RequestRule', 'read_spread_sheets' => [ [ 'sheet_id' => '***************************', 'category_tag' => 'MasterData', 'read_type' => 'SingleGroup', 'use_blade' => 'single', 'output_directory_path' => base_path('definition_document/tmp/database/master_data'), 'definition_directory_path' => base_path('definition_document/database/master_data'), 'separation_key' => 'ColumnName', 'attribute_group_column_name' => null, ], ], ];
Sample
Contributing
Please see CONTRIBUTING for details.
Important Point
Google Spreadsheet Settings Please do not publish the json file and Google Spreadsheet ID to the world.
License
The Spreadsheet converter is open-sourced software licensed under the MIT license
stepupdream/spread-sheet-converter 适用场景与选型建议
stepupdream/spread-sheet-converter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 07 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「yaml」 「spreadsheet」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stepupdream/spread-sheet-converter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stepupdream/spread-sheet-converter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stepupdream/spread-sheet-converter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
SUML for PHP
SUML support for Symfony
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-31


