Skip to content

Async unofficial library for interaction with cian.ru

License

Notifications You must be signed in to change notification settings

OlegYurchik/cian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cian

MIT license built with Python3

Description

Unofficial library for interaction with Cian

Contents

Release Notes

Version 0.0.1

  • Created library
  • Add simple search

Version 0.1.0

  • Rename library - from aiocian to cian
  • Restructured library - make library closer with Cian API
  • Edit constants - now constants is enum.Enum instance
  • Delete heavy logic creation request data
  • Delete creation Result object - now return dict object
  • Add empty tests

Version 0.1.1

  • Fix getting search results number

Getting Started

Installation from pip

pip install cian

Installation from GitHub

git clone https://github.com/OlegYurchik/cian.git
cd cian

and

pip install .

or

python setup.py install

Quick Start

After installation, you can use the library in your code.

Sync example

from cian import CianClient, constants


def main(cian_client):
    for offer in cian_client.search(
            region=constants.Region.SPB,
            ad_type=constants.AdType.FLAT_SALE,
    ):
        print(result["fullUrl"])


if __name__ == "__main__":
    cian_client = CianClient()
    main(cian_client)

Async example:

import asyncio

from cian import CianClient, constants


async def main(cian_client):
    async for offer in cian_client.search(
            region=constants.Region.SPB,
            ad_type=constants.AdType.FLAT_SALE,
    ):
        print(result["fullUrl"])


if __name__ == "__main__":
    cian_client = CianClient()
    
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main(cian_client))
    loop.close()

About

Async unofficial library for interaction with cian.ru

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages