This python library acquires metadata from products in the Nike.com website
Project description
Nikefy
Python library that amasses metadata from Nike.com website.
Overview
Nikefy will allow users to quickly access metadata from Nike.com website such as products and prices data.
- Create a database that easily queries shoes
- Easily find sold out products
- Find out most popular products via ratings
Install
pip install nikefy
Usage
import nikefy as nf
url = 'https://www.nike.com/w/mens-shoes-nik1zy7ok'
nf.get_nike_products(url)
nike_products = nf.get_nike_products(url)
sorted_nike_products = sort_nike_products(nike_products, sort_order='asc')
filtered_nike_products = filter_nike_products(nike_products, price_range=(100, 150), product_type="Men's Shoes")
get_nike_products()
gets Men's shoes products from Nike.com website and returns a dataframe
sort_nike_products()
sorts Men's shoes products based on price
filter_nike_products()
filters Men's shoes based on price range and type
Example
Running the following code
import nikefy as nf
url = 'https://www.nike.com/w/mens-shoes-nik1zy7ok'
nike_products = nf.get_nike_products(url)
print(nike_products)
Outputs something like this to the console
Product Name Price ... Description Product URL
0 Nike Pegasus 40 $130 ... A springy ride for every run, the Peg’s famili... https://www.nike.com/t/pegasus-40-mens-road-ru...
1 Nike Dunk Low Retro $110 ... Created for the hardwood but taken to the stre... https://www.nike.com/t/dunk-low-retro-mens-sho...
2 Air Jordan 1 Low $110 ... Inspired by the original that debuted in 1985,... https://www.nike.com/t/air-jordan-1-low-mens-s...
3 Air Jordan 1 Mid $125 ... Inspired by the original AJ1, this mid-top edi... https://www.nike.com/t/air-jordan-1-mid-mens-s...
4 Nike Free Metcon 5 $120 ... When your workouts wade into the nitty gritty,... https://www.nike.com/t/free-metcon-5-mens-trai...
5 Cosmic Unity 3 $170 ... Better for your game, designed with sustainabi... https://www.nike.com/t/cosmic-unity-3-basketba...
Demo
Details
This project is a pure python project using modern tooling. It uses a Makefile
as a command registry, with the following commands:
make
: list available commandsmake develop
: install and build this library and its dependencies usingpip
make build
: build the library usingsetuptools
make lint
: perform static analysis of this library withflake8
andblack
make format
: autoformat this library usingblack
make annotate
: run type checking usingmypy
make test
: run automated tests withpytest
make coverage
: run automated tests withpytest
and collect coverage informationmake dist
: package library for distribution
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.