A python tool for grabbing and tracking checklists for sports cards.
Project description
SportsCardTool
SportsCardTool is designed to gather card data and track collections of cards. We hope to build the modern dynamic checklist and price book.
Currently SportsCardTool provides the ability to gather all baseball card setlists and to search prescraped data via data API and Querybuilder tool.
Potential contributors should check out SportsCardToolServer and soon to launch SportsCardToolApp.
Install it from PyPI
pip install SportsCardTool
Usage
Scraping a year of data:
from SportsCardTool import grab_card_list, dump_data, grab_year_links
# Find All Cards for 2023 Season, returned as list of dictionaries
year_links = grab_year_links(["2023"])
card_list = grab_card_list(year_link)
# Create CSV to allow for manipulation via pandas
dump_data(mock_data, "2023_cards.csv")
Grabbing cards from scraped data via code: Also accessible directly here!
from SportsCardTool import QueryBuilder
qb = QueryBuilder()
# Construct query requesting Barry Bonds cards from 2000 with an autograph and a print run of 25 or 250
qb.add_item({"name": "Barry Bonds", "year": "2000", "auto": "True", "serial": "25,250"})
# Make request and return in form of tuple (list[dict], int)
data = qb.grab_data()
print(data[0])
[
{
"_id": "641f49185ee984b20a66ef77",
"auto": true,
"back_img": null,
"front_img": null,
"group": "fleer-ultra",
"listing": "2000 Fleer Ultra Fresh Ink #11 Barry Bonds",
"mem": false,
"name": "Barry Bonds",
"number": "11",
"price": 0,
"rc": false,
"serial": 250,
"set": "fleer-ultra-fresh-ink-baseball-trading-card-checklist",
"team": "San Francisco Giants",
"year": 2000
},
{
"_id": "641f49185ee984b20a66f5f4",
"auto": true,
"back_img": null,
"front_img": null,
"group": "fleer-ultra",
"listing": "2000 Fleer Ultra Fresh Ink #11 Barry Bonds",
"mem": false,
"name": "Barry Bonds",
"number": "11",
"price": 0,
"rc": false,
"serial": 250,
"set": "fleer-ultra-fresh-ink-baseball-trading-card-checklist",
"team": "San Francisco Giants",
"year": 2000
},
{
"_id": "641f49185ee984b20a674b2f",
"auto": true,
"back_img": null,
"front_img": null,
"group": "upper-deck",
"listing": "2000 Upper Deck Game Jersey Autograph Numbered #BB Barry Bonds",
"mem": true,
"name": "Barry Bonds",
"number": "BB",
"price": 0,
"rc": false,
"serial": 25,
"set": "upper-deck-game-jersey-autograph-numbered-baseball-trading-card-checklist",
"team": "San Francisco Giants",
"year": 2000
},
{
"_id": "641f49185ee984b20a678e31",
"auto": true,
"back_img": null,
"front_img": null,
"group": "upper-deck-pros-and-prospects",
"listing": "2000 Upper Deck Pros and Prospects Game Jersey Autograph Gold #BB Barry Bonds",
"mem": true,
"name": "Barry Bonds",
"number": "BB",
"price": 0,
"rc": false,
"serial": 25,
"set": "upper-deck-pros-and-prospects-game-jersey-autograph-gold-baseball-trading-card-checklist",
"team": "San Francisco Giants",
"year": 2000
},
{
"_id": "641f49185ee984b20a67958c",
"auto": true,
"back_img": null,
"front_img": null,
"group": "sp-authentic",
"listing": "2000 SP Authentic Chirography Gold #GBB Barry Bonds",
"mem": false,
"name": "Barry Bonds",
"number": "GBB",
"price": 0,
"rc": false,
"serial": 25,
"set": "sp-authentic-chirography-gold-baseball-trading-card-checklist",
"team": "San Francisco Giants",
"year": 2000
}
]
Development
Read the CONTRIBUTING.md file.
Attribution
This README was adapted from an example here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file SportsCardTool-0.2.4.tar.gz
.
File metadata
- Download URL: SportsCardTool-0.2.4.tar.gz
- Upload date:
- Size: 601.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 529a9ddaab9ec5d05ff2106e5405793b51e6808ada85dd01b32c1031f829b70f |
|
MD5 | e6e5e98a2089b6601f0ac0bdfb0d4412 |
|
BLAKE2b-256 | 7ad4c4e4effbe3e0cba235df84fe0a30c7b9d15107123b86df3fc870d4aeaaaa |
File details
Details for the file SportsCardTool-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: SportsCardTool-0.2.4-py3-none-any.whl
- Upload date:
- Size: 621.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85b04fe91e8c62aaaf8983186a6f70d5cb7cd8ea012d4ed1d129e1460a05080 |
|
MD5 | abc209935ed895c105884ddbd246241a |
|
BLAKE2b-256 | 312de8e773d0c1bfd812c62d7ca99eb98e601c55dc3d837c0edfe7627c5e6d98 |