Metadata-Version: 2.4
Name: untappd-scraper
Version: 0.4.0.1
Summary: Scrape various Untappd web pages and return as parsed dataclasses
Author-email: Wardy <wardy3@gmail.com>
License: MIT License
        
        Copyright (c) 2021 Michael Wardman
        
        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.
License-File: LICENSE
Keywords: beer,scraper,untappd
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0,>=3.13
Requires-Dist: brotli>=1.1.0
Requires-Dist: haversine>=2.9.0
Requires-Dist: lxml[html-clean]>=5.3.2
Requires-Dist: parse>=1.20.2
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: ratelim>=0.1.6
Requires-Dist: requests-cache>=1.2.1
Requires-Dist: requests-html>=0.10.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: wardy-core>=0.1.4.3
Description-Content-Type: text/markdown

# Untappd Scraper

Web scrape public Untappd pages into data classes.

## Quickstart

### User queries

```python
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

```python
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.