For example, in this python module: https://github.com/bigcommerce/bigcommerce-api-python If I run this code:
#!/usr/bin/env python2
import bigcommerce
import bigcommerce.api
# Bigcommerce credentials and path
BIG_URL = 'store-45eg5.mybigcommerce.com'
BIG_USER = 'henry'
BIG_KEY = 'api_key'
# api object definition
api = bigcommerce.api.BigcommerceApi(host=BIG_URL, basic_auth=(BIG_USER, BIG_KEY))
def create_category(name):
rp = api.Categories.create(name=name)
#if rp.status_code == 201:
print(rp.status_code)
create_category('anothernewtestingcat12345')
I get this traceback:
Traceback (most recent call last):
File "./littletest.py", line 17, in <module>
create_category('anothernewtestingcat12345')
File "./littletest.py", line 16, in create_category
print(rp.status_code)
AttributeError: 'Categories' object has no attribute 'status_code'
My question is, in this context, is it possible to get a list of the attributes of a given object? Or would I have to refer to the documentation to determine what attributes the Categories object would have?
This question is not specific to the bigcommerce python api, it's a general question about how to determine the attributes of a given object, I've just used the bigcommerce python api as an example.
rp.__dict__ordir(rp), and you can div into the difference to learn more