Metadata-Version: 2.4
Name: cian-playwright
Version: 2.0.0
Summary: Parser for Cian.ru real estate listings (Playwright-based)
Author-email: Mikhail <tarminik@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/tarminik/cian-parser
Project-URL: Repository, https://github.com/tarminik/cian-parser
Project-URL: Issues, https://github.com/tarminik/cian-parser/issues
Keywords: cian,parser,real-estate,scraper,playwright
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: playwright>=1.40
Requires-Dist: playwright-stealth>=2.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# cian-parser

Playwright-based parser for [Cian.ru](https://cian.ru) real estate listings.

## Installation

```bash
pip install cian-parser
playwright install chromium
```

## Quick start

```python
from cian_parser import CianParser

with CianParser("Москва") as parser:
    # Sale
    flats = parser.get_flats(deal_type="sale", rooms=(1, 2))

    # Long-term rent
    rent = parser.get_flats(deal_type="rent_long", rooms="all")

    # Short-term rent
    daily = parser.get_flats(deal_type="rent_short")

    # Suburban
    houses = parser.get_suburban("house", deal_type="sale")

    # New construction
    newbuilds = parser.get_newobjects()
```

## API

### `CianParser(location, proxies=None)`

- **location** — city name (e.g. `"Москва"`). See `cian_parser.list_locations()` for all options.
- **proxies** — optional proxy URL string for Playwright.

### `get_flats(deal_type, rooms="all", with_saving_csv=False, with_extra_data=False, additional_settings=None)`

| Parameter | Type | Description |
|-----------|------|-------------|
| `deal_type` | `str` | `"sale"`, `"rent_long"`, or `"rent_short"` |
| `rooms` | `int \| str \| tuple` | `1`–`5`, `"studio"`, `"all"`, or tuple like `(1, 2, "studio")` |
| `with_saving_csv` | `bool` | Save results to CSV |
| `with_extra_data` | `bool` | Parse detail pages for extra fields (slower) |
| `additional_settings` | `dict` | Filters: `min_price`, `max_price`, `metro`, `district`, `sort_by`, etc. |

### `get_suburban(suburban_type, deal_type, ...)`

Same parameters as `get_flats`, plus:

| Parameter | Type | Description |
|-----------|------|-------------|
| `suburban_type` | `str` | `"house"`, `"house-part"`, `"land-plot"`, or `"townhouse"` |

### `get_newobjects(with_saving_csv=False)`

Parse new construction listings.

### Helpers

```python
from cian_parser import list_locations, list_metro_stations, list_districts

list_locations()              # [("Москва", "1"), ("Санкт-Петербург", "2"), ...]
list_metro_stations()         # {"Москва": [("Арбатская", "1"), ...], ...}
list_districts("Москва")      # [("Арбат", "13"), ...]
```

## License

[MIT](LICENSE)
