Skip to content

refactor(core): complete library rewrite with modern architecture#3

Merged
vlymar1 merged 8 commits into
devfrom
feature/save-cookies
Jan 4, 2026
Merged

refactor(core): complete library rewrite with modern architecture#3
vlymar1 merged 8 commits into
devfrom
feature/save-cookies

Conversation

@vlymar1
Copy link
Copy Markdown
Owner

@vlymar1 vlymar1 commented Jan 4, 2026

Summary

Complete refactor of the library with modernized client architecture, improved cookie persistence, and comprehensive documentation updates.

Key Changes

Core Architecture

  • Refactored VintedClient with clean async context manager pattern
  • Modernized HTTP session management with retry logic
  • Improved authentication handling with JWT token validation

Storage & Persistence

  • Added multiple cookie storage backends: JSON (default), Pickle, Mozilla
  • Configurable storage directory and format selection
  • Safe defaults with human-readable JSON format

Models & Parsing

  • Streamlined dataclass models for CatalogItem and DetailedItem
  • Improved field extraction and type safety
  • Better error handling for malformed API responses

Documentation

  • Complete README rewrite with clear examples
  • Added migration guide from v0.x to v1.0
  • Comprehensive exception handling documentation
  • Updated badges and project metadata

Testing & CI

  • Expanded test coverage for all modules
  • Updated CI workflows and automation scripts
  • Improved Makefile targets for development

Breaking Changes

  • Import path: vinted_api_kitvinted
  • Class name: VintedApiVintedClient
  • Proxy format: dict → simple string
  • Removed manual locale parameter (auto-detected)

How to Test

Run checks:

make lint-check
make test-coverage

Smoke test:

from vinted import VintedClient

async with VintedClient() as client:
    items = await client.search_items(
        url="https://www.vinted.com/catalog?search_text=test"
    )
    print(f"Found {len(items)} items")

Cookie persistence test:

# First run - saves cookies
async with VintedClient(persist_cookies=True, storage_format="json") as client:
    await client.search_items(url)

# Second run - reuses cookies (faster)
async with VintedClient(persist_cookies=True, storage_format="json") as client:
    await client.search_items(url)

Safety Notes

  • Default storage format is json (safe, portable)
  • pickle format available but documented as unsafe for untrusted data
  • No breaking changes for common usage patterns

Post-Merge Actions

  • Bump version in pyproject.toml to 1.0.0
  • Update CHANGELOG.md with release notes
  • Test build: hatch build
  • Publish to TestPyPI for validation
  • Publish to PyPI and create GitHub release tag

@vlymar1 vlymar1 merged commit df561d0 into dev Jan 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant