Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ updates:
- package-ecosystem: "docker"
directory: "/.devcontainer"
schedule:
interval: "weekly"
interval: "monthly"
cooldown:
default-days: 7
labels: ["dependencies"]
Expand All @@ -40,7 +40,7 @@ updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
cooldown:
default-days: 7
labels: ["dependencies"]
3 changes: 0 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
pull_request:
types: [ opened, reopened, synchronize, labeled, unlabeled ]

permissions:
contents: read

jobs:
update-draft:
if: github.event_name == 'push'
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14
3.15
13 changes: 13 additions & 0 deletions CI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CI and Security

| Workflow | Runs on | Purpose |
| ------------------------------------------------- | ---------------------------- | ---------------------------------------------- |
| `python.yml` | push / PR to `main` | lint and unit tests |
| `security.yml` | push to `main`, all PRs | zizmor workflow audit, gitleaks secret scan |
| `release-drafter.yml` | push to `main`, PRs | update the draft release, label PRs |
| `release.yml` | manual | publish a release |

* GitHub Actions are pinned to full commit SHAs, with the version in a trailing comment
* Dependabot (`.github/dependabot.yml`) checks weekly for updates to GitHub Actions, Python
dependencies, the dev container image, and dev container features. New releases wait 7 days
before an update is proposed. Dependabot PRs get the `dependencies` label
46 changes: 5 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PyPricecharting API Client ![](https://github.com/ahcodedev/pypricecharting/actions/workflows/python.yml/badge.svg?branch=main)
# PyPriceCharting API Client ![](https://github.com/ahcodedev/pypricecharting/actions/workflows/python.yml/badge.svg?branch=main)
[![Security](https://github.com/ahcodedev/pypricecharting/actions/workflows/security.yml/badge.svg?branch=main)](https://github.com/ahcodedev/pypricecharting/actions/workflows/security.yml)
[![gitleaks](https://img.shields.io/badge/protected%20by-gitleaks-blue)](https://github.com/gitleaks/gitleaks)

Pricecharting API Client written in Python
PriceCharting API Client written in Python

## Setup

Expand All @@ -24,12 +24,8 @@ manage project configuration and commands
* Install Docker
* Install VSCode
* Open project folder in VS Code
* Optional - Install recommended extensions
* Reopen in container using Remote Development Container menu

The base image, `just`, and `uv` are pinned by version and digest in `.devcontainer/Dockerfile`
and updated by Dependabot. To change the Python version, edit the `FROM` line.

## Project Commands

* `just setup` - install tools and git hooks, then sync dependencies
Expand All @@ -53,47 +49,15 @@ and updated by Dependabot. To change the Python version, edit the `FROM` line.

## CI and Security

| Workflow | Runs on | Purpose |
| ------------------------------------------------- | ---------------------------- | ---------------------------------------------- |
| `python.yml` | push / PR to `main` | lint and unit tests |
| `security.yml` | push to `main`, all PRs | zizmor workflow audit, gitleaks secret scan |
| `release-drafter.yml` | push to `main`, PRs | update the draft release, label PRs |
| `release.yml` | manual | publish a release |

* GitHub Actions are pinned to full commit SHAs, with the version in a trailing comment
* Dependabot (`.github/dependabot.yml`) checks weekly for updates to GitHub Actions, Python
dependencies, the dev container image, and dev container features. New releases wait 7 days
before an update is proposed. Dependabot PRs get the `dependencies` label
See [CI.md](CI.md) for the GitHub Actions workflows and Dependabot setup.

## Releases

Releases are managed with [Release Drafter](https://github.com/release-drafter/release-drafter),
which reads the **release labels** on merged pull requests.

A release label is a GitHub label added to the pull request itself, from the **Labels** section
of the PR sidebar. Release Drafter only reads these labels. Commit messages and PR titles are not
parsed, so prefixes like `feat:` or `fix:` have no effect. Only the labels below count as release
labels; other repository labels (e.g. `good first issue`, `question`) are ignored.

| Release label | Version bump | Release notes section |
| ----------------------------------------------------------------- | ------------ | --------------------- |
| `breaking` | major | Breaking Changes |
| `feature`, `enhancement` | minor | Features |
| `bug`, `fix` | patch | Bug Fixes |
| `chore`, `ci`, `dependencies`, `documentation`, `refactor` | patch | Maintenance |
| `skip-changelog` | none | Excluded |

* Every PR must have at least one release label, or the `Release Drafter / require-label` check fails. If a release
has PRs with different labels, the largest bump wins
* Release labels are added automatically from the PR's branch name prefix (`feat/`, `fix/`, `chore/`,
`ci/`, `docs/`, `refactor/`) and from the files it changes. You can add or change them by hand
* Merging to `main` updates a draft GitHub Release with the next version and notes
* To release, run the **Release** workflow from the Actions tab. It bumps the version in
`pyproject.toml`/`uv.lock`, updates `CHANGELOG.md`, tags the release, and uploads build artifacts
See [RELEASE.md](RELEASE.md) for how releases and release labels work.

## Usage

* Usage Notes
### Types

## Supporting Files

Expand Down
25 changes: 25 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Releases

Releases are managed with [Release Drafter](https://github.com/release-drafter/release-drafter),
which reads the **release labels** on merged pull requests.

A release label is a GitHub label added to the pull request itself, from the **Labels** section
of the PR sidebar. Release Drafter only reads these labels. Commit messages and PR titles are not
parsed, so prefixes like `feat:` or `fix:` have no effect. Only the labels below count as release
labels; other repository labels (e.g. `good first issue`, `question`) are ignored.

| Release label | Version bump | Release notes section |
| ----------------------------------------------------------------- | ------------ | --------------------- |
| `breaking` | major | Breaking Changes |
| `feature`, `enhancement` | minor | Features |
| `bug`, `fix` | patch | Bug Fixes |
| `chore`, `ci`, `dependencies`, `documentation`, `refactor` | patch | Maintenance |
| `skip-changelog` | none | Excluded |

* Every PR must have at least one release label, or the `Release Drafter / require-label` check fails. If a release
has PRs with different labels, the largest bump wins
* Release labels are added automatically from the PR's branch name prefix (`feat/`, `fix/`, `chore/`,
`ci/`, `docs/`, `refactor/`) and from the files it changes. You can add or change them by hand
* Merging to `main` updates a draft GitHub Release with the next version and notes
* To release, run the **Release** workflow from the Actions tab. It bumps the version in
`pyproject.toml`/`uv.lock`, updates `CHANGELOG.md`, tags the release, and uploads build artifacts
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
name = "pypricecharting"
description = "Python PriceCharting API Client"
version = "0.0.1"
requires-python = ">=3.14"
requires-python = ">=3.15"

dependencies = []
dependencies = [
"httpx2>=2.16.0",
"pydantic>=2.14.3",
]

[build-system]
requires = ["uv_build>=0.13.7,<0.14.0"]
Expand Down
6 changes: 0 additions & 6 deletions src/pypricecharting/hello_world.py

This file was deleted.

77 changes: 77 additions & 0 deletions src/pypricecharting/types/condition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from enum import Enum, unique

# https://www.pricecharting.com/api-documentation#includes


@unique
class VideoGames(Enum):
"""Condition IDs for video game products."""

LOOSE = 1
NEW_AND_SEALED = 2
CIB = 3
GRADED = 5
BOX_ONLY = 6
MANUAL_ONLY = 7
ITEM_AND_BOX = 8
ITEM_AND_MANUAL = 9
BOX_AND_MANUAL = 10
GRADED_CIB = 13


@unique
class Cards(Enum):
"""Condition IDs for trading card products."""

UNGRADED = 1
GRADE_8 = 2
GRADE_7 = 3
GRADE_9 = 5
GRADE_9_5 = 6
GRADE_10 = 7
BGS_10 = 8
GRADE_1 = 9
GRADE_2 = 10
GRADE_3 = 13


@unique
class Comics(Enum):
"""Condition IDs for comic book products."""

UNGRADED = 1
GRADE_6_0 = 2
GRADE_4_0 = 3
GRADE_8_0 = 5
GRADE_9_2 = 6
GRADE_9_8 = 7
GRADE_10_0 = 8
GRADE_2_0 = 9
GRADE_9_6 = 10
GRADE_3_0 = 13


@unique
class Coins(Enum):
"""Condition IDs for coin products."""

UNGRADED = 1
AU_50_58 = 2
VF_20_35 = 3
MS_62 = 5
MS_64 = 6
MS_66 = 7
F_12_15 = 8
XF_40_45 = 9
MS_60 = 10
MS_61 = 13


@unique
class Condition(Enum):
"""Condition ID enums grouped by product category."""

VIDEOGAMES = VideoGames
CARDS = Cards
COMICS = Comics
COINS = Coins
Loading
Loading