Documentation of the PSA-prices package¶
About¶
PSA-prizes is a Python package for simple prize analyses of PSA-graded trading cards.
PSA (Professional Sports Authenticator) grades the authenticity and condition of sport cards, such as baseball and basketball cards, and cards from TCGs (trading card games) like Magic, Yu-Gi-Oh! and Pokémon. The grades provide credible categories for these sensible collectibles in which prizes can be compared.
Summary¶
Features¶
Web Scraping¶
Scrape the comprehensive data recorded by PSA on public sales of certified cards from the Auction Prizes register on their website
Basic Analysis¶
Compute the compound annual growth rate (CAGR) and numbers on the grade distribution, record unusual grade types and plot the prizes over time
Installation¶
Clone the package to a local directory:
$ git clone https://github.com/tostenzel/psa-prizes
Install the dependency manager Poetry:
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Change directory to /psa-prizes/
and install dependencies:
$ cd psa_prizes
$ poetry install
Example¶
Specify the cards and grades of interest in /input/input.csv
(Click for an example):
Paste the respective item link to the first column
Write the respective grades to the second column as a list in Python syntax
If you write in the file through a GUI-based program, make sure to keep ; as the only column delimeter.
Run PSA-prizes:
$ poetry run psa-prizes
Data, information and plots are saved to /output/
. Additionally, the information is printed to the terminal and the plot is pictured for each card-grade pair. An example output is shown below.
– The compound annual growth rate from 2016 to 2020 is 61.13%.
– The number of cards with grade 8.0 is 119 of 562 cards. That is 21.17%.
– Over all grades, 6 of 562 cards do not receive standard grades. These grades are in {'Authentic', 'nan'}
Modules¶
psa_prizes.scrape¶
psa_prizes.analyze¶
Analysis tools.
-
psa_prizes.analyze.
analyze
()¶ Return info messages as dict, plot prize timeline and save both.
Notes
For some cards, the grade data is of type str instead of int or float. pd.DataFrames assign the data-types column-wise by using the most compatible type. For example, the grade “Authentic” for only one card causes pandas to transform the whole column with grades in {1.0, 1.5, … 10.0} to be stored as str. Therefore, all grades are converted to str for a unified treatment. These strings are written like floats with one decimal place.
- Return type
None
License¶
MIT License
Copyright (c) 2020 Tobias
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.