teleprint-me / coinbase-pro

Another Unofficial Python Wrapper for Coinbase Pro
GNU Affero General Public License v3.0
9 stars 3 forks source link

user guide #3

Closed amelesko closed 2 years ago

amelesko commented 2 years ago

hi teleprint-me, i was previously playing around with the old cbpro package and while that worked for some things, i noticed some issues and found your fork/new project. while i code in python, i'm more of a data scientist (vs dev) and so it's a little hard for me to immediately jump into using your package (perhaps because i code closer to the way cbpro did it...although maybe that's less robust :) - is there a user guide that i'm missing? if not, can i suggest something like this: https://algotrading101.com/learn/coinbase-pro-api-guide/ - this was very helpful for me with cbpro

teleprint-me commented 2 years ago

I wrote up a Quickstart Guide in the docs/ directory of the repository. You can also find a full abstract including an outline of the API in the docs/. I have a link included in the README.md that points to these resources as well. If you clone and develop something with it, the docs are included locally along with the repository as well.

I'm open to feedback and feel free to ask any questions that you might have.

Edit: I'm going to be testing a new workflow today to see if it works and that may affect the repository. So, you can always install a specific build if something ends up breaking today. Check out the releases and just have pip point to that build instead. Current stable release is Stable-Patch-v2.3.2. I should be releasing 2.4.x sometime today once I get everything ironed out.

amelesko commented 2 years ago

i see what you're saying now and it looks comprehensive, but I'd probably suggest having some very simple examples too. like is it possible to pull historical trade data or order data with just a couple lines of code?

teleprint-me commented 2 years ago

I'd probably suggest having some very simple examples too.

The library is just a REST API Wrapper. I covered the basic aspects of the API while avoiding assuming what might, or might not, be needed. If the REST API supports it, then I most likely implemented it.

The Quickstart Guide is a comprehensive guide that aims to cover the following topics:

I see no reason to duplicate documentation that already exists. I provide links to these resources in docs/README.md and docs/01-Quickstart.md. Further details about the CoinbasePro instance can be found in docs/04-Client.md.

I'm just a single independent developer. I only have so much time I can put into this library. You will have to do your due diligence in studying, and practicing, and learning about the REST API with the provided information and examples on your own.

is it possible to pull historical trade data or order data with just a couple lines of code?

This depends on what historical data you're looking for. I covered this in docs/04-Client.md by outlining the API. I also stated that you'll want to read the official docs for the REST API because you won't know how to compose valid arguments otherwise.

As an example... Let's say I want the fills for the order history in my account.

import json

from coinbase_pro.client import get_client
from pprint import pprint

def get_settings(filename: str) -> dict:
    data = None
    with open(filename, "r") as file:
        data = json.load(file)
    return data

client = get_client(get_settings("settings.json")["box"])
fills = client.order.fills({"product_id": "BTC-USD"})

pprint(fills)

I provided enough information in docs/01-Quickstart.md and docs/04-Client.md that should lead to this conclusion if you Read the Docs and experiment with it. I mention in the docs that you should be experimenting with the sandbox during development. I also provided examples and links to that information.

_Edit: If you need additional details that reference API specific information, then you can refer to the Coinbase API Reference. As an example, following the one outlined here, you can use the Orders -> Get All Fills API Reference to get specific information. I'll add this to the documentation at some point in the future._

teleprint-me commented 2 years ago

Added docs/08-Examples to commit 198fb32.