Package: gym-http-server
Gym HTTP ServerThis project provides a local REST API to thegymopen-source library, allowing development in languages other than python.A python client is included, to demonstrate how to interact with the server.InstallationInstall the package using pip:pip install gym-http-serverUsageDirect UsageUse it simply from anywhere by callinggym-http-serverIf you would like to run on a specific port, use--listenand--portgym-http-server -l 127.0.0.1 -p 5000Pythonic UsageIf you want to use this inside your python script,from gym_http_server import start_server
start_server()If you want to specify ip and port,start_server(listen=='127.0.0.1', port==5000)API specificationPOST/v1/envs/Create an instance of the specified environmentparam:env_id-- gym environment ID string, such as 'CartPole-v0'returns:instance_id-- a short identifier (such as '3c657dbc')
for the created environment instance. The instance_id is
used in future API calls to identify the environment to be
manipulatedGET/v1/envs/List all environments running on the serverreturns:envs-- dict mappinginstance_idtoenv_id(e.g.{'3c657dbc': 'CartPole-v0'}) for every env on the serverPOST/v1/envs/<instance_id>/reset/Reset the state of the environment and return an initial
observation.param:instance_id-- a short identifier (such as '3c657dbc')
for the environment instancereturns:observation-- the initial observation of the spacePOST/v1/envs/<instance_id>/step/Step though an environment using an action.param:instance_id-- a short identifier (such as '3c657dbc')
for the environment instanceparam:action-- an action to take in the environmentreturns:observation-- agent's observation of the current
environmentreturns:reward-- amount of reward returned after previous actionreturns:done-- whether the episode has endedreturns:info-- a dict containing auxiliary diagnostic informationGET/v1/envs/<instance_id>/action_space/Get information (name and dimensions/bounds) of the env'saction_spaceparam:instance_id-- a short identifier (such as '3c657dbc')
for the environment instancereturns:info-- a dict containing 'name' (such as 'Discrete'), and
additional dimensional info (such as 'n') which varies from
space to spaceGET/v1/envs/<instance_id>/observation_space/Get information (name and dimensions/bounds) of the env'sobservation_spaceparam:instance_id-- a short identifier (such as '3c657dbc')
for the environment instancereturns:info-- a dict containing 'name' (such as 'Discrete'), and
additional dimensional info (such as 'n') which varies from
space to spacePOST/v1/envs/<instance_id>/monitor/start/Start monitoringparam:instance_id-- a short identifier (such as '3c657dbc')
for the environment instanceparam:force(default=False) -- Clear out existing training
data from this directory (by deleting every file
prefixed with "openaigym.")param:resume(default=False) -- Retain the training data
already in this directory, which will be merged with
our new data(NOTE: thevideo_callableparameter from the nativeenv.monitor.startfunction is NOT implemented)POST/v1/envs/<instance_id>/monitor/close/Flush all monitor data to diskparam:instance_id-- a short identifier (such as '3c657dbc')
for the environment instancePOST/v1/upload/Flush all monitor data to diskparam:training_dir-- A directory containing the results of a
training run.param:api_key-- Your OpenAI API keyparam:algorithm_id(default=None) -- An arbitrary string
indicating the paricular version of the algorithm
(including choices of parameters) you are running.POST/v1/shutdown/Request a server shutdownCurrently used by the integration tests to repeatedly create and destroy fresh copies of the server running in a separate threadForked from the archivedgym-http-apiLicenceThe MIT LicenseCopyright (c) 2019 Saravanabalagi RamachandranPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.