Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
my-awesome-project
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d7fd8c93
authored
Jul 30, 2024
by
larosa
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add new line
parent
82ca8e14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
waldom_data_process_RMB.py
waldom_data_process_USD.py
waldom_data_process_RMB.py
View file @
d7fd8c93
...
...
@@ -15,16 +15,28 @@ title_map = {
'Price Break Qty 9'
,
'Date Code'
}
title_arr
=
[
'Manufacturer Name'
,
'Part Number'
,
'Stock EMEA'
,
'Stock USA'
,
'Stock APAC'
,
'Stock CN'
,
'MOQ'
,
'Price Break Qty 1'
,
'Price Break 1'
,
'Price Break Qty 2'
,
'Price Break 2'
,
'Price Break Qty 3'
,
'Price Break 3'
,
'Price Break Qty 4'
,
'Price Break 4'
,
'Price Break Qty 5'
,
'Price Break 5'
,
'Price Break Qty 6'
,
'Price Break 6'
,
'Price Break Qty 7'
,
'Price Break 7'
,
'Price Break Qty 8'
,
'Price Break 8'
,
'Price Break Qty 9'
,
'Price Break 9'
]
class
HandleCSV
:
def
parse
(
self
,
path
):
df
=
pd
.
read_excel
(
path
,
nrows
=
0
)
first_row
=
[]
for
i
in
range
(
len
(
df
.
columns
)):
print
(
df
.
columns
[
i
])
first_row
.
append
(
df
.
columns
[
i
])
if
not
self
.
validate
(
first_row
):
logger
.
error
(
"文件
%
s 格式错误"
%
path
)
return
[]
print
(
first_row
)
data
=
pd
.
read_excel
(
path
,
title_arr
)
print
(
data
.
values
())
...
...
waldom_data_process_USD.py
View file @
d7fd8c93
...
...
@@ -10,7 +10,7 @@ logger = logging.getLogger('waldom_data_process_USD.py')
# Manufacturer ----------------> brand_name
# 库存相加 HIJK 列
# 加一个 multiple 列
# TODO 缺少goods_sn
# TODO 缺少goods_sn
推送不要一次性推送 要一条一条推送
title_map
=
{
'Part Number'
,
'Manufacturer'
,
'Stock EMEA'
,
'Stock USA'
,
'Stock APAC'
,
'Stock CN'
,
'MOQ'
,
'Multiplier'
,
'Price Break Qty 1'
,
'Price Break Qty 2'
,
'Price Break Qty 3'
,
...
...
@@ -105,6 +105,7 @@ class HandleCSV:
if
__name__
==
'__main__'
:
result
=
HandleCSV
()
.
parse
(
'Tianyang_InventoryFeed.csv'
)
print
(
result
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment