Unofficial library for interaction with Cian
- Created library
- Add simple search
- 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
- Fix getting search results number
pip install cian
git clone https://github.com/OlegYurchik/cian.git
cd cian
and
pip install .
or
python setup.py install
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()