Sync/async library for searching offers on Cian
Project description
Cian
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
tocian
- 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 returndict
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
Release history Release notifications | RSS feed
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 hashes)