Skip to main content

Core interfaces, data models, and events for the FBA-Bench simulation platform.

Project description

FBA-Bench Core — Contract-first Core Library

Overview

FBA-Bench Core is a compact, contract-first library for building and simulating Fulfillment-By-Amazon-style (FBA) business automation scenarios. The rebuilt core emphasizes explicit, versioned contracts (Pydantic v2 models) for domain models, events, commands, and typed configuration objects so downstream projects can reliably validate and integrate simulation logic.

Key principles

  • Contract-first: canonical Pydantic v2 models are the single source of truth.
  • Typed, immutable configs: configuration objects are frozen models; use model_copy(update={...}) to derive modified instances.
  • Explicit events/commands: typed discriminated unions with strict validation (extra="forbid") to make integration predictable.

Core modules

Quick start (Poetry)

Clone and install with Poetry:

git clone <repo-url>
cd FBA-Bench-core
poetry install

Run the test suite:

poetry run pytest -q

Using Core from another project

  1. Add FBA-Bench Core as a dependency (editable/local for development):
pip install -e /path/to/FBA-Bench-core
  1. Import domain models and instantiate typed configs:
from fba_bench_core.domain.models import Product
from fba_bench_core.config import BaseAgentConfig

p = Product(product_id="sku-1", cost="1.00", price="2.00", stock=10)
cfg = BaseAgentConfig(agent_id="pricing-agent", poll_interval_seconds=30)

Migration guidance

If you are upgrading from a legacy core:

  • See the migration guide: docs/migration-guide.md
  • Key actions: import canonical models, convert numeric values to Decimal, and replace mutable dict-based configs with typed Base*Config models.

Tests, linting and quality commands

The CI pipeline runs formatting, linting, type-checking and tests. Locally you can run the same commands via Poetry:

poetry run black src tests
poetry run isort src tests
poetry run flake8 src tests
poetry run mypy
poetry run pytest

Packaging & versioning workflow

  • CHANGELOG.md is generated from small towncrier fragments placed under newsfragments/ and built with towncrier.
  • To add a changelog fragment: create a brief file newsfragments/NN.description then run poetry run towncrier build --yes.
  • Version tooling: this repository includes .bumpver.toml and uses dynamic versioning in the packaging pipeline. Follow project policy for release tagging and bumping; maintainers should prefer automated tools (bumpver) that integrate with CI.

Architecture and contracts

See the in-repo architecture notes for the rebuilt core:

Documentation & rescue log

The rescue log contains per-phase notes about the rebuild:

Contributing

Please follow Conventional Commits for PRs, include tests for contract changes, and place towncrier fragments under newsfragments/ for changelog entries. See docs/README.md for broader documentation contribution guidelines.

Tooling

License & contact

  • License: MIT — see LICENSE
  • Contact: project maintainers via repository issues or press@fba-bench.ai.

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

fba_bench_core-1.0.0.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

fba_bench_core-1.0.0-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file fba_bench_core-1.0.0.tar.gz.

File metadata

  • Download URL: fba_bench_core-1.0.0.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.10 Windows/11

File hashes

Hashes for fba_bench_core-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e9da43b8e1ca79704213d67c0fb87e249584b659e5c6163528a0219da9941a4e
MD5 04f8c7268ec2086fca4ed72106c2ba91
BLAKE2b-256 700f9d62a8ac78d5cf6f50c788346a9efb459f49bfef1fd642b13002b05d4024

See more details on using hashes here.

File details

Details for the file fba_bench_core-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fba_bench_core-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.10 Windows/11

File hashes

Hashes for fba_bench_core-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7152cacb06fdf6a18c44be536d71d422ac016dd2d1e3f0cb06594b9e88a5ec30
MD5 640406ff4db97db8a42a2766f9653778
BLAKE2b-256 3c93a767b549872c0e82e0a33cdc47e953c860bb062c07cdd1ef3f4bafb356eb

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