factset/analyticsapi-engines-python-sdk

How to contribute

Closed this issue · 4 comments

How can I contribute to the development?
It seems it's built automatically, so not sure if I should edit Python code in the repo directly.

If you would like to contribute to the code generated by the OpenAPI Generator, we would suggest you contribute to OpenAPI generator repository. If not, please feel free to raise an issue and then, pull request with changes.

Having never used OpenAPI Generator, I don't know how fds library is built.
Do you do something else other than defining openapi-schema.json?

What I want to do is

  1. Add python "special" method (e.g. __hash__)
  2. Add utility function for looking up component ID

So I'm wondering if you can achieve these. Editing Python code? Or is there Java code underneath this whole library?
I could edit Python code in the repo directly, but I'm guessing that's not the correct way to go as it's built automatically and any edit will be lost upon next build.

Having never used OpenAPI Generator, I don't know how fds library is built.
Do you do something else other than defining openapi-schema.json?

Input is openapi-schema.json only. We made some changes to default PythonClientCodegen to include UtilityAPI class and named it CustomPythonClientCodegen. Also, OpenAPIGenerator tool depends on openapi-generator-config.json.

What I want to do is

  1. Add python "special" method (e.g. __hash__)

Do you mean to include it in all model classes?

  1. Add utility function for looking up component ID

We already have a method to look for all components that belong to a document here. To fetch details of each component ID, we can use this method.

So I'm wondering if you can achieve these. Editing Python code? Or is there Java code underneath this whole library?
I could edit Python code in the repo directly, but I'm guessing that's not the correct way to go as it's built automatically and any edit will be lost upon next build.

For point 1, it is better to fix in the open API tool here. We can look into it.

Having never used OpenAPI Generator, I don't know how fds library is built.
Do you do something else other than defining openapi-schema.json?

Input is openapi-schema.json only. We made some changes to default PythonClientCodegen to include UtilityAPI class and named it CustomPythonClientCodegen. Also, OpenAPIGenerator tool depends on openapi-generator-config.json.

Got it. So all the codes except custom class are generated based on the json file?

What I want to do is

  1. Add python "special" method (e.g. __hash__)

Do you mean to include it in all model classes?

Not necessarily. I had to customize the library to make it easy to use for the others in the team, and that was to implement __hash__. Please see below for the details.

  1. Add utility function for looking up component ID

We already have a method to look for all components that belong to a document here. To fetch details of each component ID, we can use this method.

So I'm wondering if you can achieve these. Editing Python code? Or is there Java code underneath this whole library?
I could edit Python code in the repo directly, but I'm guessing that's not the correct way to go as it's built automatically and any edit will be lost upon next build.

I believe section, report, and tile determine the component ID (Not sure how you call them, but the point is a component ID comprises of three elements).
Considering it changes every time you save the document on the workstation, it'd be user-friendly to have a function that looks up component ID based on those attributes; Otherwise we'd have to look up component ID manually, and that's tedious.
The function should be pretty easy to implement, but obviously it has to be custom built (i.e. not relying on json file). It might require you to edit auto-generated class or implement new function.
Thus I'm not sure what would be the best way to implement new python code.