Skip to main content

Scrape various Untappd web pages and return as parsed dataclasses

Project description

Untappd Scraper

Web scrape public Untappd pages into data classes.

Quickstart

User queries

from untappd_scraper.user import User

users = ["gregavola"]

for user_id in users:
    user = User(user_id)
    print(f"\n{user.name=}")

    for checkin in user.activity():
        print(f"\n\t{checkin.name=}\n\t\t{checkin}")

    print("\n\nLists:")

    for userlist in user.lists():
        print(f"\n\t{userlist.name=} {userlist.num_items=}")

    print("\n\nRecent Venues:")

    for venue in user.venue_history():
        ago = datetime.now().date() - venue.last_visit
        print(
            f"\n\t{venue.name=} {venue.last_visit.strftime('%b %d %Y')} "
            + f"({ago.days} days ago)"
        )```

    print("\n\nRecent Uniques:")

    for beer in user.beer_history():
        print(f"\t{beer}, {beer.total_checkins=}")

Venue queries

from untappd_scraper.venue import Venue

venue_ids = [
    14705,  # 4 pines
    99967,  # collaroy
]

for venue_id in venue_ids:
    venue = Venue(venue_id)
    print(f"\n{venue.name=}")

    for num, checkin in enumerate(venue.activity(), start=1):
        print(f"\n\t{num=}\t{checkin.name=}\n\t\t{checkin}")

# Load a venue by name. Try to be as unambiguous as possible
venue = Venue.from_name("hotel sweeney")
print(f"\n{venue.name=} {venue.verified=}\t{venue.categories=}\n")
print("\n".join([str(beer) for beer in venue.activity()]))

for menu in venue.menus():
    print(f"\n{menu.selection=} / {menu.name=}")

    print("\n\t\t", end="")
    print("\n\t\t".join(str(beer) for beer in menu.beers))

Notes

untappd-scraper is just that - a scraper. It doesn't store data. So, for example, if you query a user's unique beer history (with User.beer_history()) you will not be able to see the entire history. Just what is public on the web, which is the most recent 25 uniques.

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

untappd_scraper-0.15.1.tar.gz (329.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

untappd_scraper-0.15.1-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file untappd_scraper-0.15.1.tar.gz.

File metadata

  • Download URL: untappd_scraper-0.15.1.tar.gz
  • Upload date:
  • Size: 329.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for untappd_scraper-0.15.1.tar.gz
Algorithm Hash digest
SHA256 77b6df094f8b2526fd23584bdd033f51f087c57d986a65d024b3d64943dcf95a
MD5 f6b6cc98a5f6cab28f2cccab4bfc1f03
BLAKE2b-256 0d18c500d4b390f0dd7b2363d3ae277877af7d25f065b3921458d6511aad3aa6

See more details on using hashes here.

File details

Details for the file untappd_scraper-0.15.1-py3-none-any.whl.

File metadata

  • Download URL: untappd_scraper-0.15.1-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for untappd_scraper-0.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 203468aec79af0aff42022c956810172a65ba4106b43418dc5c21f4c9eb02f94
MD5 2aee19422d55ab1375d19a399967c2b6
BLAKE2b-256 f7783a1f1f88c26ea5434acff32d96ba29a0c3732fd8456ee17c8df8cc88b439

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page