Feed SDK 是 eBay 开源的 Python 开发包,用于下载和过滤通过公共 Feed API 提供的大型项目 Feed 文件。
使用命令行选项
可以使用命令行调用 SDK 的所有功能。
要查看可用选项和过滤器,请使用 ‘–help’
usage: FeedSDK [-h] [-dt DT] -c1 C1 [-scope {ALL_ACTIVE,NEWLY_LISTED}] [-mkt MKT] [-token TOKEN] [-env {SANDBOX,PRODUCTION}] [-lf LF [LF ...]] [-sellerf SELLERF [SELLERF ...]] [-locf LOCF [LOCF ...]] [-pricelf PRICELF] [-priceuf PRICEUF] [-epidf EPIDF [EPIDF ...]] [-iepidf IEPIDF [IEPIDF ...]] [-gtinf GTINF [GTINF ...]] [-itemf ITEMF [ITEMF ...]] [-dl DOWNLOADLOCATION] [--filteronly] [-format FORMAT] [-qf QF] Feed SDK CLI optional arguments: -h, --help show this help message and exit -dt DT the date when feed file was generated -c1 C1 the l1 category id of the feed file -scope {ALL_ACTIVE,NEWLY_LISTED} the feed scope. Available scopes are ALL_ACTIVE or NEWLY_LISTED -mkt MKT the marketplace id for which feed is being requested. For example - EBAY_US -token TOKEN the oauth token for the consumer. Omit the word 'Bearer' -env {SANDBOX,PRODUCTION} environment type. Supported Environments are SANDBOX and PRODUCTION -lf LF [LF ...] list of leaf categories which are used to filter the feed -sellerf SELLERF [SELLERF ...] list of seller names which are used to filter the feed -locf LOCF [LOCF ...] list of item locations which are used to filter the feed -pricelf PRICELF lower limit of the price range for items in the feed -priceuf PRICEUF upper limit of the price range for items in the feed -epidf EPIDF [EPIDF ...] list of epids which are used to filter the feed -iepidf IEPIDF [IEPIDF ...] list of inferred epids which are used to filter the feed -gtinf GTINF [GTINF ...] list of gtins which are used to filter the feed -itemf ITEMF [ITEMF ...] list of item IDs which are used to filter the feed -dl DOWNLOADLOCATION, --downloadlocation DOWNLOADLOCATION override for changing the directory where files are downloaded --filteronly filter the feed file that already exists in the default path or the path specified by -dl, --downloadlocation option. If --filteronly option is not specified, the feed file will be downloaded again -format FORMAT feed and filter file format. Default is gzip -qf QF any other query to filter the feed file. See Python dataframe query format
例如,使用命令行选项使用令牌下载和过滤 Feed 文件
python feed_cli.py -c1 3252 -scope ALL_ACTIVE -mkt EBAY_DE -env PRODUCTION -qf "AvailabilityThreshold=10" -locf IT GB -dl DIR -token xxx
过滤 Feed 文件,不需要令牌
python feed_cli.py --filteronly -c1 260 -pricelf 5 -priceuf 20 -dl FILE_PATH