SDK for writing lookout analyzers
Project description
lookout-sdk
![GoDoc](https://pypi-camo.freetls.fastly.net/0865b32ffef1a8b860265e1c7c89ce0769031687/68747470733a2f2f676f646f632e6f72672f676f706b672e696e2f7372632d642f6c6f6f6b6f75742d73646b2e76303f7374617475732e737667)
Toolkit for writing new analyzers for source{d} Lookout.
What Does the SDK Provide?
For the complete documentation of source{d} Lookout, please take a look at https://docs.sourced.tech/lookout.
For detailed information about the different parts of Lookout, and how they interact you can go to the Lookout architecture guide.
lookout-sdk provides:
- proto definitions.
- pre-generated libraries for Golang and Python, offering:
- an easy access to the DataService API though a gRPC service. Lookout will take care of dealing with Git repositories, UAST extraction, programming language detection, etc.
- low-level helpers to work around some protobuf/gRPC caveats.
- quickstart examples of an Analyzer that detects language and number of functions (written in Go and in Python).
Caveats
For the gRPC client and server please follow these requirements:
- set a common maximum gRPC message size in gRPC servers and clients. This is required to avoid hitting different gRPC limits when handling UASTs, that can be huge —see grpc/grpc#7927—. To do so use the included helpers in lookout-sdk:
- go: using
pb.NewServer
andpb.DialContext
. - python: using
lookout.sdk.grpc.create_channel
.
- go: using
- support RFC 3986 URI scheme; lookout-sdk includes helpers for this:
- go: using
pb.ToGoGrpcAddress
andpb.Listen
. - python: using
lookout.sdk.grpc.to_grpc_address
.
- go: using
DataService
When DataService is being dialed, you should:
- disable secure connection:
- turn off gRPC fail-fast mode if your analyzer creates a connection to DataServer before it was actually started. This way the RPCs are queued until the chanel is ready:
- go: using
grpc.FailFast(false)
(example).
- go: using
Contributing
Contributions are welcome and very much appreciated 🙌
Please refer to our Contribution Guide for more details.
Community
source{d} has an amazing community of developers and contributors who are interested in Code As Data and/or Machine Learning on Code. Please join us! 👋
Code of Conduct
All activities under source{d} projects are governed by the source{d} code of conduct.
License
Apache License Version 2.0, see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for lookout_sdk-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2953fdad14bb1760a3fe37d3087c02def29c2e1efd17c612fa45baa9467c3ddf |
|
MD5 | bae324ec1ed8f89c740f82023620f631 |
|
BLAKE2b-256 | ffe4612db5cd557d2c11aaadbf9ebc182dfc1657a0e5e5e5ffa80711269d63c3 |