New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pythonblip

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pythonblip

Couchbase BLIP Protocol Library

pipPyPI
Version
0.2.0
Maintainers
1

Python BLIP

Pure Python implementation of the Couchbase BLIP sync protocol.

Installing

python3 -m venv venv
. venv/bin/activate
pip3 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"
port = "4984"
ssl = True
directory = os.environ['HOME']
scope = "data"
collections = ["employees", "payroll"]

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

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

Sync documents with 3.0 and earlier protocol (all documents in the _default scope and collection).

blipctl -n 127.0.0.1 -d database -t 9ec978de8f0fc172708cdbb9fc3f903a882883ec -f -D /home/sync/tests/output/ --ssl

Use new 3.1 and later style with scopes and collections.

blipctl -n 127.0.0.1 -d database -t 1eaccb9f9dc219a1b5d18e18e7f3d058efd1e9ff -s scope -c collection1,collection2,collection3 -f -D /home/sync/tests/output/ --ssl

Note: To get a session token you can use the SGWCLI:

./sgwcli auth session -h 127.0.0.1 -n database -U sgw@user --ssl

blipctl arguments:

OptionsDescription
--sslUse SSL
-n HOST, --host HOSTHostname or IP address
-P PORT, --port PORTPort number
-u USER, --user USERUser Name
-p PASSWORD, --password PASSWORDUser Password
-d DATABASE, --database DATABASESync Gateway Database
-t SESSION, --session SESSIONSession Token
-O, --screenOutput documents to the terminal
-f, --fileOutput documents to file(s)
-D DIR, --dir DIROutput Directory
-s SCOPE, --scope SCOPEScope
-c COLLECTIONS, --collections COLLECTIONSCollections
-vv, --debugDebug output
-v, --verboseVerbose output

Keywords

couchbase

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts