The Sape.ru client library is a software tool that allows users to access the services of the Russian advertising exchange platform Sape.ru. It provides a range of features, including access to the Sape API, management of user accounts and campaigns, and integration with other software applications.
Installation is simple and straightforward. Just install the `sape` package via easy_install, pip or from the repository. Speaking of which, the repository URL is readily available for you to access.
When it comes to usage, Sape is quite versatile. For instance, when using Sape in a Django project, you need to create a directory where local links database should be saved. After that, put 'sape.django' into settings.INSTALLED_APPS, and 'sape.django.context_processors.sape' into settings.TEMPLATE_CONTEXT_PROCESSORS. You also need to put the path to the local links database into settings.SAPE_DATABASE, your sape.ru account ID to settings.SAPE_USER, and site hostname to settings.SAPE_HOST. Finally, set up cron to run periodically the command `manage.py sape_refresh`. This command will download the fresh version of links database.
To use Sape in an arbitrary Python project, the process is different. Write a script that calls sape.provider.refresh_local_database function and passes it correct arguments (path to local database, sape.ru account ID, site hostname). Then call that script periodically with cron or anything else. Use sape.client.Client instance to get links for the page. Here's a quick example of Client usage:
from sape.client import Client
url = ''
client = Client('var/links.db', url)
links = client.links()
Another example of Provider usage is:
from sape.provider import refresh_local_database
refresh_local_database('var/links.db', 'sape.ru ID', 'mydomain.com').
Overall, Sape is a great tool that simplifies usage for both Django and arbitrary Python projects.
Version 0.1.1: N/A