Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiedanski/pymarket
PyMarket is a python library aimed to ease the design, simulation and comparison of different market mechanisms.
https://github.com/kiedanski/pymarket
auctions energy game-theory market market-mechanisms simulation
Last synced: 17 days ago
JSON representation
PyMarket is a python library aimed to ease the design, simulation and comparison of different market mechanisms.
- Host: GitHub
- URL: https://github.com/kiedanski/pymarket
- Owner: kiedanski
- License: mit
- Created: 2019-06-19T09:25:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:47:41.000Z (almost 2 years ago)
- Last Synced: 2024-05-28T16:30:24.972Z (6 months ago)
- Topics: auctions, energy, game-theory, market, market-mechanisms, simulation
- Language: Python
- Homepage: https://pymarket.readthedocs.io/en/latest/
- Size: 649 KB
- Stars: 25
- Watchers: 1
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.ipynb
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
{
"cells": [
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"tags": [
"remove_cell"
]
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import pandas as pd\n",
"pd.set_option('display.notebook_repr_html', False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PyMarket"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Build Status](https://travis-ci.org/gus0k/pymarket.svg?branch=master)](https://travis-ci.org/gus0k/pymarket)\n",
"\n",
"[![Documentation Status](https://readthedocs.org/projects/pymarket/badge/?version=latest)](https://pymarket.readthedocs.io/en/latest/?badge=latest)\n",
"\n",
"[![PyPI version](https://badge.fury.io/py/pymarket.svg)](https://badge.fury.io/py/pymarket)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"PyMarket is a python library designed to ease the simulation and\n",
"comparison of different market mechanisms.\n",
"\n",
"Marketplaces can be proposed to solve a diverse array of problems. They\n",
"are used to sell ads online, bandwith spectrum, energy, etc.\n",
"PyMarket provides a simple environment to try, simulate and compare different\n",
"market mechanisms, a task that is inherent to the process of establishing a new\n",
"market.\n",
"\n",
"As an example, Local Energy Markets (LEMs) have been proposed to syncronize energy consumption\n",
"with surplus of renewable generation. Several mechanisms have been proposed for such a market:\n",
"from double sided auctions to p2p trading. \n",
"\n",
"This library aims to provide a simple interface for such process, making results reproducible."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Getting Started"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGx1JREFUeJzt3X2UVPWd5/H3l+Y5ahx5SJSnhgiOGLDBBjQ+0Co+4sLiaFBmmBjl9OIGR9eYXTKuCfEcc3azaiCSo+moAWdB3OATeNwENyNGN0HohhYDHR6CRHok8pCIYEDA/u4f9/bdounuqq6u27e66vM6p0/XrbpV9b3Y1qd+D/d3zd0REREB6JJ0ASIikj8UCiIiElEoiIhIRKEgIiIRhYKIiEQUCiIiEoktFMxskJm9bmZ1ZrbJzO5uZp8KMztgZrXhz3fiqkdERNLrGuNrHwe+6e7rzexUoMbMXnP3zU32e9Pdb4ixDhERyVBsLQV33+3u68PbB4E6YEBc7yciIu0XZ0shYmalwBjg7WYevsjM3gE+AO5z902tvVbfvn29tLQ01yWKiBS0mpqafe7eL91+sYeCmZ0CPA/c4+4fN3l4PTDE3Q+Z2fXAS8DwZl6jEqgEGDx4MNXV1TFXLSJSWMzsj5nsF+vsIzPrRhAIS9z9haaPu/vH7n4ovP0q0M3M+jazX5W7l7t7eb9+aYNORESyFOfsIwOeAurc/dEW9vliuB9mNj6sZ39cNYmISOvi7D66GJgJvGtmteF9/wwMBn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AMyaNYudO3cyduxY3J1+/frx0ksvZfza8+bN4+abb2bAgAFceOGFvPfee63uP3bsWKZPn05ZWRlDhgzh0ksvbdexiUjxsM62KGl5ebk3vchOXV0d5557bkIVdW76t5NCVlER/NaUVDCzGncvT7efuo9ERCSiUBARkYhCQUREIgoFERGJKBRERCSiUBARkYhCIYceeughzjvvPEaPHk1ZWRlvv/12Tl+/tLSUffv25fQ1RURS6eS1HPntb3/LK6+8wvr16+nRowf79u3j6NGjSZclItImainkyO7du+nbt2+0FlHfvn0566yzTvh2X11dTUV4Ns28efOYOXMmV1xxBcOHD+enP/0pEKyHdNlllzFt2jRGjhzJ7NmzT7pYzwMPPMCCBQui7fvvv/+EZbNFRLJVcC2FpFbOvvrqq3nwwQcZMWIEkyZNYvr06UycOLHV52zcuJE1a9bwySefMGbMGCZPngzA2rVr2bx5M0OGDOHaa6/lhRde4Kabboqed8cdd3DjjTdy991309DQwLJly1i7dm27j1NERC2FHDnllFOoqamhqqqKfv36MX36dBYtWtTqc6ZOnUqvXr3o27cvl19+efTBPn78eIYNG0ZJSQm33norb7311gnPKy0tpU+fPmzYsIFVq1YxZswY+vTpE9ehiUgRKbiWQpIrZ5eUlFBRUUFFRQWjRo1i8eLFdO3aNer+OXLkyAn7N13eunG7pftTzZo1i0WLFvGnP/2J22+/PZeHISJFTC2FHNmyZQvbtm2LtmtraxkyZAilpaXU1NQA8Pzzz5/wnJdffpkjR46wf/9+Vq9ezbhx44Cg++i9996joaGB5557jksuueSk95s2bRq/+MUvWLdu3UnXaRARyVbBtRSScujQIe666y4++ugjunbtytlnn01VVRV1dXXccccdfP/732fChAknPGf8+PFMnjyZ999/nwceeICzzjqLrVu3ctFFFzF37lzefffdaNC5qe7du3P55Zdz+umnU1JS0lGHKSIFTqGQIxdccAG/+c1vTrr/0ksvZevWrc0+Z8SIEVRVVZ10f+/evXnuuedOun/nzp3R7YaGBtasWcPPf/7z7IsWEWlC3Ued0ObNmzn77LO58sorGT58eNLliEgBUUshIanXW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Hf/axI1FEUohAM3c4BfEvzR/y9335RsVW12MTCT4Jt1bfhzfdJFFbG7gCVmthEoA76fcD1tFrZ0lgPrgXcJPg8SP6M2HTN7FvgtcI6Z1ZvZHcB/A64ys23AVeF2XmvhOBYCpwKvhf+PP9HhdemMZhERaVQULQUREcmMQkFERCIKBRERiSgUREQkolAQEZGIQkGKmpkNNLOXw9U1d5jZQjPrkeP3qDCzr6Rszzazfwxv32ZmZ+Xy/UTaQ6EgRSs8YesF4KVwdc3hQC/gBzl+qwpSzhR29yfc/Zlw8zaCJSZE8oLOU5CiZWZXAt9198tS7jsN+CPwAPC37j4nvP8V4GF3X21mjwPjCAJkubt/N9xnJ8EKnf8O6AbcDBwhWO3yM4JF9O4iOHP4ELCTYPnkfwMOA/cDs9x9Wvh6VwF3uvuNsf0jiDShloIUs/OAExbmCxcZ3Emw6F1L7nf3cmA0MNHMRqc8ts/dxwKPA/e5+07gCeCH7l7m7m+mvNdyoJpgjZsy4FXgXDPrF+7ydeBn7Tg+kTZTKEgxM5pfLbe5VXVTfdXM1gMbCIIl9WJHjQsV1gClbSkmXPzsX4B/CK+4dREJLJ0sxa21b0MihW4T8Hepd4TdR18A9gMjUh7qGT4+FLgPGOfufzGzRY2PhT4Nf39Gdv9//QxYSdDt9POUC66IdAi1FKSY/QronTITqAR4hGBRsveAMjPrYmaDCK7eB3AawfUTDpjZFwgu8ZrOQYJFztI+5u4fECzr/l8JxhtEOpRCQYpW2F0zDbgpXF1zP9Dg7g8B/5cgGN4luDpZ46VQ3yHoNtoEPB3ul85KYFq46uWlTR5bBDwRPtYrvG8JsMvdO+Ny3NLJafaRSCg8l+BZ4MYkrwxnZguBDe7+VFI1SPFSKIjkETOrIeieusrdP023v0iuKRRERCSiMQUREYkoFEREJKJQEBGRiEJBREQiCgUREYkoFEREJPL/AGgkGDkE73FcAAAAAElFTkSuQmCC\n",
"text/plain": [
""
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import pymarket as pm\n",
"import numpy as np\n",
"\n",
"r = np.random.RandomState(1234)\n",
"\n",
"mar = pm.Market()\n",
"bids = pm.datasets.uniform_bidders.generate(20, 20, 1, 1, r)\n",
"for b in bids:\n",
" mar.accept_bid(*b)\n",
" \n",
"mar.plot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Access the bids"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
" quantity price user buying time divisible\n",
"0 0.2374 1.0234 0 True 0 True\n",
"1 0.1784 1.1770 1 True 0 True\n",
"2 0.6301 1.5789 2 True 0 True\n",
"3 0.1600 1.8008 3 True 0 True\n",
"4 0.7920 1.5478 4 True 0 True"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bids = mar.bm.get_df()\n",
"bids.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run a market algorithm"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
" bid quantity price source active\n",
"0 16 0.0000 0.0000 34 True\n",
"1 34 0.0000 0.0000 16 True\n",
"2 0 0.0000 0.0000 23 True\n",
"3 23 0.0000 0.0000 0 True\n",
"4 12 0.0786 1.3828 26 False"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"transactions, extra = mar.run('p2p', r=r)\n",
"transactions = transactions.get_df()\n",
"transactions.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Documentation and Examples\n",
"\n",
"[Docs can be found here (click me!)](https://pymarket.readthedocs.io)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Installation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```python\n",
"pip install pymarket\n",
"```"
]
}
],
"metadata": {
"celltoolbar": "Edit Metadata",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}