1- # vinted-api-kit
1+ < div align = " center " >
22
3- ** Lightweight asynchronous Python client library for accessing Vinted API and scraping item data.**
3+ ![ Vinted Api Kit] ( ./assets/logo.png )
4+
5+ *** Lightweight asynchronous Python client library for accessing Vinted API and scraping item data.***
46
57[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( LICENSE )
68
9+ </div >
10+
11+ ---
12+ ## ✨ Features
13+
14+ - 🚀 ** Asynchronous** - Built with asyncio for high performance
15+ - 🌍 ** Multi-locale** - Supports multiple Vinted domains (FR, DE, US, etc.)
16+ - 🔍 ** Item Search** - Search catalog with filters and pagination
17+ - 📦 ** Item Details** - Get complete item information
18+ - 🍪 ** Cookie Persistence** - Automatic session management
19+ - 🔐 ** Proxy Support** - Built-in proxy configuration
20+ - 📊 ** Type Hints** - Full typing support for better IDE experience
21+
722---
23+ ## 📚 Table of Contents
824
25+ - [ Installation] ( #installation )
26+ - [ Quick Start] ( #quick-start )
27+ - [ Configuration] ( #configuration )
28+ - [ Development] ( #development )
29+ - [ Changelog] ( #changelog )
30+ - [ License] ( #license )
31+
32+ ---
933## Installation
1034
1135Install via pip:
@@ -16,65 +40,109 @@ Or using poetry:
1640``` bash
1741poetry add vinted-api-kit
1842```
19- ---
2043
44+ ---
2145## Quick Start
2246
2347``` python
2448import asyncio
25- from vinted_api_kit import VintedApi
49+ from vinted_api_kit import VintedApi, CatalogItem, DetailedItem
2650
2751async def main ():
2852 async with VintedApi(locale = " fr" ) as vinted:
29- items = await vinted.search_items(
30- url = " https://www.vinted.fr/catalog?search_text=adidas"
53+ # Get detailed item information
54+ item_detail: DetailedItem = await vinted.item_details(
55+ url = " https://www.vinted.fr/items/922704975-adidas-x-15"
56+ )
57+ print (f " 📦 { item_detail.title} " )
58+ print (f " 💰 { item_detail.price} \n " )
59+
60+ # Search for items
61+ items: list[CatalogItem] = await vinted.search_items(
62+ url = " https://www.vinted.fr/catalog?search_text=adidas" ,
63+ per_page = 5
3164 )
65+
66+ print (" 🔍 Search results:" )
3267 for item in items:
33- print (f " { item.title} : { item.price} { item.currency} " )
68+ print (f " • { item.title} - { item.price} { item.currency} " )
3469
35- asyncio.run(main())
70+ if __name__ == " __main__" :
71+ asyncio.run(main())
3672```
3773
38-
3974---
40-
4175## Configuration
4276
43- - ` locale ` - locale string for API requests, e.g. ` 'fr' ` , ` 'de' ` , ` 'us' ` .
44- - ` proxies ` - dictionary of proxy settings if needed.
45- - ` client_ip ` - optional IP header override.
46- - ` cookies_dir ` - directory path for persisting cookies.
47- - ` persist_cookies ` - boolean to enable or disable cookie persistence.
77+ ### Basic usage
78+ ``` python
79+ from vinted_api_kit import VintedApi
80+
81+ async with VintedApi(locale = " fr" ) as vinted:
82+ pass
83+ ```
84+
85+ ### Advanced configuration
86+ ``` python
87+ from vinted_api_kit import VintedApi
88+
89+ async with VintedApi(
90+ locale = " de" ,
91+ proxies = {" http" : " http://proxy:8080" },
92+ client_ip = " 192.168.1.1" ,
93+ cookies_dir = " ./cookies" ,
94+ persist_cookies = True
95+ ) as vinted:
96+ pass
97+ ```
98+
99+ ** Parameters:**
100+ - ` locale ` - Vinted domain locale (` 'fr' ` , ` 'de' ` , ` 'us' ` , etc.)
101+ - ` proxies ` - Proxy configuration (requests format)
102+ - ` client_ip ` - Override client IP header
103+ - ` cookies_dir ` - Directory for cookie storage
104+ - ` persist_cookies ` - Enable/disable cookie persistence
48105
49106These can be set when creating an instance of the ` VintedApi ` class.
50107
51108No additional environment variables are required by default.
52109
53110---
111+ ## 🛠️ Development
54112
55- ## Run tests:
56-
113+ ### Setup
57114``` shell
58- poetry run pytest -v
115+ git clone https://github.com/vlymar1/vinted-api-kit.git
116+ cd vinted-api-kit
59117```
118+ * Install dependencies (you'll need to set up your dev environment)*
119+ ### Testing
60120
61- ## Run linters and formatters:
121+ ``` shell
122+ make test-coverage # run tests with coverage
123+ make test-coverage-view # view coverage report in browser
124+ ```
62125
63- To lint and format your code with ruff, run:
126+ ### Code Quality
64127
65128``` shell
66- poetry run ruff check vinted_api_kit tests dev
67- poetry run ruff check --fix vinted_api_kit tests dev # to auto- fix issues where possible
129+ make lint-check # check code with ruff and mypy
130+ make lint-reformat # format and fix code with ruff
68131```
69132
70- Please configure ruff with a ` pyproject.toml ` or ` .ruff.toml ` file for your preferred rules.
133+ ### Cleanup
71134
72- Make sure to follow PEP8 style guidelines.
73-
74- It is recommended to set up pre-commit hooks with ruff for automatic linting on git operations.
135+ ``` shell
136+ make clean # remove cache files and build artifacts
137+ ```
75138
76- Contributions are welcome! Please open issues or pull requests.
139+ ** Development Guidelines:**
140+ - Follow PEP8 style guidelines
141+ - Configure ruff in ` pyproject.toml ` for your preferred rules
142+ - Set up pre-commit hooks for automatic linting
143+ - Contributions welcome! Please open issues or pull requests
77144
145+ ---
78146## Changelog
79147
80148See [ ` CHANGELOG.md ` ] ( CHANGELOG.md ) for the list of notable changes per version.
@@ -95,13 +163,11 @@ See [`CHANGELOG.md`](CHANGELOG.md) for the list of notable changes per version.
95163 - Conventional commits combined with [ semantic-release] ( https://semantic-release.gitbook.io/semantic-release/ )
96164
97165---
98-
99166## License
100167
101168This project is licensed under the MIT License - see the [ LICENSE] ( LICENSE ) file for details.
102169
103170---
104-
105171## Maintainers / Contacts
106172
107173- GitHub: [ https://github.com/vlymar1 ] ( https://github.com/vlymar1 )
0 commit comments