goated


Namegoated JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/goatedsports/python-sdk
SummaryPython library for interacting with the Goated Exchange API.
upload_time2023-04-12 10:15:33
maintainer
docs_urlNone
authorGoated Core Team
requires_python>=3.9
licenseMIT
keywords goated betting trading sports sportsbetting exchange bet prediction market
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Goated Python Library

A handy library to interacting with, sourcing information from and trading on the Goated Exchange.

## Creating an authenticated Client to interact with the API using email and password

```
from goated.client import TradingClient

# Create a Goated Client Object to interact with the API
client = TradingClient.create_with_login(
    url = "https://api.goated.com",
    email = "YOUR_GOATED_EMAIL",
    password = "YOUR_GOATED_PASSWORD"
)

```

## Or using API Key and Secret (available from account tab)

```
from goated.client import TradingClient

# Create a Goated Client Object to interact with the API
client = TradingClient.create_with_api_key(
    url = "https://api.goated.com",
    api_key = "YOUR_GOATED_API_KEY",
    api_secret = "YOUR_GOATED_API_SECRET"
)

```

## Creating a State container, sourcing and loading some user information into the container

```
# Create a State Container object to hold relational state
state = Container()

# Get balances response from API
balances_response = client.get_balances()
# Add/update it within the state container
state.update_balances(balances_response)

# Get positions response from API
positions_response = client.get_positions() # Without any filters
# Add/update it within the state container
state.update_positions(positions_response)

# Get orders response from API
orders_response = client.get_orders() # Without any filters
# Add/update it within the state container
state.update_orders(orders_response)

print(state.__dict__)

```

## Sourcing information from the API 

```
# Get all categories
categories = client.get_categories()  # Without any filters

print('Categories:')
print(categories)

# Get subcategory record for first category
category_id = categories[0].get('id')
subcategories = client.get_subcategories(
    category_ids=[category_id]
) if category_id != None else []
print('Subcategories:')
print(subcategories)

# Get events in the first subcategory
subcategory_id = subcategories[0].get('id') if len(subcategories) > 0 else None
events = client.get_events(
    subcategory_ids=[subcategory_id]
) if subcategory_id != None else []
print('Events:')
print(events)

# Get all markets in the first event
event_id = events[0].get('id') if len(events) > 0 else None
markets = client.get_markets(
    event_id=[event_id]
) if event_id != None else []
print('Markets:')
print(markets)


```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/goatedsports/python-sdk",
    "name": "goated",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "goated,betting,trading,sports,sportsbetting,exchange,bet,prediction,market",
    "author": "Goated Core Team",
    "author_email": "cian@goated.com",
    "download_url": "https://files.pythonhosted.org/packages/08/40/5ba6b23ac2e2794aa2123581a59ee88b0753591091bbfdf396e9a53af44d/goated-0.0.6.tar.gz",
    "platform": null,
    "description": "# Goated Python Library\n\nA handy library to interacting with, sourcing information from and trading on the Goated Exchange.\n\n## Creating an authenticated Client to interact with the API using email and password\n\n```\nfrom goated.client import TradingClient\n\n# Create a Goated Client Object to interact with the API\nclient = TradingClient.create_with_login(\n    url = \"https://api.goated.com\",\n    email = \"YOUR_GOATED_EMAIL\",\n    password = \"YOUR_GOATED_PASSWORD\"\n)\n\n```\n\n## Or using API Key and Secret (available from account tab)\n\n```\nfrom goated.client import TradingClient\n\n# Create a Goated Client Object to interact with the API\nclient = TradingClient.create_with_api_key(\n    url = \"https://api.goated.com\",\n    api_key = \"YOUR_GOATED_API_KEY\",\n    api_secret = \"YOUR_GOATED_API_SECRET\"\n)\n\n```\n\n## Creating a State container, sourcing and loading some user information into the container\n\n```\n# Create a State Container object to hold relational state\nstate = Container()\n\n# Get balances response from API\nbalances_response = client.get_balances()\n# Add/update it within the state container\nstate.update_balances(balances_response)\n\n# Get positions response from API\npositions_response = client.get_positions() # Without any filters\n# Add/update it within the state container\nstate.update_positions(positions_response)\n\n# Get orders response from API\norders_response = client.get_orders() # Without any filters\n# Add/update it within the state container\nstate.update_orders(orders_response)\n\nprint(state.__dict__)\n\n```\n\n## Sourcing information from the API \n\n```\n# Get all categories\ncategories = client.get_categories()  # Without any filters\n\nprint('Categories:')\nprint(categories)\n\n# Get subcategory record for first category\ncategory_id = categories[0].get('id')\nsubcategories = client.get_subcategories(\n    category_ids=[category_id]\n) if category_id != None else []\nprint('Subcategories:')\nprint(subcategories)\n\n# Get events in the first subcategory\nsubcategory_id = subcategories[0].get('id') if len(subcategories) > 0 else None\nevents = client.get_events(\n    subcategory_ids=[subcategory_id]\n) if subcategory_id != None else []\nprint('Events:')\nprint(events)\n\n# Get all markets in the first event\nevent_id = events[0].get('id') if len(events) > 0 else None\nmarkets = client.get_markets(\n    event_id=[event_id]\n) if event_id != None else []\nprint('Markets:')\nprint(markets)\n\n\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for interacting with the Goated Exchange API.",
    "version": "0.0.6",
    "split_keywords": [
        "goated",
        "betting",
        "trading",
        "sports",
        "sportsbetting",
        "exchange",
        "bet",
        "prediction",
        "market"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f286a4e51c35001f31c0ba6597190eb8afd8f4ced32f5191b6f2f66ea91a5b9a",
                "md5": "9744ca935a99da94c05948f0435b9ee1",
                "sha256": "ed16b627c9b3bf08eadaf19f05218108186a3528e7b062598777995a55e0d62d"
            },
            "downloads": -1,
            "filename": "goated-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9744ca935a99da94c05948f0435b9ee1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 34919,
            "upload_time": "2023-04-12T10:15:30",
            "upload_time_iso_8601": "2023-04-12T10:15:30.326843Z",
            "url": "https://files.pythonhosted.org/packages/f2/86/a4e51c35001f31c0ba6597190eb8afd8f4ced32f5191b6f2f66ea91a5b9a/goated-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08405ba6b23ac2e2794aa2123581a59ee88b0753591091bbfdf396e9a53af44d",
                "md5": "f188d7d21d62c3d2a7b82d028dbb42d6",
                "sha256": "d4a8d46f09a44baade47b0eaa655828517f938ceab971470e7f90200a2408a2a"
            },
            "downloads": -1,
            "filename": "goated-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "f188d7d21d62c3d2a7b82d028dbb42d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25958,
            "upload_time": "2023-04-12T10:15:33",
            "upload_time_iso_8601": "2023-04-12T10:15:33.078536Z",
            "url": "https://files.pythonhosted.org/packages/08/40/5ba6b23ac2e2794aa2123581a59ee88b0753591091bbfdf396e9a53af44d/goated-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-12 10:15:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "goatedsports",
    "github_project": "python-sdk",
    "lcname": "goated"
}
        
Elapsed time: 0.05755s