Skip to main content

Sync/async library for searching offers on Cian

Project description

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

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cian-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file cian-0.1.0.tar.gz.

File metadata

  • Download URL: cian-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for cian-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7db8bbbba485b49457e8e0456726a1d91c622bac5543d5c15cd673183979387a
MD5 f1a5ef6d6d219e268b4f460e8864fefc
BLAKE2b-256 d72c86e456bb62a221eea7cfec249f45d0f4ce39c2f152e3e39cba2c298d81a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page