Python flat bill-of-material program based on Excel files - GitHub

文章推薦指數: 80 %
投票人數:10人

A Python program for flattening a layered bill-of-material (BOM) based on Excel files. Part quantities are combined and a total quantity or minimum-required- ... Skiptocontent {{message}} robsiegwart / python-BOM Public Notifications Fork 7 Star 9 Pythonflatbill-of-materialprogrambasedonExcelfiles License MITlicense 9 stars 7 forks Star Notifications Code Issues 0 Pullrequests 0 Actions Projects 0 Security Insights More Code Issues Pullrequests Actions Projects Security Insights robsiegwart/python-BOM Thiscommitdoesnotbelongtoanybranchonthisrepository,andmaybelongtoaforkoutsideoftherepository. master Branches Tags Couldnotloadbranches Nothingtoshow {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default 1 branch 0 tags Code Clone HTTPS GitHubCLI UseGitorcheckoutwithSVNusingthewebURL. WorkfastwithourofficialCLI. Learnmore. OpenwithGitHubDesktop DownloadZIP LaunchingGitHubDesktop Ifnothinghappens,downloadGitHubDesktopandtryagain. LaunchingGitHubDesktop Ifnothinghappens,downloadGitHubDesktopandtryagain. LaunchingXcode Ifnothinghappens,downloadXcodeandtryagain. LaunchingVisualStudioCode Yourcodespacewillopenonceready. Therewasaproblempreparingyourcodespace,pleasetryagain. Latestcommit RobSiegwart UpdateREADME … 987a69e Aug31,2021 UpdateREADME 987a69e Gitstats 58 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime Example     doc     pyBOM     .gitignore     LICENSE     README.md     setup.py     Viewcode pyBOM Motivation Structure Usage CommandLine Dependencies README.md pyBOM APythonprogramforflatteningalayeredbill-of-material(BOM)basedonExcel files.Partquantitiesarecombinedandatotalquantityor minimum-required-package-to-buyamountiscalculated,inadditiontoextended costs.AtreestructureoftheBOMhierarchycanalsobecreatedandconverted toDOTsyntaxforfurthergraphicsgeneration. Motivation Themainproblemsolvedistocombineidenticalpartsfromvarious sub-assembliesandlocationsinyourproductBOM.Additionally,itistobeused withExcelsinceExceliscommon,easy,anddoesnotrequireaseparateprogram orservertorun.FlatteningtellsyouthetotalQTYofapartwhenitmaybe usedinmanysub-assembliesandlevelsinyourproductstructure.Thisis necessarytocalculatethetotalQTYofapartandthereforedeterminethe mininumpackagesoftheproducttobuy,sincemanypartscomeinpacksgreater thanQTY1. Structure BOMsarecreatedbystoringpartsandassembliesinExcelfiles. Inaseparatedirectory,putanExcelfilenamedPartslist.xlsxtoserveas themasterpartslist"database".Then,eachadditionalassemblyisdescribed byaseparate.xlsxfile.Thusyoumighthave: my_project/ Partslist.xlsx>>print(bom.parts) [PartSK1002-01,PartSK1005-01,PartSK1007-01] BOM.assemblies :Getalistofalldirect-childassemblies >>>print(bom.assemblies) [WH-01,TR-01] BOM.quantities :Getthequantityofeachdirect-childpartintheBOM >>>print(bom.quantities) {PartSK1002-01:1,PartSK1005-01:1,PartSK1007-01:3,PartSK1006-01:1, PartSK1001-01:1,PartSK1003-01:1,PartSK1004-01:1} BOM.aggregate :Gettheaggregatedquantityofeachpart/assemblyfromthecurrent BOMleveldown >>>print(bom.aggregate) {PartSK1002-01:1,PartSK1005-01:8,PartSK1007-01:14,PartSK1006-01:8, PartSK1001-01:4,PartSK1003-01:2,PartSK1004-01:2} BOM.summary :GetasummaryintheformofaDataFramecontainingthemasterparts listwitheachitem'saggregatedquantityandtherequiredpackages tobuyifthePkgQTYfieldisnot1. >>>print(bom.summary) PNNameDescription...TotalQTYPurchaseQTYSubtotal 0SK1001-01BearingWheelbearing...4411.96 1SK1002-01BoardStandardtype...1113.42 2SK1003-01TruckhalfTruckfixed...2219.74 3SK1004-01TruckhalfTruckmovable...2224.50 4SK1005-01Truckscrew1/4-20SHCS...8112.86 5SK1006-01WheelHardclearurethane...8219.74 6SK1007-01Nut1/4-20Hexnut...1414.88 BOM.tree :ReturnastringrepresentationoftheBOMtreehierarchy >>>print(bom.tree) SKA-100 ├──PartSK1002-01 ├──WH-01 │├──PartSK1006-01 │├──PartSK1001-01 │└──PartSK1007-01 ├──TR-01 │├──PartSK1003-01 │├──PartSK1004-01 │└──PartSK1007-01 ├──PartSK1005-01 └──PartSK1007-01 Callingthisonchildassembliesshowsthetreefromthatreferencepoint: >>>sa=bom.assemblies[0] >>>sa WH-01 >>>print(sa.tree) WH-01 ├──PartSK1006-01 ├──PartSK1001-01 └──PartSK1007-01 CommandLine Somequickfunctionalityisextendedtothecommandlineviapythonmodulemode: >python-mpyBOMFOLDERACTION WhereACTIONiswhattodoandisjustapropertycallontheresulting top-levelBOM: >python-mpyBOMExampletree SKA-100 ├──PartSK1002-01 ├──WH-01 │├──PartSK1006-01 │├──PartSK1001-01 │└──PartSK1007-01 ├──TR-01 │├──PartSK1003-01 │├──PartSK1004-01 │└──PartSK1007-01 ├──PartSK1005-01 └──PartSK1007-01 Dependencies pandas anytree About Pythonflatbill-of-materialprogrambasedonExcelfiles Resources Readme License MITlicense Stars 9 stars Watchers 1 watching Forks 7 forks Releases Noreleasespublished Packages0 Nopackagespublished Languages Python 100.0% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?