Skip to content

priceloop/priceloop-api-python

Repository files navigation

priceloop-api-python

A client library for accessing Priceloop API

Install

pip install priceloop-api 

Usage

First, create a PriceloopClient:

frompriceloop_api.priceloop.authimportPriceloopClientclient=PriceloopClient.with_credentials("username", "password")

read and write to nocode:

importpandasaspdfrompriceloop_api.priceloop.dataimportto_nocode, read_nocode# write to nocodedata= [["Alex", 10], ["Bob", 12], ["Clarke", 13]] df=pd.DataFrame(data, columns=["Name", "Age"]) to_nocode(df, "table_name", client) # read from nocodenew_df=read_nocode("table_name", client, limit=limit, offset=offset)

call your endpoint, example:

frompriceloop_api.api.workspace_apiimportlist_workspaces, get_workspaceworkspaces=list_workspaces.sync(client=client) workspace=get_workspace.sync(workspaces[0], client=client)

add columns to existing table:

frompriceloop_api.api.column_apiimportadd_data_column, add_formula_columnfrompriceloop_api.modelsimportAddDataColumnTypeadd_data_column.sync(workspace.name, "table_name", "column_name", type=AddDataColumnType.STRING, client=client) add_formula_column.sync(workspace.name, "table_name", "column_name", "expression", client=client)

Things to know:

  1. Every path/method combo becomes has four functions:

    1. sync: Blocking request that returns parsed data (if successful) or None
    2. sync_detailed: Blocking request that always returns a Request, optionally with parsed set if the request was successful.
    3. asyncio: Like sync but async instead of blocking
    4. asyncio_detailed: Like sync_detailed but async instead of blocking
  2. All path/query params, and bodies become method arguments.

  3. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)

  4. Any endpoint which did not have a tag will be in priceloop_api.api.default

About

🔌 Connect to your Priceloop Data through our Python API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 11

Languages