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

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

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.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: cian-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 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.1.tar.gz
Algorithm Hash digest
SHA256 9bf16f14704800b71e8b42fdf1a799115958e69c07bdaeb38571f7d32781d3ba
MD5 8e1d3cfed58877ebf922c85df97d4eb4
BLAKE2b-256 2d9a407722fe786c572755dd290096a53962d65ec166e0807df9201e1df405f5

See more details on using hashes here.

Supported by

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