Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pysonic-channel

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pysonic-channel

Python client for sonic search backend

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

Sonic Channel

Python client for sonic search backend.

We recommend you start with the documentation.

Installation

pip install pysonic-channel

Example usage

Search channel

Note: This example requires enabling the search feature, enabled by default.

from sonic import IngestChannel, SearchChannel, ControlChannel

querycl = SearchChannel("localhost:1491", "SecretPassword")
print(querycl.ping())
print(querycl.query("wiki", "articles", "for"))
print(querycl.query("wiki", "articles", "love"))
print(querycl.suggest("wiki", "articles", "hell"))

Ingest channel

Note: This example requires enabling the ingest feature.

from sonic import IngestChannel, SearchChannel, ControlChannel

ingestcl = IngestChannel("localhost:1491", "SecretPassword")
print(ingestcl.ping())
ingestcl.push("wiki", "articles", "article-1", "for the love of god hell")
ingestcl.push("wiki", "articles", "article-2", "for the love of satan heaven")
ingestcl.push("wiki", "articles", "article-3", "for the love of lorde hello")
ingestcl.push("wiki", "articles", "article-4", "for the god of loaf helmet")

Control channel

Note: This example requires enabling the control feature.

from sonic import IngestChannel, SearchChannel, ControlChannel

controlcl = ControlChannel("localhost:1491", "SecretPassword")
print(controlcl.ping())
print(controlcl.consolidate())

Available features

  • default - ["search", "ingest", "control"]
  • search - Add sonic search mode with methods
  • ingest - Add sonic ignite mode with methods
  • control - Add sonic control mode with methods

Keywords

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc