PHPackages                             alexsabur/yandex-realty-feed-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alexsabur/yandex-realty-feed-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alexsabur/yandex-realty-feed-generator
======================================

YRl feed generator

1.3.1(5y ago)0361MITPHPPHP &gt;=7.3

Since Jun 14Pushed 5y agoCompare

[ Source](https://github.com/AlexSabur/yandex-realty-feed-generator)[ Packagist](https://packagist.org/packages/alexsabur/yandex-realty-feed-generator)[ RSS](/packages/alexsabur-yandex-realty-feed-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (8)Used By (0)

Yandex Realty Language (YRL) files generator
--------------------------------------------

[](#yandex-realty-language-yrl-files-generator)

YRLGenerator is a simple php library, which provides clean way to create files, which are used to work with yandex realty service. It is based on YRL syntax and is fully valid.

Original documentation
----------------------

[](#original-documentation)

You can find original documentation on [yandex realty feed docs website](https://yandex.ru/support/realty/rules/content-requirements.html)

Installation
------------

[](#installation)

To install, simply type in your terminal following command:

`composer require alexsabur/yandex-realty-feed-generator`

And make sure, that php version &gt;= 7.3 and ext-xmlwriter is installed and enabled in your system

How to use it
-------------

[](#how-to-use-it)

The main workflow is the following:

```
use Windstep\YRLGenerator\YRLGenerator;
use Windstep\YRLGenerator\Offer;

$outputFilePath = __DIR__ . '/files/created_file.xml';
$temporaryFilePath = __DIR__ . '/files/tmp_file.xml';

$generator = new YRLGenerator($outputFilePath, $temporaryFilePath); // Note, that last one could be null
$generator->beforeWrite();
$offers = [new Offer(1, $data), new Offer(2, $data)]; // Offer keys (first value) must be unique
foreach ($offers as $offer) {
    $generator->bulkWrite($offer);
}
$generator->afterWrite();
```

How data must be added
----------------------

[](#how-data-must-be-added)

To work with data, you must know, that there are three types of data presented.

- Simple data, which is presented like $key =&gt; $value and will be converted to &lt;$key&gt;$value&lt;/$key&gt;
- Array data $key =&gt; $childKey =&gt; $value, which will be converted to &lt;$key&gt;&lt;$childKey&gt;$value&lt;/$childKey&gt;&lt;/$key&gt;
- Special data, like image array, which will be converted by special functions

You can use one of two available chooses to create array of data. Both of variants bellow produces equal result.

**WARNING** if you are using BOTH variants at the same time, values from fluent setters will overwrite data from array.

### Adding data using fluent setters

[](#adding-data-using-fluent-setters)

If you are using most recent version, you might use fluent setters on offer object, so you have to do it like so

```
$offer = new Offer(123456);
        $offer->setType(Type::SELL())
            ->setPropertyType(PropertyType::LIVING())
            ->setCategory(Category::FLAT())
            ->setLocation('Россия', null, null, 'Санкт-Петербург', null, '18-я линия В.О., 32')
            ->setMetro('Василеостровская')
            ->setPrice(4780000, Currency::RUB())
            ->setSalesAgent(null,
                '+7812500400',
                SalesAgentCategory::DEVELOPER(),
                'ЗАО "Застройщик"',
                'http://www.developer.ru/',
                null,
                'http://www.developer.ru/company/logo'
            )
            ->setRooms(2)
            ->setNewFlat()
            ->setBathroomUnit(BathroomUnit::SEPARATED())
            ->setBalcony(BalconyType::BALCONY())
            ->setFloor(13)
            ->setFloorsTotal(15)
            ->setBuildingName('Северная фантазия')
            ->setYandexBuildingId(12345)
            ->setYandexHouseId(54321)
            ->setBuildingSection('Корпус 1')
            ->setBuildingState(BuildingState::UNFINISHED())
            ->setReadyQuarter(3)
            ->setBuiltYear(2018)
            ->setBuildingPhase(3)
            ->setImage('http://www.developer.ru/images/plans/000001289.jpg')
            ->setDescription('Продается 2 к. кв., 13 этаж, 15 минут на машине до метро "Василеостровская". Дом комфорт-класса с продуманными планировочными решениями и широким выбором квартир. Внутренний двор «Северной фантазии» выполнен по эксклюзивному дизайн-проекту. В районе постройки нового ЖК развита инфраструктура: школы и детские сады, больница, аптеки магазины, кафе и спортивные центры. Доступны разные условия ипотеки, скидки и зачет жилья.')
            ->setArea(63.00, Unit::METER_SQUARE())
            ->setLivingSpace(50.00, Unit::METER_SQUARE())
            ->setKitchenSpace(10.00, Unit::METER_SQUARE())
            ->setRoomSpace(15, Unit::METER_SQUARE())
            ->setRoomSpace(35, Unit::METER_SQUARE())
            ->setCreationDate('2015-04-02T19:00:06+03:00');
```

### Adding data using arrays

[](#adding-data-using-arrays)

So, you must create array like following:

```
    $data = [
        'type' => 'продажа',
        'property-type' => 'жилая',
        'category' => 'квартира',
        'creation-date' => '2015-04-02T19:00:06+03:00',
        'location' => [
            'country' => 'Россия',
            'locality-name' => 'Санкт-Петербург',
            'address' => '18-я линия В.О., 32',
            'metro' => [
                'name' => 'Василеостровская'
            ],
        ],
        'price' => [
            'value' => 4780000,
            'currency' => 'RUR',
        ],
        'sales-agent' => [
            'phone' => '+7812500400',
            'organization' => 'ЗАО "Застройщик"',
            'url' => 'http://www.developer.ru/',
            'category' => 'developer',
            'photo' => 'http://www.developer.ru/company/logo',
        ],
        'rooms' => 2,
        'new-flat' => 1,
        'bathroom-unit' => 'раздельный',
        'balcony' => 'балкон',
        'floor' => 13,
        'floors-total' => 15,
        'building-name' => 'Северная фантазия',
        'yandex-building-id' => 12345,
        'yandex-house-id' => 54321,
        'building-section' => 'Корпус 1',
        'building-state' => 'unfinished',
        'ready-quarter' => 3,
        'built-year' => 2018,
        'building-phase' => 3,
        'image' => [
            'http://www.developer.ru/images/plans/000001289.jpg',
        ],
        'description' => 'Продается 2 к. кв., 13 этаж, 15 минут на машине до метро "Василеостровская".
                        Дом комфорт-класса с продуманными планировочными решениями и широким выбором квартир.
                        Внутренний двор «Северной фантазии» выполнен по эксклюзивному дизайн-проекту.
                        В районе постройки нового ЖК развита инфраструктура: школы и детские сады, больница, аптеки,
                        магазины, кафе и спортивные центры. Доступны разные условия ипотеки, скидки и зачет жилья.', // No html tags available here
        'area' => [
            'value' => 63.00,
            'unit' => 'кв. м',
        ],
        'living-space' => [
            'value' => 50.00,
            'unit' => 'кв. м',
        ],
        'kitchen-space' => [
            'value' => 10.00,
            'unit' => 'кв. м',
        ],
        'room-space' => [
            [
                'value' => 15,
                'unit' => 'кв. м',
            ],
            [
                'value' => 35,
                'unit' => 'кв. м',
            ]
        ],

    ]
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~107 days

Recently: every ~8 days

Total

7

Last Release

1881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e21453b68c4c530e157f96ec217a355c828cd6b821f1ec0cd8dd69f041fcbdc?d=identicon)[AlexSabur](/maintainers/AlexSabur)

---

Top Contributors

[![windstep](https://avatars.githubusercontent.com/u/51027899?v=4)](https://github.com/windstep "windstep (31 commits)")[![AlexSabur](https://avatars.githubusercontent.com/u/12692865?v=4)](https://github.com/AlexSabur "AlexSabur (20 commits)")[![SVV-team](https://avatars.githubusercontent.com/u/48009651?v=4)](https://github.com/SVV-team "SVV-team (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexsabur-yandex-realty-feed-generator/health.svg)

```
[![Health](https://phpackages.com/badges/alexsabur-yandex-realty-feed-generator/health.svg)](https://phpackages.com/packages/alexsabur-yandex-realty-feed-generator)
```

###  Alternatives

[sylius/refund-plugin

Plugin provides basic refunds functionality for Sylius application.

691.7M14](/packages/sylius-refund-plugin)[seboettg/citeproc-php

Full-featured CSL processor (https://citationstyles.org)

761.2M19](/packages/seboettg-citeproc-php)[timeweb/phpstan-enum

Enum class reflection extension for PHPStan

443.2M21](/packages/timeweb-phpstan-enum)[php-unit-conversion/php-unit-conversion

A fully PSR-4 compatible PHP library for converting between standard units of measure.

681.2M1](/packages/php-unit-conversion-php-unit-conversion)[open-feature/sdk

PHP implementation of the OpenFeature SDK

39514.9k15](/packages/open-feature-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
