featurehub-io/featurehub-python-sdk

Python SDK support

IrinaSouth opened this issue ยท 15 comments

Python - FeatureHub SDK

This product looks like a great option for my project's expansion of feature flag use, but I need a python API. Do you know the status of the Python SDK work?

Hi @jdgoldie, thanks for stopping by. We are planning to start the work on Python SDK in the next couple months. We also welcome anyone interested to contribute and help us to write the SDK. They are not particularly difficult to do as we have now examples with other languages.
Cheers!

Let me see what limits my employer puts on my participation. I am positive I could help beta-test the SDK but will see if I can contribute code as well.

this is now in progress under featurehub-python-sdk repo

@IrinaSouth is there any update on this body of work? Would be incredibly helpful as I have a Python/Django server that would greatly benefit from this being available.

Seconded @thedanchez! There's a possibility that I could help get it over the finish line depending on where its at right now.

Hey @thedanchez and @Jaribeau. Apologies, I haven't been actively looking at Python SDK for some time due to some other priorities. However I can see there is an interest from the community, so I will take a look in the next few days and will try to give you an update how much is left to do and some bullet points so we can track the progress high level. Contributions would be welcome of course. Cheers

@IrinaSouth yes, if you could give an idea that would be great. I'm not much of a Python dev (I'm frontend JS and just getting into Python) and have work coming up quickly that needs feature flag coordination on both the frontend and backend stack.

Hi @IrinaSouth, just following up on the bullet points. Are you able to share them?

From what I can see:

  • the ClientEvalFeatureContext and ServerEvalFeatureContext's need to be implemented.
  • there is no client side evaluation
  • there is no building of the context data to send for server side evaluation
  • there is no SSE (streaming) version

The structure is there, the core repository and the basic GET mechanism is there, but there is a fair bit of work to go. From a Django perspective, client side evaluation is the most important. You can see the typescript implementation here: https://github.com/featurehub-io/featurehub-javascript-sdk/blob/main/featurehub-javascript-client-sdk/app/strategy_matcher.ts

I'm not hugely familiar with Python but as I wrote the other SDKs (Irina is away) if I could get reviews I would be happy to dive in.

Hey guys, just to expand on the above comment, here is a little overview of the current state:

Currently the SDK can connect to the FH server, can serve the initial feature value.
However it doesn't update the value if it changes, so need to implement the mechanism:
There are 2 ways of getting features through:

  • Polling
  • Streaming
    Let's implement polling first: #10

Once we implement this, the SDK actually can be used to serve features via SDK REST polling mechanism. But of course, there will be still work to do as Richard mentioned above, if you want to use the targeting rules(context) along with the feature values.

I will start doing the polling implementation in the coming days.

This is exciting to hear @IrinaSouth! Thank you!

hi @thedanchez @Jaribeau, we have released a beta version of the SDK, please give it a go and let us know if you find any issues. We have managed to cover quite a few things, so there is now polling and streaming mechanism. Also the rollout strategies should work too. https://pypi.org/project/featurehub-sdk/

Amazing work @IrinaSouth and @rvowles! Thank you for getting this up! Will definitely give you feedback on it. Just got our FeatureHub instance up and running and we are setting up scaffolding for new JS/Python full-stack projects we're kicking off at my org.