Skip to main content

Couchbase BLIP Protocol Library

Project description

Python BLIP

Pure Python implementation of the Couchbase BLIP sync protocol.

Installing

$ pip install pythonblip

Usage

from pythonblip.headers import SessionAuth
from pythonblip.replicator import Replicator, ReplicatorConfiguration, ReplicatorType
from pythonblip.output import LocalDB, LocalFile, ScreenOutput

host = "127.0.0.1"
database = "mobile"
connect_string = f"ws://{host}:4984"
directory = os.environ['HOME']
scope = "data"
collections = ["employees", "payroll"]

replicator = Replicator(ReplicatorConfiguration.create(
    database,
    connect_string,
    ReplicatorType.PULL,
    SessionAuth(options.session),
    scope,
    collections,
    LocalFile(directory)
))

try:
    replicator.start()
    replicator.replicate()
    replicator.stop()
except Exception as err:
    print(f"Error: {err}")

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

pythonblip-0.3.0.tar.gz (17.2 kB view hashes)

Uploaded Source

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