GithubHelp home page GithubHelp logo

python_harness_feature_flags_play's Introduction

Harness Feature Flags with Python

This project demonstrates the use of Harness Feature Flags in a Python application. It fetches client data based on source IP and interacts with the Harness Feature Flags API to play with feature flags and variations.

Table of Contents

Prerequisites

  • Python 3.11 or higher
  • Docker (if you intend to run the application inside a container)

Installation

  1. Clone the repository:
git clone https://github.com/gacerioni/python_harness_feature_flags_play.git
cd python_harness_feature_flags_play
  1. (Optional) Create a virtual environment:
python3 -m venv venv
source venv/bin/activate
  1. Install the required packages:
pip install -r requirements.txt

Usage

Running the Script Directly

Execute the main script:

python3 main.py

Using Docker

  1. Build the Docker image:
docker build -t harness-feature-flags-python:v0.0.1 .
  1. Run the Docker container:
docker run -it -e FF_API_KEY=your_api_key -e FF_BASE_URL=your_base_url -e FF_EVENTS_URL=your_events_url -e FF_IP_INFO_URL=your_ip_info_url -e FF_CLIENT_ID=your_client_id -e FF_CLIENT_NAME=your_client_name harness-feature-flags-python:v0.0.1

Replace the placeholders (your_api_key, your_base_url, etc.) with your actual values. If you do not provide them, it will use default values configured in the code (since this is meant to be a Demo).

Environment Variables

You can override the default configuration by setting the following environment variables:

  • FF_API_KEY: Your Harness Feature Flags API key.
  • FF_BASE_URL: The base URL for the Harness Feature Flags API.
  • FF_EVENTS_URL: The events URL for the Harness Feature Flags API.
  • FF_IP_INFO_URL: The URL to fetch IP information.
  • FF_CLIENT_ID: The client ID for the Harness Feature Flags.
  • FF_CLIENT_NAME: The client name for the Harness Feature Flags.

Contact

For any questions or feedback, please reach out to:

License

This project is licensed under the MIT License. See the LICENSE file for details.

python_harness_feature_flags_play's People

Contributors

gacerioni avatar

Stargazers

 avatar

Watchers

Micah Martin avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.