Skip to content

Releases: NandaScott/Scrython

2.2.0

Choose a tag to compare

@NandaScott NandaScott released this 09 Jun 21:27

What's Changed

  • Added support for Scryfall Tags bulk downloads with Tag and Tagging object to work with them.

Full Changelog: 2.1.0...2.2.0

2.1.0

Choose a tag to compare

@NandaScott NandaScott released this 31 May 03:31
a7dbea8

What's Changed

Full Changelog: 2.0.3...2.1.0

2.0.3

Choose a tag to compare

@NandaScott NandaScott released this 07 Apr 03:25

What's Changed

Full Changelog: 2.0.2...2.0.3

2.0.2

Choose a tag to compare

@NandaScott NandaScott released this 24 Jan 20:26
f854427

What's Changed

Full Changelog: 2.0.1...2.0.2

2.0.1

Choose a tag to compare

@NandaScott NandaScott released this 02 Dec 04:29
811edd1

Bugfixes

  • Fixed an issue when downloading from bulk_data #145

2.0.0 Complete Rewrite

Choose a tag to compare

@NandaScott NandaScott released this 30 Nov 05:01

Boy howdy this is a huge release.

This release deprecates the previous versions of Scrython, with very little semblance to the original and no attempts at backwards compatibility. Any new projects looking to incorporate Scrython should use this version instead.

Changelog below, and available in the CHANGELOG.md at this project's root.

================================

Major refactoring and modernization of the Scrython library with significant improvements to code quality, type safety, and usability.

Added

TypedDict Integration

  • Full TypedDict type system from scrython.types module

    • ScryfallCardData - Complete card object structure
    • ScryfallSetData - Complete set object structure
    • ScryfallBulkDataData - Complete bulk data object structure
    • Legalities - Format legality information
    • Prices - Price information in various currencies
    • ImageUris - Image URIs for different sizes
    • PurchaseUris - Purchase URIs for various vendors
    • RelatedUris - Related resource URIs
    • CardFaceData - Multi-faced card face data
    • RelatedCard - Related card information
  • Refined mixin return types - Replaced generic dict[str, Any] with specific TypedDict types

    • legalities() returns Legalities
    • prices() returns Prices
    • image_uris() returns ImageUris | None
    • purchase_uris() returns PurchaseUris | None
    • related_uris() returns RelatedUris
  • Endpoint class type overrides - Better IDE autocomplete and type checking

    • cards.Object._scryfall_data: ScryfallCardData
    • sets.Object._scryfall_data: ScryfallSetData
    • bulk_data.Object._scryfall_data: ScryfallBulkDataData

Bulk Data Download Functionality

  • download() method for all Bulk Data objects
    • Automatic gzip decompression
    • Optional file saving with filepath parameter
    • Optional progress bar with progress=True (requires pip install scrython[progress])
    • Memory-efficient mode with return_data=False
    • Configurable chunk size for downloads

Comprehensive Type Hints

  • Modern Python 3.10+ type syntax throughout (X | Y instead of Union[X, Y])
  • All 113 card properties have explicit type annotations
  • All 21 set properties have explicit type annotations
  • All 11 bulk data properties have explicit type annotations
  • Nullable types properly annotated (e.g., int | None)
  • Complete TypedDict definitions for all Scryfall API response structures
  • Full mypy type validation with zero errors

Testing Infrastructure

  • 113 new property type tests - Comprehensive parametrized tests validating all properties
  • Test coverage for nullable field handling
  • Test coverage for nested objects (card faces, related cards)
  • Test coverage for bulk data download functionality (6 new tests)
  • Test coverage for pagination and caching
  • Test coverage for rate limiting
  • Total test suite: 394 tests passing (all green)

Development Tooling

  • black - Code formatter with consistent style
  • ruff - Fast Python linter
  • mypy - Static type checker
  • pre-commit hooks - Automatic code quality checks
  • GitHub Actions CI/CD configuration
  • Type checking enforcement via mypy

Documentation

  • CHANGELOG.md - This file! Complete release notes and migration guide
  • docs/rewrite/REWRITE_HISTORY.md - Comprehensive 3,843-line rewrite documentation
    • All planning, analysis, and completion documentation in single file
    • Organized chronologically with clear section separators
    • Complete narrative of entire rewrite process (Phases 1-8)
  • Enhanced README with bulk data download examples
  • Improved inline documentation with official Scryfall descriptions
  • All mixins now have comprehensive docstrings (149 properties documented)
  • All endpoint classes have detailed docstrings with examples

Changed

Type System Improvements

  • Mixin property return types now use specific TypedDict types
  • Better IDE autocomplete for nested objects (legalities, prices, image URIs)
  • Improved type inference throughout the codebase
  • More precise error detection during development

Project Organization

  • Consolidated rewrite documentation into single docs/rewrite/REWRITE_HISTORY.md
  • Moved all planning documents from root to docs/rewrite/ directory
  • Cleaner root directory with only essential documentation files
  • Better separation of historical documentation from current docs

API Structure (Non-Breaking on Rewrite Branch)

  • Simplified class names (removed redundant prefixes internally)
    • CardsNamedNamed (internal)
    • SetsByCodeByCode (internal)
    • BulkDataByTypeByType (internal)
  • Direct class imports from submodules instead of factory pattern
  • Read-only scryfall_data property returns SimpleNamespace instead of dict
    • Provides dot-notation access: card.scryfall_data.name
    • Prevents accidental mutation of internal data
    • Cached for performance

Code Quality

  • All code formatted with black (line length: 100)
  • All code passes ruff linting checks
  • All code passes mypy type checking
  • Modern Python 3.10+ features utilized
  • Consistent naming conventions throughout

README Updates

  • Added bulk data download examples
  • Updated rate limiting guidance
  • Added progress bar usage examples
  • Clarified caching recommendations
  • Added memory-efficient download examples

Fixed

Critical Bugs

  • Nullable property KeyError - All nullable properties now use .get() method

    • Fixed 74 nullable properties across cards_mixins.py and sets_mixins.py
    • Properties gracefully return None when keys are missing from API responses
    • Prevents crashes when Scryfall API returns incomplete data
  • to_object_array utility - Now handles missing keys for nullable array fields

    • all_parts and card_faces properties work correctly when data is missing
  • Test fixtures - Added missing required fields to mock API responses

    • Added uri field to bulk_data/by_id.json fixture

Pre-commit Configuration

  • Fixed hooks to only check scrython/ and tests/ directories
  • Added typing-extensions dependency for mypy
  • Configured proper file patterns for each hook

Development Changes

Python Version

  • Python 3.10+ now required (was 3.5.3+)
  • Leverages modern type hint syntax and language features

Project Structure

  • Reorganized into clear module hierarchy
  • Mixins separated from endpoint classes
  • Comprehensive test organization by module
  • Fixtures organized by endpoint type

Testing Improvements

  • 188 total tests (75 original + 113 new property tests)
  • Mock-based testing with realistic Scryfall responses
  • Comprehensive error case coverage
  • Parametrized tests for systematic property validation

1.11.1

Choose a tag to compare

@NandaScott NandaScott released this 26 Jul 02:50

Incrementing version to fix publish issues.

This version is tied to 1.11.0

1.11.0

Choose a tag to compare

@NandaScott NandaScott released this 26 Jul 02:45
bb126f9

What's Changed

New Contributors

Full Changelog: 1.10.1...1.11.0

1.10.1: Small bugfix

Choose a tag to compare

@NandaScott NandaScott released this 06 Sep 16:56

Bugfixes:

  • Incremented package version

1.10.0: Etched foils support

Choose a tag to compare

@NandaScott NandaScott released this 06 Sep 16:45
db147f8

Features:

  • Added support for class cards for image_uris (Thanks to @A7F !!)
  • Added support for the tcgplayer_etched_foil field
  • Added support for the finishes field
  • Updated unittests to reflect the above changes
  • Added deprecation warning to foil and nonfoil fields