Closed sebo83910 closed 3 years ago
Hi @sebo83910. Nice to ear some other used of enlargement of the output format.
You could use the same software flux control of collapse_refs
and suppress_cat_url
to control the choice (spreadsheet or your new format), check how they affect __main__.py
and kicost.py
.
--new_format
at the parser.add_argument(foo)
directives of __main__.py
.kicost.py
line 254 to use a create_new_format
instead create_spreadsheet
when passed kicost --new_format
.new_format.py
file with the function create_new_format(foo)
that receive the same parameters as create_spreadsheet(foo)
The parts
variable (passed to create_spreadsheet(foo)
) is a list of elements, each one is a dictionary with two parts:
columns
variable of line 328 of spreadsheet.py
. Each columns.keys()
defines that. Note: 'unit_price' and 'ext_price' will be just formulas of Excel;parts
) you have part_num
(stock number), price_tiers
(a dict with pairs: "tier qty - price tier") and dist_currency
. I do not remember exactly the structure now but it can be checked/debugged at line 865 of spreadsheet.py
.Thanks @hildogjr for your inputs. I've been able to make some progress. But it's more a hack than a nice solution so far. I'll see how I could adapt my code based on the elements you've desribed in your comment.
Which tool you aim to integrate? Whats is the output format need?
(If is of your interest) keep the code as branch to we keep on track here.
This is a custom tool. So far I use altium to generate an input bom. My first project was to create a simple django project to have a web interface for kicost. But now this is done, I want to use the tool to get some information as the price_tiers in order to update an ERP.
@hildogjr I'm not very familier either with github. I'd like to make sure I understand, you'd allow me to use a branch on your project where I could commit this feature? If you're ok, i'd be more than happy to share this with you. Let me know.
At https://github.com/xesscorp/KiCost
you fork the project and edit it was you want, you will be a owner of https://github.com/sebo83910/KiCost
.
When finished the changes you can merge it (pull request) to be merged to this main repository.
Ok thanks. I'll do it when I finish some tests.
Hello,
I'm currently struggling to understand the data (parts) structure within the projet. I'm interested by adding an export feature to the tool as I'd like to use output of the tool with another custom tool. So far, I guess I'm not good enough at Python to do this. Because, I'm trying to build a "complex" dictionary but I encounter a structure I'm not familiar with.
What I'd like to have is a list/dictionary like this:
Part1:
so far, no luck. What do you think?
thanks.