Metadata-Version: 2.4
Name: gruncellka-porto-features
Version: 0.2.1
Summary: Shared BDD feature files for Porto SDKs
Author: gruncellka
License: MIT License
        
        Copyright (c) 2025 gruncellka
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/gruncellka/porto-features
Project-URL: Repository, https://github.com/gruncellka/porto-features
Project-URL: Issues, https://github.com/gruncellka/porto-features/issues
Project-URL: Changelog, https://github.com/gruncellka/porto-features/blob/main/CHANGELOG.md
Keywords: bdd,gherkin,cucumber,features,porto
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: bump2version>=1.0.0; extra == "dev"
Requires-Dist: gherkin-official<23.0.0,>=22.0.0; extra == "dev"
Requires-Dist: gherlint>=0.4.0; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: ruff>=0.15.5; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# Porto Features

[![validation](https://github.com/gruncellka/porto-features/actions/workflows/validation.yml/badge.svg)](https://github.com/gruncellka/porto-features/actions/workflows/validation.yml)
[![codecov](https://codecov.io/gh/gruncellka/porto-features/branch/main/graph/badge.svg)](https://codecov.io/gh/gruncellka/porto-features)

**Structured feature specifications for Porto SDKs**

A validated collection of Gherkin feature files and JSON fixtures that define behavioral contracts for Python and TypeScript SDKs. Files are checked in CI and packaged for distribution on **npm** and **PyPI**.

---

## Install

**TypeScript / JavaScript (npm, scope: `@gruncellka`)**

```bash
pnpm add -D @gruncellka/porto-features
yarn add -D @gruncellka/porto-features
npm install -D @gruncellka/porto-features
```

Use this npm package in both TypeScript and JavaScript projects.

**Python (PyPI)**

```bash
pip install "gruncellka-porto-features[dev]"
uv add --dev gruncellka-porto-features
poetry add --group dev gruncellka-porto-features
```

The package includes `porto_features/features/*.feature` and `porto_features/fixtures/**/*.json`, so SDK tests can run offline with the same source of truth in both ecosystems.

- **Python (PyPI)**: access files from the installed `porto_features` package directory (`porto_features/features` and `porto_features/fixtures`).
- **TypeScript / JavaScript (npm)**: access the same files from the package root (`@gruncellka/porto-features/porto_features/...`).

---

## Use cases

SDK contract tests (Python/TypeScript parity), BDD documentation, regression safety during SDK releases.

---

## Validate locally

```bash
make setup
make quality
make test-coverage
```

This runs feature/fixture validation, Gherkin linting, Python lint/format checks, type checks, and test coverage gates used by CI.

---

## Feature statistics

9 feature files; 80+ scenarios across API, CLI, pricing, restrictions, validation, services, and stamp generation. Address fixtures include DE, FR, CH, GB, NO, UA, US, and DE sender origin.

---

## Feature and fixture overview

| File                                       | Description                         |
| ------------------------------------------ | ----------------------------------- |
| `api_comprehensive_testing.feature`        | End-to-end API behavior scenarios   |
| `cli.feature`                              | CLI usage and output behavior       |
| `data_access.feature`                      | Data loading and access behavior    |
| `pricing.feature`                          | Pricing logic by type/zone/weight   |
| `resolution.feature`                       | Resolution workflow behavior        |
| `restrictions.feature`                     | Restrictions and sanctions behavior |
| `services.feature`                         | Service catalog behavior            |
| `stamp_generation.feature`                 | Stamp generation behavior           |
| `validation.feature`                       | Validation and error behavior       |
| `porto_features/fixtures/addresses/*.json` | Test addresses by country/zone      |

Feature files are validated via `scripts/validate_features.py`, and fixture JSON files are validated via `scripts/validate_fixtures.py`. Fixtures are shipped for deterministic tests.

---

## Standards

- **Feature format**: Gherkin (`.feature`), Cucumber-compatible
- **Fixture format**: JSON (`.json`)
- **Country codes**: ISO 3166-1 alpha-2 (`DE`, `US`, `FR`, `UA`)

---

## Disclaimer

This is **reference feature specification data** for Porto SDKs. Always verify that SDK implementations and runtime behavior match these specifications before shipping to production.

---

## Related resources

- [Gherkin syntax](https://cucumber.io/docs/gherkin/)
- [Cucumber docs](https://cucumber.io/docs/)
- [BDD](https://cucumber.io/docs/bdd/)

---

🔳 gruncellka
