Skip to content

Lordshell/BLF-PIM-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

The Akeneo API brought to you!

How to Build

You must have Python 2 >=2.7.9 or Python 3 >=3.4 installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc. These dependencies are defined in the requirements.txt file that comes with the SDK. To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps at https://pip.pypa.io/en/stable/installing/.

Python and PIP executables should be defined in your PATH. Open command prompt and type pip --version. This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.

  • Using command line, navigate to the directory containing the generated files (including requirements.txt) for the SDK.
  • Run the command pip install -r requirements.txt. This should install all the required dependencies.

Building SDK - Step 1

How to Use

The following section explains how to use the Akkblfpim23 SDK package in a new project.

1. Open Project in an IDE

Open up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

Open project in PyCharm - Step 1

Click on Open in PyCharm to browse to your generated SDK directory and then click OK.

Open project in PyCharm - Step 2

The project files will be displayed in the side bar as follows:

Open project in PyCharm - Step 3

2. Add a new Test Project

Create a new directory by right clicking on the solution name as shown below:

Add a new project in PyCharm - Step 1

Name the directory as "test"

Add a new project in PyCharm - Step 2

Add a python file to this project with the name "testsdk"

Add a new project in PyCharm - Step 3

Name it "testsdk"

Add a new project in PyCharm - Step 4

In your python file you will be required to import the generated python library using the following code lines

from akkblfpim23.akkblfpim_23_client import Akkblfpim23Client

Add a new project in PyCharm - Step 4

After this you can write code to instantiate an API client object, get a controller object and make API calls. Sample code is given in the subsequent sections.

3. Run the Test Project

To run the file within your test project, right click on your Python file inside your Test project and click on Run

Run Test Project - Step 1

How to Test

You can test the generated SDK and the server with automatically generated test cases. unittest is used as the testing framework and nose is used as the test runner. You can run the tests as follows:

  1. From terminal/cmd navigate to the root directory of the SDK.
  2. Invoke pip install -r test-requirements.txt
  3. Invoke nosetests

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
o_auth_access_token OAuth 2.0 Access Token

API client can be initialized as following.

# Configuration parameters and credentials
o_auth_access_token = 'o_auth_access_token' # OAuth 2.0 Access Token

client = Akkblfpim23Client(o_auth_access_token)

Class Reference

List of Controllers

Class: ProductController

Get controller instance

An instance of the ProductController class can be accessed from the API Client.

 product_controller = client.product

Method: get_product

Assuming that the given identifier is the identifier of an existing product

def get_product(self)

Example Usage

product_controller.get_product()

Method: get_products

TODO: Add a method description

def get_products(self,
                     content_type,
                     cookie)

Parameters

Parameter Tags Description
contentType Required TODO: Add a parameter description
cookie Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
cookie = 'Cookie'

product_controller.get_products(content_type, cookie)

Back to List of Controllers

Class: AttributeController

Get controller instance

An instance of the AttributeController class can be accessed from the API Client.

 attribute_controller = client.attribute

Method: get_attribute

Assuming that the given code is the code of an existing attribute

def get_attribute(self)

Example Usage

attribute_controller.get_attribute()

Method: get_attributes

TODO: Add Description

def get_attributes(self)

Example Usage

attribute_controller.get_attributes()

Back to List of Controllers

Class: AttributeOptionController

Get controller instance

An instance of the AttributeOptionController class can be accessed from the API Client.

 attribute_option_controller = client.attribute_option

Method: get_attribute_option

Assuming that the given codes are respectively the code of an existing attribute and an existing option of this attribute

def get_attribute_option(self)

Example Usage

attribute_option_controller.get_attribute_option()

Method: get_attribute_options

TODO: Add Description

def get_attribute_options(self)

Example Usage

attribute_option_controller.get_attribute_options()

Back to List of Controllers

Class: AttributeGroupsController

Get controller instance

An instance of the AttributeGroupsController class can be accessed from the API Client.

 attribute_groups_controller = client.attribute_groups

Method: get_attribute_group_2_x_only

Assuming that the given code is the code of an existing attribute group

def get_attribute_group_2_x_only(self)

Example Usage

attribute_groups_controller.get_attribute_group_2_x_only()

Method: get_attribute_groups_2_x_only

TODO: Add Description

def get_attribute_groups_2_x_only(self)

Example Usage

attribute_groups_controller.get_attribute_groups_2_x_only()

Back to List of Controllers

Class: CategoryController

Get controller instance

An instance of the CategoryController class can be accessed from the API Client.

 category_controller = client.category

Method: get_category

Assuming that the given code is the code of an existing category

def get_category(self)

Example Usage

category_controller.get_category()

Method: get_categories

TODO: Add Description

def get_categories(self)

Example Usage

category_controller.get_categories()

Back to List of Controllers

Class: ChannelController

Get controller instance

An instance of the ChannelController class can be accessed from the API Client.

 channel_controller = client.channel

Method: get_channel

Assuming that the given code is the code of an existing channel

def get_channel(self)

Example Usage

channel_controller.get_channel()

Method: get_channels

TODO: Add Description

def get_channels(self)

Example Usage

channel_controller.get_channels()

Back to List of Controllers

Class: CurrencyController

Get controller instance

An instance of the CurrencyController class can be accessed from the API Client.

 currency_controller = client.currency

Method: get_currency_2_x_only

Assuming that the given code is the code of an existing currency

def get_currency_2_x_only(self)

Example Usage

currency_controller.get_currency_2_x_only()

Method: get_currencies_2_x_only

TODO: Add Description

def get_currencies_2_x_only(self)

Example Usage

currency_controller.get_currencies_2_x_only()

Back to List of Controllers

Class: FamilyController

Get controller instance

An instance of the FamilyController class can be accessed from the API Client.

 family_controller = client.family

Method: get_family

Assuming that the given code is the code of an existing family

def get_family(self)

Example Usage

family_controller.get_family()

Method: get_families

TODO: Add Description

def get_families(self)

Example Usage

family_controller.get_families()

Back to List of Controllers

Class: FamilyVariant2XOnlyController

Get controller instance

An instance of the FamilyVariant2XOnlyController class can be accessed from the API Client.

 family_variant_2_x_only_controller = client.family_variant_2_x_only

Method: get_family_variant_2_x_only

Assuming that the given codes are respectively the code of an existing family and an existing family variant

def get_family_variant_2_x_only(self)

Example Usage

family_variant_2_x_only_controller.get_family_variant_2_x_only()

Method: get_family_variants_2_x_only

TODO: Add Description

def get_family_variants_2_x_only(self)

Example Usage

family_variant_2_x_only_controller.get_family_variants_2_x_only()

Back to List of Controllers

Class: MeasureFamily2XOnlyController

Get controller instance

An instance of the MeasureFamily2XOnlyController class can be accessed from the API Client.

 measure_family_2_x_only_controller = client.measure_family_2_x_only

Method: get_measure_family_2_x_only

Assuming that the given code is the code of an existing measure family

def get_measure_family_2_x_only(self)

Example Usage

measure_family_2_x_only_controller.get_measure_family_2_x_only()

Method: get_measure_families_2_x_only

TODO: Add Description

def get_measure_families_2_x_only(self)

Example Usage

measure_family_2_x_only_controller.get_measure_families_2_x_only()

Back to List of Controllers

Class: MiscController

Get controller instance

An instance of the MiscController class can be accessed from the API Client.

 misc_controller = client.misc

Method: create_authentification_by_password

TODO: Add Description

def create_authentification_by_password(self,
                                            body,
                                            content_type)

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description
contentType Required TODO: Add a parameter description

Example Usage

body_value = "{\"username\":\"{{username}}\",\"password\":\"{{password}}\",\"grant_type\":\"password\"}"
body = json.loads(body_value)
content_type = 'application/json'

misc_controller.create_authentification_by_password(body, content_type)

Method: create_authentification_by_refresh_token

TODO: Add Description

def create_authentification_by_refresh_token(self,
                                                 body,
                                                 content_type)

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description
contentType Required TODO: Add a parameter description

Example Usage

body_value = "{\"refresh_token\":\"{{refreshToken}}\",\"grant_type\":\"refresh_token\"}"
body = json.loads(body_value)
content_type = 'application/json'

misc_controller.create_authentification_by_refresh_token(body, content_type)

Back to List of Controllers

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages