Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add process used buybox #150

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Add process used buybox #150

merged 3 commits into from
Oct 27, 2023

Conversation

akaszynski
Copy link
Owner

@akaszynski akaszynski commented Oct 27, 2023

Resolve #148 by adding an example to process used buy box statistics.

Example

Load in product offers and convert the buy box data into a pandas.DataFrame.

>>> import keepa
>>> key = '<REAL_KEEPA_KEY>'
>>> api = keepa.Keepa(key)
>>> response = api.query('B0088PUEPK', offers=20)
>>> product = response[0]
>>> buybox_info = product['buyBoxUsedHistory']
>>> df = keepa.process_used_buybox(buybox_info)
               datetime         user_id         condition  isFBA
0   2022-11-02 16:46:00  A1QUAC68EAM09F   Used - Like New   True
1   2022-11-13 10:36:00  A18WXU4I7YR6UA  Used - Very Good  False
2   2022-11-15 23:50:00   AYUGEV9WZ4X5O   Used - Like New  False
3   2022-11-17 06:16:00  A18WXU4I7YR6UA  Used - Very Good  False
4   2022-11-17 10:56:00   AYUGEV9WZ4X5O   Used - Like New  False
..                  ...             ...               ...    ...
115 2023-10-23 10:00:00   AYUGEV9WZ4X5O   Used - Like New  False
116 2023-10-25 21:14:00  A1U9HDFCZO1A84   Used - Like New  False
117 2023-10-26 04:08:00   AYUGEV9WZ4X5O   Used - Like New  False
118 2023-10-27 08:14:00  A1U9HDFCZO1A84   Used - Like New  False
119 2023-10-27 12:34:00   AYUGEV9WZ4X5O   Used - Like New  False

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #150 (4fb77af) into main (de7e2f7) will increase coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   90.14%   90.45%   +0.31%     
==========================================
  Files           4        4              
  Lines         568      587      +19     
==========================================
+ Hits          512      531      +19     
  Misses         56       56              
Files Coverage Δ
src/keepa/__init__.py 100.00% <ø> (ø)
src/keepa/interface.py 90.17% <100.00%> (+0.38%) ⬆️

@akaszynski akaszynski merged commit 0af5971 into main Oct 27, 2023
7 checks passed
@akaszynski akaszynski deleted the feat/bb-percent-won branch October 27, 2023 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to get the information of buy box used statistics
1 participant