{"id":24594285,"url":"https://github.com/freewheel/flipy","last_synced_at":"2025-04-30T13:12:48.157Z","repository":{"id":43108940,"uuid":"237094020","full_name":"freewheel/flipy","owner":"freewheel","description":"A Python linear programming interface library","archived":false,"fork":false,"pushed_at":"2022-03-18T04:30:07.000Z","size":13131,"stargazers_count":25,"open_issues_count":6,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-10T03:19:27.577Z","etag":null,"topics":["cbc","gurobi","linear-programming","pulp","python","solver"],"latest_commit_sha":null,"homepage":"https://freewheel.github.io/flipy","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freewheel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-29T22:21:24.000Z","updated_at":"2023-07-26T02:01:42.000Z","dependencies_parsed_at":"2022-08-30T00:21:16.502Z","dependency_job_id":null,"html_url":"https://github.com/freewheel/flipy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewheel%2Fflipy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewheel%2Fflipy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewheel%2Fflipy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freewheel%2Fflipy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freewheel","download_url":"https://codeload.github.com/freewheel/flipy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235426487,"owners_count":18988420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cbc","gurobi","linear-programming","pulp","python","solver"],"created_at":"2025-01-24T11:14:10.630Z","updated_at":"2025-01-24T11:14:12.055Z","avatar_url":"https://github.com/freewheel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flipy\n\n![flipy_logo_60pt](https://user-images.githubusercontent.com/1311594/73421313-6cea4500-42f3-11ea-9ea7-25a0af70ac4f.png)\n\n[![supported](https://img.shields.io/pypi/pyversions/flipy.svg)](https://pypi.python.org/pypi/flipy/)\n[![Build Status](http://img.shields.io/travis/freewheel/flipy.svg?style=flat-square)](https://travis-ci.com/freewheel/flipy) \n[![Coverage](https://coveralls.io/repos/github/freewheel/flipy/badge.svg?branch=master)](https://coveralls.io/github/freewheel/flipy)\n\nFlipy is a Python linear programming interface library, originally developed by [FreeWheel](https://freewheel.com). It currently supports Gurobi and CBC as the backend solver.\n\nTo use Gurobi, make sure you have a Gurobi license file, and gurobipy is installed in your Python environment. You can find details from [Gurobi’s documentation](https://www.gurobi.com/documentation/8.1/quickstart_mac/the_gurobi_python_interfac.html).\n\nFlipy requires Python 3.6 or newer.\n\n## Installation\n\nThe latest offical version of Flipy can be installed with `pip`:\n\n\n```\npip install flipy\n```\n\nThe latest development version can be get with Git:\n\n```\ngit clone https://github.com/freewheel/flipy.git\ncd flipy\npython setup.py install\n```\n\n## Quickstart\n\nHere is a simple example for Flipy:\n\n```python\nimport flipy\n\n# 1 \u003c= x \u003c= 3.5\nx = flipy.LpVariable('x', low_bound=1, up_bound=3.5)\n# 2 \u003c= y \u003c= 4\ny = flipy.LpVariable('y', low_bound=2, up_bound=4)\n\n# 5x + y \u003c= 12\nlhs = flipy.LpExpression('lhs', {x: 2.5, y: 1})\nrhs = flipy.LpExpression('rhs', constant=12) \nconstraint = flipy.LpConstraint(lhs, 'leq', rhs)\n\n# maximize: 3x + 2y\nobjective = flipy.LpObjective('test_obj', {x: 3, y: 2}, sense=flipy.Maximize)\nproblem = flipy.LpProblem('test', objective, [constraint])\n\nsolver = flipy.CBCSolver()\nstatus = solver.solve(problem)\n```\n\n## Get the solution \n\nAfter solving, a status is returned to indicate whether the solver has found a optimal solution for the problem:\n\n```python\nprint(status)\n# \u003cSolutionStatus.Optimal: 1\u003e\n```\n\nThe objective value can be retrieved with `objective.evaluate()`:\n\n```python\nprint(objective.evaluate())\n# 17.6\n```\n\nThe value of variables can be retrieved with `.evaluate()` as well:\n\n```python\nprint(x.evaluate())\n# 3.2\nprint(y.evaluate())\n# 4.0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreewheel%2Fflipy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreewheel%2Fflipy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreewheel%2Fflipy/lists"}