preflight-kit 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- preflight_kit-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +45 -0
- preflight_kit-0.2.0/.github/ISSUE_TEMPLATE/csv_import_story.yml +42 -0
- preflight_kit-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +30 -0
- preflight_kit-0.2.0/.github/workflows/ci.yml +22 -0
- preflight_kit-0.2.0/.gitignore +42 -0
- preflight_kit-0.2.0/CHANGELOG.md +30 -0
- preflight_kit-0.2.0/CONTRIBUTING.md +41 -0
- preflight_kit-0.2.0/LICENSE +33 -0
- preflight_kit-0.2.0/PKG-INFO +124 -0
- preflight_kit-0.2.0/README.md +99 -0
- preflight_kit-0.2.0/SECURITY.md +17 -0
- preflight_kit-0.2.0/docs/shopify-product-csv-rules.md +191 -0
- preflight_kit-0.2.0/examples/inputs/README.md +17 -0
- preflight_kit-0.2.0/examples/inputs/messy-product-import-sample.csv +5 -0
- preflight_kit-0.2.0/examples/inputs/shopify-product-import-sample.csv +7 -0
- preflight_kit-0.2.0/examples/reports/csv-preflight-messy-errors.csv +15 -0
- preflight_kit-0.2.0/examples/reports/preflight-kit-clean-report.md +31 -0
- preflight_kit-0.2.0/examples/reports/preflight-kit-messy-report.md +34 -0
- preflight_kit-0.2.0/pyproject.toml +44 -0
- preflight_kit-0.2.0/src/preflight_kit/__init__.py +0 -0
- preflight_kit-0.2.0/src/preflight_kit/cli.py +72 -0
- preflight_kit-0.2.0/src/preflight_kit/engine.py +62 -0
- preflight_kit-0.2.0/src/preflight_kit/fixer.py +50 -0
- preflight_kit-0.2.0/src/preflight_kit/header_registry.py +126 -0
- preflight_kit-0.2.0/src/preflight_kit/json_dump.py +85 -0
- preflight_kit-0.2.0/src/preflight_kit/loader.py +291 -0
- preflight_kit-0.2.0/src/preflight_kit/models.py +66 -0
- preflight_kit-0.2.0/src/preflight_kit/reporters.py +145 -0
- preflight_kit-0.2.0/src/preflight_kit/rules/__init__.py +4 -0
- preflight_kit-0.2.0/src/preflight_kit/rules/file_rules.py +210 -0
- preflight_kit-0.2.0/src/preflight_kit/rules/row_rules.py +448 -0
- preflight_kit-0.2.0/tests/conftest.py +27 -0
- preflight_kit-0.2.0/tests/fixtures/alt_without_image/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/bad_price/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/blank_sku/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/bom_utf8/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/case_only_header/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/clean_legacy_alias/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/clean_new_format/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/control_char/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/dup_option_combo/input.csv +3 -0
- preflight_kit-0.2.0/tests/fixtures/dup_product_start/input.csv +3 -0
- preflight_kit-0.2.0/tests/fixtures/handle_missing_update/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/image_rows_normal/input.csv +3 -0
- preflight_kit-0.2.0/tests/fixtures/invalid_inventory_policy/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/local_image_path/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/missing_fulfillment/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/missing_handle_column/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/multivariant_normal/input.csv +3 -0
- preflight_kit-0.2.0/tests/fixtures/non_utf8/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/option2_without_option1/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/option_dependency/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/sku_reuse/input.csv +3 -0
- preflight_kit-0.2.0/tests/fixtures/sku_scientific/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/smart_quotes/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/title_missing_mixed/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/title_missing_new/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/tracker_no_qty/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/unknown_metafield/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/variant_metafield/input.csv +2 -0
- preflight_kit-0.2.0/tests/fixtures/variant_missing_handle/input.csv +3 -0
- preflight_kit-0.2.0/tests/test_cli.py +93 -0
- preflight_kit-0.2.0/tests/test_e2e_sample.py +22 -0
- preflight_kit-0.2.0/tests/test_engine.py +152 -0
- preflight_kit-0.2.0/tests/test_file_rules.py +122 -0
- preflight_kit-0.2.0/tests/test_fixer.py +149 -0
- preflight_kit-0.2.0/tests/test_golden.py +137 -0
- preflight_kit-0.2.0/tests/test_header_registry.py +92 -0
- preflight_kit-0.2.0/tests/test_loader.py +206 -0
- preflight_kit-0.2.0/tests/test_models.py +34 -0
- preflight_kit-0.2.0/tests/test_reporters.py +72 -0
- preflight_kit-0.2.0/tests/test_row_rules.py +297 -0
- preflight_kit-0.2.0/uv.lock +78 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Something in csv-preflight behaved incorrectly (wrong finding, crash, bad auto-fix).
|
|
3
|
+
labels: [bug]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for reporting. Please do **not** attach a real store export that
|
|
9
|
+
contains customer or order data — this tool refuses those files by design,
|
|
10
|
+
and we don't want that data in a public issue either. A small, redacted
|
|
11
|
+
sample that reproduces the problem is ideal.
|
|
12
|
+
- type: input
|
|
13
|
+
id: version
|
|
14
|
+
attributes:
|
|
15
|
+
label: Version
|
|
16
|
+
description: Output of `csv-preflight --version` (or the commit you ran from).
|
|
17
|
+
placeholder: "0.1.0"
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: what-happened
|
|
22
|
+
attributes:
|
|
23
|
+
label: What happened
|
|
24
|
+
description: What did the tool do, and what did you expect instead?
|
|
25
|
+
placeholder: |
|
|
26
|
+
I ran `preflight check products.csv` and it reported a duplicate handle,
|
|
27
|
+
but the handles are actually different (they differ only in case).
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: repro
|
|
32
|
+
attributes:
|
|
33
|
+
label: Minimal reproduction
|
|
34
|
+
description: The smallest CSV snippet (a few rows) and the exact command that reproduces it.
|
|
35
|
+
render: text
|
|
36
|
+
validations:
|
|
37
|
+
required: true
|
|
38
|
+
- type: input
|
|
39
|
+
id: env
|
|
40
|
+
attributes:
|
|
41
|
+
label: Environment
|
|
42
|
+
description: OS and Python version (`python --version`).
|
|
43
|
+
placeholder: "macOS 14 / Python 3.12"
|
|
44
|
+
validations:
|
|
45
|
+
required: false
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: A CSV import that went wrong
|
|
2
|
+
description: Share a Shopify product-CSV import that broke, so a future check can catch it.
|
|
3
|
+
labels: [import-story]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
This tool exists because Shopify product-CSV imports fail in quiet, specific
|
|
9
|
+
ways. If one of those bit you, describe it here — it helps decide which check
|
|
10
|
+
to build next. **Redact anything private**: no customer or order data, no
|
|
11
|
+
access tokens. A description of *what broke* is enough; you don't have to
|
|
12
|
+
attach the file.
|
|
13
|
+
|
|
14
|
+
You can also check a CSV yourself in the browser first (no upload, no login):
|
|
15
|
+
https://preflight-kit.pages.dev/
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: what-broke
|
|
18
|
+
attributes:
|
|
19
|
+
label: What went wrong with the import
|
|
20
|
+
description: What did you upload, and how did Shopify (or your store) misbehave afterward?
|
|
21
|
+
placeholder: |
|
|
22
|
+
I edited product prices in Excel, re-uploaded, and half my products lost
|
|
23
|
+
their images. The import dialog said it succeeded.
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: how-found
|
|
28
|
+
attributes:
|
|
29
|
+
label: How did you find out
|
|
30
|
+
description: Did a customer report it? A spot check? How long after the upload?
|
|
31
|
+
validations:
|
|
32
|
+
required: false
|
|
33
|
+
- type: dropdown
|
|
34
|
+
id: would-check-help
|
|
35
|
+
attributes:
|
|
36
|
+
label: Would a pre-upload check have saved you?
|
|
37
|
+
options:
|
|
38
|
+
- "Yes — I'd have caught it before uploading"
|
|
39
|
+
- "Maybe — depends how it's flagged"
|
|
40
|
+
- "No — the problem was live-store behavior a file check can't see"
|
|
41
|
+
validations:
|
|
42
|
+
required: false
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest a focused improvement to Shopify product-CSV preflight validation.
|
|
3
|
+
labels: [enhancement]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thank you for suggesting an improvement. Please do not include customer or
|
|
9
|
+
order data, credentials, access tokens, or an unredacted store export.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem to solve
|
|
14
|
+
description: What import risk or pre-upload workflow problem is not covered today?
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: proposal
|
|
19
|
+
attributes:
|
|
20
|
+
label: Proposed behavior
|
|
21
|
+
description: Describe the expected finding or safe behavior. Include a small redacted CSV example if useful.
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: alternatives
|
|
26
|
+
attributes:
|
|
27
|
+
label: Alternatives considered
|
|
28
|
+
description: What current workflow or workaround have you tried?
|
|
29
|
+
validations:
|
|
30
|
+
required: false
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v7
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: uv sync --locked --extra dev
|
|
21
|
+
- name: Run tests
|
|
22
|
+
run: uv run --frozen pytest
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Secrets / env
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
!.env.example
|
|
5
|
+
|
|
6
|
+
# Node / TypeScript (Shopify app, UI)
|
|
7
|
+
node_modules/
|
|
8
|
+
.next/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
coverage/
|
|
12
|
+
*.tsbuildinfo
|
|
13
|
+
|
|
14
|
+
# Python (import/report beta, ETL)
|
|
15
|
+
.venv/
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
__pycache__/
|
|
20
|
+
*.pyc
|
|
21
|
+
|
|
22
|
+
# Local data (do not commit merchant/channel exports)
|
|
23
|
+
data/private/
|
|
24
|
+
data/raw/
|
|
25
|
+
*.sqlite
|
|
26
|
+
*.sqlite3
|
|
27
|
+
*.db
|
|
28
|
+
|
|
29
|
+
# Logs / temp
|
|
30
|
+
tmp/
|
|
31
|
+
*.log
|
|
32
|
+
|
|
33
|
+
# OS / IDE
|
|
34
|
+
.DS_Store
|
|
35
|
+
Thumbs.db
|
|
36
|
+
.idea/
|
|
37
|
+
|
|
38
|
+
# Generated test fixtures (regenerated by tests/conftest.py)
|
|
39
|
+
tests/fixtures/over_15mb/
|
|
40
|
+
|
|
41
|
+
# CLI output dir (sample reports are saved under examples/reports/ instead)
|
|
42
|
+
/out/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable user-facing changes to this project are recorded here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions correspond to repository tags and PyPI releases where available.
|
|
6
|
+
|
|
7
|
+
## [0.2.0] - 2026-07-19
|
|
8
|
+
|
|
9
|
+
Package and brand rename. No functional rule changes.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Package name: `csv-preflight` → `preflight-kit`; import package: `csv_preflight` → `preflight_kit`.
|
|
14
|
+
- CLI command: `csv-preflight` → `preflight`.
|
|
15
|
+
- Repository moved to `q00tar00/preflight-kit`; web checker moved to `preflight-kit.pages.dev`.
|
|
16
|
+
- The old PyPI name `csv-preflight` stays published but will not receive new releases.
|
|
17
|
+
|
|
18
|
+
## [0.1.0] - 2026-06-23
|
|
19
|
+
|
|
20
|
+
Initial public release of the Shopify product-CSV preflight CLI.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Local validation for Shopify product CSV structure, headers, file limits, and common import-risk conditions.
|
|
25
|
+
- Reports in Markdown and CSV, plus a fixed CSV for proven mechanical corrections only.
|
|
26
|
+
- English and Japanese report output.
|
|
27
|
+
- Product-CSV privacy guard that refuses apparent order or customer exports.
|
|
28
|
+
|
|
29
|
+
[0.2.0]: https://github.com/q00tar00/preflight-kit/releases/tag/v0.2.0
|
|
30
|
+
[0.1.0]: https://github.com/q00tar00/preflight-kit/releases/tag/v0.1.0
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Contributing to Shopify Product CSV Preflight
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve `preflight-kit`. This project validates Shopify product CSV files before import; changes should preserve its local-only, non-destructive design.
|
|
4
|
+
|
|
5
|
+
## Before opening an issue
|
|
6
|
+
|
|
7
|
+
- Use [GitHub Issues](https://github.com/q00tar00/preflight-kit/issues) for bugs, feature requests, questions, and product-CSV import stories.
|
|
8
|
+
- Do not attach real customer or order exports, access tokens, or other sensitive data. Provide a minimal, redacted CSV reproduction instead.
|
|
9
|
+
- Check the [rule reference](docs/shopify-product-csv-rules.md) before reporting an expected rule outcome.
|
|
10
|
+
|
|
11
|
+
## Development setup
|
|
12
|
+
|
|
13
|
+
Requirements: Python 3.11+ and [uv](https://docs.astral.sh/uv/).
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/q00tar00/preflight-kit.git
|
|
17
|
+
cd preflight-kit
|
|
18
|
+
uv sync --extra dev
|
|
19
|
+
uv run pytest
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Run the CLI against a sample file with:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv run preflight check examples/inputs/shopify-product-import-sample.csv --out-dir ./out --lang en --intent new
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The generated `out/` directory is local output and should not be committed.
|
|
29
|
+
|
|
30
|
+
## Pull requests
|
|
31
|
+
|
|
32
|
+
- Keep pull requests focused and explain the user-visible validation or documentation change.
|
|
33
|
+
- Add or update tests for changes to validation, report, or auto-fix behavior.
|
|
34
|
+
- Preserve the distinction between proven auto-fixes and findings that need user judgment.
|
|
35
|
+
- Keep documentation in English and update the rule reference when a rule’s behavior changes.
|
|
36
|
+
- Do not add store access, API calls, or data-upload behavior without an explicit design discussion first.
|
|
37
|
+
- Confirm `uv run pytest` passes before requesting review.
|
|
38
|
+
|
|
39
|
+
## Scope and review
|
|
40
|
+
|
|
41
|
+
The maintainer, [q00tar00](https://github.com/q00tar00), reviews contributions on a best-effort basis. Issues and pull requests should be respectful, reproducible, and limited to Shopify product-CSV preflight validation or its documentation and tooling.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Shopify Product CSV Preflight Validator — Source-Available License
|
|
2
|
+
Copyright (c) 2026 q00tar00
|
|
3
|
+
|
|
4
|
+
This software is source-available, not open source. The source code is published
|
|
5
|
+
so that you can read it, audit it, and evaluate the tool. It is NOT placed in the
|
|
6
|
+
public domain and no broad license is granted beyond the terms below.
|
|
7
|
+
|
|
8
|
+
1. Permitted use (no charge)
|
|
9
|
+
You may download, build, run, and evaluate this software for your own personal
|
|
10
|
+
or internal business use — for example, to validate your own Shopify product CSV
|
|
11
|
+
files. You may modify your own copy for that purpose.
|
|
12
|
+
|
|
13
|
+
2. Reservation of rights
|
|
14
|
+
All rights not expressly granted above are reserved by the copyright holder.
|
|
15
|
+
|
|
16
|
+
3. Restrictions (require prior written permission)
|
|
17
|
+
Without the copyright holder's prior written permission you may NOT:
|
|
18
|
+
(a) redistribute, resell, sublicense, or publish this software or a derivative
|
|
19
|
+
of it, in source or binary form, whether or not for a fee;
|
|
20
|
+
(b) offer this software (or a derivative) as a hosted or managed service; or
|
|
21
|
+
(c) remove or alter this license or the copyright notice in redistributed copies.
|
|
22
|
+
|
|
23
|
+
4. No warranty
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
26
|
+
FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. A clean report does NOT guarantee
|
|
27
|
+
a successful Shopify import; the tool reads a file and cannot verify live-store
|
|
28
|
+
behavior. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
29
|
+
CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH
|
|
30
|
+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
|
|
32
|
+
For permissions beyond this license, contact the copyright holder via the project's
|
|
33
|
+
GitHub repository: https://github.com/q00tar00/shopify
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: preflight-kit
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Preflight Kit — preflight validator for Shopify product CSV, catches import-breaking mistakes before you upload (formerly csv-preflight)
|
|
5
|
+
Project-URL: Homepage, https://preflight-kit.pages.dev/
|
|
6
|
+
Project-URL: Repository, https://github.com/q00tar00/preflight-kit
|
|
7
|
+
Project-URL: Issues, https://github.com/q00tar00/preflight-kit/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/q00tar00/preflight-kit/blob/main/CHANGELOG.md
|
|
9
|
+
Author: q00tar00
|
|
10
|
+
License: LicenseRef-Source-Available
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: csv,ecommerce,preflight,product-import,shopify,validator
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Preflight Kit — product CSV preflight validator for Shopify
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/preflight-kit/)
|
|
29
|
+
[](LICENSE)
|
|
30
|
+
[](https://github.com/q00tar00/preflight-kit/actions/workflows/ci.yml)
|
|
31
|
+
|
|
32
|
+
Validate a Shopify **product** CSV before uploading it. `preflight-kit` runs locally, never connects to a Shopify store, and needs no API key. It reports import-risk findings and produces reviewable output files without changing the input CSV.
|
|
33
|
+
|
|
34
|
+
> **Status:** Beta CLI, version 0.2.0 (formerly published as `csv-preflight`). This is a local, file-processing tool for product CSVs only. It has no Admin API integration, store-write capability, or user account system.
|
|
35
|
+
|
|
36
|
+
## Project links
|
|
37
|
+
|
|
38
|
+
- Web checker: [preflight-kit.pages.dev](https://preflight-kit.pages.dev/) (no upload or login)
|
|
39
|
+
- Package: [PyPI — preflight-kit](https://pypi.org/project/preflight-kit/)
|
|
40
|
+
- Source and issue tracker: [q00tar00/preflight-kit](https://github.com/q00tar00/preflight-kit)
|
|
41
|
+
- Change history: [CHANGELOG.md](CHANGELOG.md)
|
|
42
|
+
|
|
43
|
+
## What it checks
|
|
44
|
+
|
|
45
|
+
The validator checks Shopify product-CSV structure and row-level risks, including:
|
|
46
|
+
|
|
47
|
+
- UTF-8 encoding, BOMs, control characters, headers, file size, and column alignment.
|
|
48
|
+
- Missing or duplicate product handles, required-column gaps, and variant parent linkage.
|
|
49
|
+
- Duplicate option combinations and option dependency or position problems.
|
|
50
|
+
- SKU gaps, reused SKUs, and Excel-style scientific notation.
|
|
51
|
+
- Inventory, fulfillment, price, image URL, and image-alt-text consistency.
|
|
52
|
+
- Product CSVs that appear to be order or customer exports: these are refused before row-level processing to avoid handling buyer PII.
|
|
53
|
+
|
|
54
|
+
It supports current Shopify product-CSV headers and documented legacy aliases. The complete, versioned rule reference is [docs/shopify-product-csv-rules.md](docs/shopify-product-csv-rules.md).
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
Requires Python 3.11 or later.
|
|
59
|
+
|
|
60
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv tool install preflight-kit
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
With pip:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python -m pip install preflight-kit
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
preflight check products.csv --out-dir ./out --lang en --intent new
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Each run writes the following to `--out-dir`:
|
|
79
|
+
|
|
80
|
+
- `fixed_products.csv` — a copy with only unambiguous mechanical fixes applied (currently UTF-8 BOM removal and case-only header normalization).
|
|
81
|
+
- `errors.csv` — machine-readable findings with row, rule, severity, and suggested-fix fields.
|
|
82
|
+
- `report.md` — a human-readable summary.
|
|
83
|
+
|
|
84
|
+
Useful options:
|
|
85
|
+
|
|
86
|
+
- `--out-dir DIR` — output directory (default: `./out`).
|
|
87
|
+
- `--lang en|ja` — report language (default: `ja`).
|
|
88
|
+
- `--no-fix` — report findings without writing `fixed_products.csv`.
|
|
89
|
+
- `--intent new|update|mixed` — choose the import context used for handle and title severity.
|
|
90
|
+
|
|
91
|
+
The command exits with status `1` when it finds a critical issue; otherwise it exits with `0`. A zero exit status means no critical finding was detected within the implemented checks, not that Shopify will necessarily accept or apply the import as intended.
|
|
92
|
+
|
|
93
|
+
For a reproducible example, see the [deliberately messy sample report](examples/reports/preflight-kit-messy-report.md) and its [input CSV](examples/inputs/messy-product-import-sample.csv).
|
|
94
|
+
|
|
95
|
+
## Boundaries and privacy
|
|
96
|
+
|
|
97
|
+
The CLI reads a local file and does not upload it or access a Shopify store. It does not verify live-store behavior. In particular, it cannot check image URL reachability, conflicts with existing store handles, metafield product-reference resolution, or option-position consistency with existing products; every report identifies these limits.
|
|
98
|
+
|
|
99
|
+
Auto-fixes are deliberately limited to proven, unambiguous transformations. Findings that require a business decision are reported but not silently rewritten.
|
|
100
|
+
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
- [Inspection rules](docs/shopify-product-csv-rules.md)
|
|
104
|
+
- [Change history](CHANGELOG.md)
|
|
105
|
+
- [Contributing guide](CONTRIBUTING.md)
|
|
106
|
+
- [Security policy](SECURITY.md)
|
|
107
|
+
|
|
108
|
+
## Maintenance and support
|
|
109
|
+
|
|
110
|
+
This project is maintained by the GitHub user [q00tar00](https://github.com/q00tar00). The public GitHub repository and its issue tracker are the project’s canonical communication channels.
|
|
111
|
+
|
|
112
|
+
For questions, bug reports, feature requests, or examples of a product-CSV import that went wrong, use [GitHub Issues](https://github.com/q00tar00/preflight-kit/issues). Please use a small redacted reproduction and never post customer, order, access-token, or other sensitive data. Support is provided on a best-effort basis; no response-time commitment is made.
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the supported scope, local setup, test command, and pull-request expectations.
|
|
117
|
+
|
|
118
|
+
## Security
|
|
119
|
+
|
|
120
|
+
Please follow [SECURITY.md](SECURITY.md) for vulnerability reporting. Do not disclose exploitable security details or sensitive CSV data in a public issue.
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
This project is source-available, not open source. See [LICENSE](LICENSE) for permitted use and redistribution terms.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Preflight Kit — product CSV preflight validator for Shopify
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/preflight-kit/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://github.com/q00tar00/preflight-kit/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
Validate a Shopify **product** CSV before uploading it. `preflight-kit` runs locally, never connects to a Shopify store, and needs no API key. It reports import-risk findings and produces reviewable output files without changing the input CSV.
|
|
8
|
+
|
|
9
|
+
> **Status:** Beta CLI, version 0.2.0 (formerly published as `csv-preflight`). This is a local, file-processing tool for product CSVs only. It has no Admin API integration, store-write capability, or user account system.
|
|
10
|
+
|
|
11
|
+
## Project links
|
|
12
|
+
|
|
13
|
+
- Web checker: [preflight-kit.pages.dev](https://preflight-kit.pages.dev/) (no upload or login)
|
|
14
|
+
- Package: [PyPI — preflight-kit](https://pypi.org/project/preflight-kit/)
|
|
15
|
+
- Source and issue tracker: [q00tar00/preflight-kit](https://github.com/q00tar00/preflight-kit)
|
|
16
|
+
- Change history: [CHANGELOG.md](CHANGELOG.md)
|
|
17
|
+
|
|
18
|
+
## What it checks
|
|
19
|
+
|
|
20
|
+
The validator checks Shopify product-CSV structure and row-level risks, including:
|
|
21
|
+
|
|
22
|
+
- UTF-8 encoding, BOMs, control characters, headers, file size, and column alignment.
|
|
23
|
+
- Missing or duplicate product handles, required-column gaps, and variant parent linkage.
|
|
24
|
+
- Duplicate option combinations and option dependency or position problems.
|
|
25
|
+
- SKU gaps, reused SKUs, and Excel-style scientific notation.
|
|
26
|
+
- Inventory, fulfillment, price, image URL, and image-alt-text consistency.
|
|
27
|
+
- Product CSVs that appear to be order or customer exports: these are refused before row-level processing to avoid handling buyer PII.
|
|
28
|
+
|
|
29
|
+
It supports current Shopify product-CSV headers and documented legacy aliases. The complete, versioned rule reference is [docs/shopify-product-csv-rules.md](docs/shopify-product-csv-rules.md).
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
Requires Python 3.11 or later.
|
|
34
|
+
|
|
35
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
uv tool install preflight-kit
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
With pip:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install preflight-kit
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
preflight check products.csv --out-dir ./out --lang en --intent new
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Each run writes the following to `--out-dir`:
|
|
54
|
+
|
|
55
|
+
- `fixed_products.csv` — a copy with only unambiguous mechanical fixes applied (currently UTF-8 BOM removal and case-only header normalization).
|
|
56
|
+
- `errors.csv` — machine-readable findings with row, rule, severity, and suggested-fix fields.
|
|
57
|
+
- `report.md` — a human-readable summary.
|
|
58
|
+
|
|
59
|
+
Useful options:
|
|
60
|
+
|
|
61
|
+
- `--out-dir DIR` — output directory (default: `./out`).
|
|
62
|
+
- `--lang en|ja` — report language (default: `ja`).
|
|
63
|
+
- `--no-fix` — report findings without writing `fixed_products.csv`.
|
|
64
|
+
- `--intent new|update|mixed` — choose the import context used for handle and title severity.
|
|
65
|
+
|
|
66
|
+
The command exits with status `1` when it finds a critical issue; otherwise it exits with `0`. A zero exit status means no critical finding was detected within the implemented checks, not that Shopify will necessarily accept or apply the import as intended.
|
|
67
|
+
|
|
68
|
+
For a reproducible example, see the [deliberately messy sample report](examples/reports/preflight-kit-messy-report.md) and its [input CSV](examples/inputs/messy-product-import-sample.csv).
|
|
69
|
+
|
|
70
|
+
## Boundaries and privacy
|
|
71
|
+
|
|
72
|
+
The CLI reads a local file and does not upload it or access a Shopify store. It does not verify live-store behavior. In particular, it cannot check image URL reachability, conflicts with existing store handles, metafield product-reference resolution, or option-position consistency with existing products; every report identifies these limits.
|
|
73
|
+
|
|
74
|
+
Auto-fixes are deliberately limited to proven, unambiguous transformations. Findings that require a business decision are reported but not silently rewritten.
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
- [Inspection rules](docs/shopify-product-csv-rules.md)
|
|
79
|
+
- [Change history](CHANGELOG.md)
|
|
80
|
+
- [Contributing guide](CONTRIBUTING.md)
|
|
81
|
+
- [Security policy](SECURITY.md)
|
|
82
|
+
|
|
83
|
+
## Maintenance and support
|
|
84
|
+
|
|
85
|
+
This project is maintained by the GitHub user [q00tar00](https://github.com/q00tar00). The public GitHub repository and its issue tracker are the project’s canonical communication channels.
|
|
86
|
+
|
|
87
|
+
For questions, bug reports, feature requests, or examples of a product-CSV import that went wrong, use [GitHub Issues](https://github.com/q00tar00/preflight-kit/issues). Please use a small redacted reproduction and never post customer, order, access-token, or other sensitive data. Support is provided on a best-effort basis; no response-time commitment is made.
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the supported scope, local setup, test command, and pull-request expectations.
|
|
92
|
+
|
|
93
|
+
## Security
|
|
94
|
+
|
|
95
|
+
Please follow [SECURITY.md](SECURITY.md) for vulnerability reporting. Do not disclose exploitable security details or sensitive CSV data in a public issue.
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
This project is source-available, not open source. See [LICENSE](LICENSE) for permitted use and redistribution terms.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported version
|
|
4
|
+
|
|
5
|
+
Security fixes are considered for the current released version of `preflight-kit` (currently 0.2.0) and the default branch.
|
|
6
|
+
|
|
7
|
+
## Reporting a vulnerability
|
|
8
|
+
|
|
9
|
+
Please report vulnerabilities privately through [GitHub Security Advisories](https://github.com/q00tar00/preflight-kit/security/advisories/new). Include the affected version, a minimal reproduction, impact, and any proposed mitigation.
|
|
10
|
+
|
|
11
|
+
Do not include customer data, order exports, credentials, access tokens, or a full exploitable proof of concept in a public GitHub Issue.
|
|
12
|
+
|
|
13
|
+
If private reporting is not available in the repository interface, open a public issue requesting private coordination without disclosing the vulnerability details. The maintainer is the GitHub user [q00tar00](https://github.com/q00tar00); GitHub is the only published contact channel for this project.
|
|
14
|
+
|
|
15
|
+
## Scope
|
|
16
|
+
|
|
17
|
+
This policy covers the `preflight-kit` package, its command-line interface, and the source repository. It does not cover Shopify, a merchant’s store configuration, or third-party URLs contained in a CSV.
|