Skip to content

isocsoft/pyisocapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyisocapi

The Pyisocapi library provides convenient access to the Isocapi API from apps written in Python. It includes client with multiple convenient methods to obtain data you need - both synchronously and asynchronously.

Isocapi documentantion

See our page: Isocapi

Instalation

pip install --upgrade pyisocapi

Requirements

  • Python 3.10+

Usage:

synchronous
from pyisocapi import IsocapiClient

api_key = "YOUR_API_KEY"
url = "OLX_URL"

client = IsocapiClient(api_key)
response = client.get_olx_by_url(url)

print(response)
>> IsocapiAPIResponse(data={'id': 1234, ...}]}, error='', message='Successfully retrieved data', success=True)

print(response.success)
>> True
asynchronous
import asyncio
from pyisocapi import IsocapiClient

async def main():
    api_key = "YOUR_API_KEY"
    url = "OLX_URL"

    client = IsocapiClient(api_key)
    response = await client.get_olx_by_url_async(url)

    print(response)

asyncio.run(main())

>> IsocapiAPIResponse(data={'id': 1234, ...}]}, error='', message='Successfully retrieved data', success=True)

print(response.success)
>> True

Payloads

Some of the methods (e.g. get_otodom_by_keyword) require more complex payloads that are wrapped in convenient types which can be imported from pyisocapi.payloads

Handling exceptions

Unsuccessful requests raise exceptions. The class of the exception will reflect the sort of error that occurred. To handle them yourself import them from pyisocapi.exceptions

Support

If you have encountered a bug or have any ideas how to improve this library - don't be afraid to open an issue with an explanation.

Releases

No releases published

Packages

No packages published

Languages