Skip to main content

HappyCowler

HappyCowler is a crawler and parser for extracting geospatial data from HappyCow.net that liberates vegans and vegetarians from having to access the Internet while looking for a restaurant. The script crawls the descriptions and coordinates from the website and generates a GPX or KML file with the extracted information. Currently, the GPX file is tuned for Osmand.

The primary reason for this crawler is that HappyCow is impossible to use on a mobile browser. While apps are available, they require the presence of proprietary applications such as Google Play. Furthermore, a payment is also required. Thus it is not possible to obtain the app without sacrificing your privacy. By crawling the database, we obtain an offline file that can be used with a GPS app of your choice, without need for Internet access while on the go.

Dependencies

The script works with both Python 2 and 3. It relies on BeautifulSoup4 for HTML parsing.

Usage

On the command line, the script takes two parameters. The first is a URL for the results page of a city. The second is the name of the GPX or KML file. For example:

$ happycowl http://www.happycow.net/asia/japan/tokyo/ Tokyo_Restaurants.gpx

The type of the file is determined by the extension of the filename. Once the scraping finished, copy the file to your phone where your mapping app can find it. For instance, in Osmand, the contents of the folder osmand/tracks can easily be put on the map.

You can also use it as a module. In this case, instantiate the class HappyCow(city_url, target_file=None, verbose=0). Then you can start crawling by calling the crawl() method of the class.

Installation

The code is available on PyPI, hence it can be installed by

$ pip install happycowler

For the development version, clone it from git and follow the standard procedure for installing Python modules from source:

$ python setup.py install

Disclaimer

It is conceivable that crawling HappyCow is illegal.

Metadata

Release files for happycowler 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for happycowler 0.2.4
File Size Uploaded Provenance
happycowler-0.2.4.tar.gz 85.1 kB Without provenance Details

Release files / happycowler-0.2.4.tar.gz

Download URL happycowler-0.2.4.tar.gz
Size 85.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b85b141fa8670117a8aa19cc2e907e95d0e2b36d7e923e5bb636ee3476e8c96
BLAKE2b-256 checksum
How to use checksums
ce8db79de9f258aea99108aeb753e0d2212c415b3a87b8bb73a636257b8d74fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for happycowler 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page