Metadata-Version: 2.4
Name: yelpapi
Version: 2.6.0
Summary: yelpapi is a pure Python implementation of the Yelp Fusion API.
Project-URL: Homepage, https://github.com/lanl/yelpapi
Project-URL: Changelog, https://github.com/lanl/yelpapi/blob/master/CHANGES.md
Author-email: Geoffrey Fairchild <mail@gfairchild.com>
License: Copyright (c) 2013, Triad National Security, LLC
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
        following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
          disclaimer.
        * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
          following disclaimer in the documentation and/or other materials provided with the distribution.
        * Neither the name of Triad National Security, LLC nor the names of its contributors may be used to endorse or
          promote products derived from this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
        INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
        SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
        WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
        THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: faker; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: requests-mock; extra == 'dev'
Description-Content-Type: text/markdown

# yelpapi

[![Tests](https://github.com/lanl/yelpapi/actions/workflows/tests.yml/badge.svg)](https://github.com/lanl/yelpapi/actions/workflows/tests.yml)

## LICENSE
This software is licensed under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause). Please refer to the separate [LICENSE](LICENSE) file for the exact text of the license. You are obligated to give attribution if you use this code.

## ABOUT
yelpapi is a pure Python implementation of the [Yelp Fusion API](https://docs.developer.yelp.com/docs/fusion-intro). It is simple, fast, and robust to any changes Yelp may make to the API in the future.

## REQUIREMENTS
This code requires Python 3.9 or higher and [requests](https://github.com/requests/requests).

## INSTALL
yelpapi is available on PyPI at https://pypi.org/project/yelpapi/.

Install using [pip](http://www.pip-installer.org/):

    pip install yelpapi

## USING THIS CODE
This API is demonstrated more thoroughly in [examples.py](examples/examples.py), but the following chunk of code demonstrates basic use of yelpapi:

```python
from yelpapi import YelpAPI
with YelpAPI(api_key) as yelp_api:
    search_results = yelp_api.search_query(args)
```

You can also set timeouts so API calls do not block indefinitely in degraded network conditions:

```python
from yelpapi import YelpAPI
with YelpAPI(api_key, timeout_s=3.0) as yelp_api:
    search_results = yelp_api.search_query(args)
```

Under the covers, this module uses a [`requests.Session`](https://requests.readthedocs.io/en/latest/user/advanced/#session-objects) object for issuing all API calls, which offers potentially significant performance benefits over issuing separate API calls outside of a session. You should be sure to close the underlying session when all API interactions are complete. The above examples demonstrate using the class as a context manager, which will automatically close the connection when you're done and is the preferred way of using the class, but you can also manually close it like this if a context manager won't work for your use case:

```python
from yelpapi import YelpAPI
try:
    yelp_api = YelpAPI(api_key)
    search_results = yelp_api.search_query(args)
finally:
    yelp_api.close()
```

## METHODS
* [Autocomplete API](https://docs.developer.yelp.com/reference/v3_autocomplete) - `autocomplete_query(...)`
* [Business API](https://docs.developer.yelp.com/reference/v3_business_info) - `business_query(...)`
* [Business Engagement Metrics API](https://docs.developer.yelp.com/reference/v3_get_businesses_engagement) - `business_engagement_query(...)`
* [Business Match API](https://docs.developer.yelp.com/reference/v3_business_match) - `business_match_query(...)`
* [Business Service Offerings API](https://docs.developer.yelp.com/reference/v3_business_service_offerings) - `business_service_offerings_query(...)`
* [Categories API](https://docs.developer.yelp.com/reference/v3_all_categories) - `categories_query(...)`
* [Category API](https://docs.developer.yelp.com/reference/v3_categories) - `category_query(...)`
* [Event Lookup API](https://docs.developer.yelp.com/reference/v3_event) - `event_lookup_query(...)`
* [Event Search API](https://docs.developer.yelp.com/reference/v3_events_search) - `event_search_query(...)`
* [Featured Event API](https://docs.developer.yelp.com/reference/v3_featured_event) - `featured_event_query(...)`
* [Phone Search API](https://docs.developer.yelp.com/reference/v3_business_phone_search) - `phone_search_query(...)`
* [Review Highlights API](https://docs.developer.yelp.com/reference/v3_business_review_highlights) - `review_highlights_query(...)`
* [Reviews API](https://docs.developer.yelp.com/reference/v3_business_reviews) - `reviews_query(...)`
* [Search API](https://docs.developer.yelp.com/reference/v3_business_search) - `search_query(...)`
* [Transaction Search API](https://docs.developer.yelp.com/reference/v3_transaction_search) - `transaction_search_query(...)`
