### Install from source Source: https://github.com/mathroule/cellartracker/blob/main/docs/installation.md Execute this command after downloading the source code to complete the installation. ```console $ python setup.py install ``` -------------------------------- ### Install CellarTracker via pip Source: https://github.com/mathroule/cellartracker/blob/main/docs/installation.md Use this command to install the most recent stable release of the package. ```console $ pip install cellartracker ``` -------------------------------- ### Set Up Local Development Environment Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Install the project locally into a virtual environment using `python setup.py develop`. ```shell mkvirtualenv cellartracker cd cellartracker/ python setup.py develop ``` -------------------------------- ### Set up local development environment Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Commands to create a virtual environment and install the package in development mode. ```shell $ mkvirtualenv cellartracker $ cd cellartracker/ $ python setup.py develop ``` -------------------------------- ### GET /notes and GET /private_notes Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves public tasting notes from the community and your private tasting notes. ```APIDOC ## GET /notes and GET /private_notes ### Description Retrieves public tasting notes from the community and your private tasting notes. ### Method GET ### Endpoint /notes, /private_notes ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get public tasting notes notes = client.get_notes() # Get private tasting notes private_notes = client.get_private_notes() ``` ### Response #### Success Response (200) - **note** (object) - A tasting note. - **Wine** (string) - Name of the wine associated with the note. - **Note** (string) - The content of the tasting note. #### Response Example ```json [ { "Wine": "Unknown", "Note": "No note" } ] ``` ``` -------------------------------- ### GET /pending Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves pending purchases that have not yet been delivered. ```APIDOC ## GET /pending ### Description Retrieves pending purchases that have not yet been delivered. ### Method GET ### Endpoint /pending ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") pending = client.get_pending() ``` ### Response #### Success Response (200) - **order** (object) - Details of the pending order. - **Wine** (string) - Name of the wine. - **Vintage** (string) - Vintage year of the wine. - **PurchaseDate** (string) - Date the wine was ordered. - **DeliveryDate** (string) - Expected delivery date. - **Quantity** (integer) - Number of bottles ordered. - **Price** (number) - Price per bottle. - **Currency** (string) - Currency of the price. #### Response Example ```json [ { "Wine": "Pétrus", "Vintage": "2008", "PurchaseDate": "5/25/2020", "DeliveryDate": "5/25/2020", "Quantity": 3, "Price": 0, "Currency": "EUR" } ] ``` ``` -------------------------------- ### get_inventory() - Get Detailed Inventory Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves detailed inventory data for each bottle, including barcodes, locations, purchase prices, and wine details. ```APIDOC ## GET /api/inventory ### Description Retrieves detailed inventory data with individual bottle barcodes, locations, purchase prices, and wine details. ### Method GET ### Endpoint /api/inventory ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get detailed inventory inventory = client.get_inventory() for bottle in inventory: print(f"Barcode: {bottle['Barcode']}") print(f"Wine: {bottle['Wine']} {bottle['Vintage']}") print(f"Location: {bottle['Location']}") print(f"Price: {bottle['Price']} {bottle['Currency']}") print(f"Purchase Date: {bottle['PurchaseDate']}") print(f"Type: {bottle['Type']} - {bottle['Varietal']}") ``` ### Response #### Success Response (200) - **inventory** (list of dict) - A list of dictionaries, where each dictionary represents a bottle in the inventory. - **Barcode** (string) - The barcode of the bottle. - **Wine** (string) - The name of the wine. - **Vintage** (string) - The vintage year of the wine. - **Location** (string) - The location of the bottle in the cellar. - **Price** (float) - The purchase price of the bottle. - **Currency** (string) - The currency of the purchase price. - **PurchaseDate** (string) - The date the bottle was purchased. - **Type** (string) - The type of wine (e.g., Red, White). - **Varietal** (string) - The grape varietal of the wine. #### Response Example ```json [ { "Barcode": "0129196204", "Wine": "Domaine de la Romanée-Conti La Tâche", "Vintage": "2003", "Location": "Cellar", "Price": 3500.0, "Currency": "EUR", "PurchaseDate": "4/8/2020", "Type": "Red", "Varietal": "Pinot Noir" } ] ``` ``` -------------------------------- ### GET /availability Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves wine availability and maturity data including drinking window calculations and community scores. ```APIDOC ## GET /availability ### Description Retrieves wine availability and maturity data including drinking window calculations and community scores. ### Method GET ### Endpoint /availability ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") availability = client.get_availability() ``` ### Response #### Success Response (200) - **wine_data** (object) - Availability and maturity data for a wine. - **Wine** (string) - Name of the wine. - **Vintage** (string) - Vintage year of the wine. - **Available** (number) - Availability score. - **Inventory** (integer) - Number of bottles in inventory. - **BeginConsume** (string) - Start of the drinking window. - **EndConsume** (string) - End of the drinking window. - **CScore** (number) - Community score. - **CNotes** (integer) - Number of community notes. #### Response Example ```json [ { "Wine": "Pétrus", "Vintage": "2008", "Available": 0.0893877551020408, "Inventory": 3, "BeginConsume": "1/1/2018", "EndConsume": "12/31/2046", "CScore": 96.625, "CNotes": 9 } ] ``` ``` -------------------------------- ### Get Wine List Summary Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieve a summary of all wines in your collection, including quantities, valuations, and drinking windows. This method is useful for a quick overview of your cellar. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get wine list summary wines = client.get_list() for wine in wines: print(f"Wine: {wine['Wine']} ({wine['Vintage']})") print(f" Quantity: {wine['Quantity']}, Pending: {wine['Pending']}") print(f" Region: {wine['Locale']}") print(f" CT Score: {wine['CT']}") print(f" Drink Window: {wine['BeginConsume']} - {wine['EndConsume']}") ``` -------------------------------- ### GET /tag and GET /food_tag Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves custom tags and food pairing tags assigned to wines in your collection. ```APIDOC ## GET /tag and GET /food_tag ### Description Retrieves custom tags and food pairing tags assigned to wines in your collection. ### Method GET ### Endpoint /tag, /food_tag ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get custom tags tags = client.get_tag() # Get food pairing tags food_tags = client.get_food_tag() ``` ### Response #### Success Response (200) - **tag_data** (object) - Tag information for a wine. - **Wine** (string) - Name of the wine. - **Tag** (string) - The custom or food pairing tag. #### Response Example ```json [ { "Wine": "Unknown", "Tag": "None" } ] ``` ``` -------------------------------- ### GET /pro_review Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves professional reviews and scores from critics for wines in your collection. ```APIDOC ## GET /pro_review ### Description Retrieves professional reviews and scores from critics for wines in your collection. ### Method GET ### Endpoint /pro_review ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") reviews = client.get_pro_review() ``` ### Response #### Success Response (200) - **review** (object) - Professional review details. - **Wine** (string) - Name of the wine. - **Reviewer** (string) - Name of the critic. - **Score** (string) - Score given by the critic. #### Response Example ```json [ { "Wine": "Unknown", "Reviewer": "Unknown", "Score": "N/A" } ] ``` ``` -------------------------------- ### get_list() - Get Wine List Summary Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves a summary list of all wines in your collection, including quantities, valuations, professional ratings, and drinking windows. ```APIDOC ## GET /api/wines/list ### Description Retrieves a summary list of all wines in your collection with quantities, valuations, professional ratings, and drinking windows. ### Method GET ### Endpoint /api/wines/list ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get wine list summary wines = client.get_list() for wine in wines: print(f"Wine: {wine['Wine']} ({wine['Vintage']})") print(f" Quantity: {wine['Quantity']}, Pending: {wine['Pending']}") print(f" Region: {wine['Locale']}") print(f" CT Score: {wine['CT']}") print(f" Drink Window: {wine['BeginConsume']} - {wine['EndConsume']}") ``` ### Response #### Success Response (200) - **wines** (list of dict) - A list of dictionaries, where each dictionary represents a wine summary. - **Wine** (string) - The name of the wine. - **Vintage** (string) - The vintage year of the wine. - **Quantity** (integer) - The number of bottles currently in the collection. - **Pending** (integer) - The number of bottles pending. - **Locale** (string) - The region or location of the wine. - **CT** (float) - The CellarTracker score. - **BeginConsume** (string) - The start year of the recommended drinking window. - **EndConsume** (string) - The end year of the recommended drinking window. #### Response Example ```json [ { "Wine": "Pétrus", "Vintage": "2008", "Quantity": 0, "Pending": 3, "Locale": "France, Bordeaux, Libournais, Pomerol", "CT": 96.625, "BeginConsume": "2018", "EndConsume": "2046" } ] ``` ``` -------------------------------- ### get_bottles() - Get All Bottles Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves individual bottle records, including pending, in-cellar, and consumed bottles, along with consumption notes. ```APIDOC ## GET /api/bottles ### Description Retrieves individual bottle records including pending, in-cellar, and consumed bottles with consumption notes. ### Method GET ### Endpoint /api/bottles ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get all bottles (including consumed) bottles = client.get_bottles() for bottle in bottles: state = "Pending" if bottle['BottleState'] == '-1' else \ "Consumed" if bottle['BottleState'] == '0' else "In Cellar" print(f"{bottle['Wine']} ({bottle['Vintage']}) - {state}") print(f" Location: {bottle['Location']}") print(f" Cost: {bottle['BottleCost']} {bottle['BottleCostCurrency']}") if bottle['ConsumptionDate']: print(f" Consumed: {bottle['ConsumptionDate']} - {bottle['ConsumptionNote']}") ``` ### Response #### Success Response (200) - **bottles** (list of dict) - A list of dictionaries, where each dictionary represents a bottle record. - **Wine** (string) - The name of the wine. - **Vintage** (string) - The vintage year of the wine. - **BottleState** (string) - The state of the bottle ('-1' for Pending, '0' for Consumed, other for In Cellar). - **Location** (string) - The location of the bottle. - **BottleCost** (float) - The cost of the bottle. - **BottleCostCurrency** (string) - The currency of the bottle cost. - **ConsumptionDate** (string) - The date the bottle was consumed (if applicable). - **ConsumptionNote** (string) - Notes about the consumption (if applicable). #### Response Example ```json [ { "Wine": "Château d'Yquem", "Vintage": "2011", "BottleState": "0", "Location": "Cellar", "BottleCost": 230.0, "BottleCostCurrency": "EUR", "ConsumptionDate": "5/21/2020", "ConsumptionNote": "Excellent!" } ] ``` ``` -------------------------------- ### GET /consumed Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves consumption history with dates, notes, pricing, and wine details. ```APIDOC ## GET /consumed ### Description Retrieves consumption history with dates, notes, pricing, and wine details. ### Method GET ### Endpoint /consumed ### Parameters None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") consumed = client.get_consumed() ``` ### Response #### Success Response (200) - **wine** (object) - Details of the consumed wine. - **Wine** (string) - Name of the wine. - **Vintage** (string) - Vintage year of the wine. - **Consumed** (string) - Date consumed. - **ShortType** (string) - Type of consumption (e.g., Drank). - **Value** (number) - Value of the wine when consumed. - **Currency** (string) - Currency of the value. - **ConsumptionNote** (string) - Personal note about the consumption. - **Locale** (string) - Geographical location of the wine. #### Response Example ```json [ { "Wine": "Domaine de la Romanée-Conti La Tâche", "Vintage": "2003", "Consumed": "5/1/2020", "ShortType": "Drank", "Value": 3500, "Currency": "EUR", "ConsumptionNote": "Absolutely fantastic wine!", "Locale": "France, Burgundy, Côte de Nuits, La Tâche Grand Cru" } ] ``` ``` -------------------------------- ### get_purchase() - Get Purchase History Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieves purchase history, including store information, pricing, quantities, and delivery status. ```APIDOC ## GET /api/purchases ### Description Retrieves purchase history with store information, pricing, quantities, and delivery status. ### Method GET ### Endpoint /api/purchases ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get purchase records purchases = client.get_purchase() for purchase in purchases: print(f"Wine: {purchase['Wine']} {purchase['Vintage']}") print(f" Purchase Date: {purchase['PurchaseDate']}") print(f" Store: {purchase['StoreName']}") print(f" Price: {purchase['Price']} {purchase['Currency']}") print(f" Quantity: {purchase['Quantity']} (Remaining: {purchase['Remaining']})") print(f" Delivered: {purchase['Delivered']}") ``` ### Response #### Success Response (200) - **purchases** (list of dict) - A list of dictionaries, where each dictionary represents a purchase record. - **Wine** (string) - The name of the wine. - **Vintage** (string) - The vintage year of the wine. - **PurchaseDate** (string) - The date of the purchase. - **StoreName** (string) - The name of the store where the wine was purchased. - **Price** (float) - The price per bottle. - **Currency** (string) - The currency of the price. - **Quantity** (integer) - The number of bottles purchased. - **Remaining** (integer) - The number of bottles remaining from this purchase. - **Delivered** (boolean) - Indicates if the purchase has been delivered. #### Response Example ```json [ { "Wine": "Domaine de la Romanée-Conti La Tâche", "Vintage": "2003", "PurchaseDate": "4/8/2020", "StoreName": "Unknown", "Price": 3500.0, "Currency": "EUR", "Quantity": 2, "Remaining": 1, "Delivered": true } ] ``` ``` -------------------------------- ### Get Detailed Inventory Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieve detailed inventory data for each bottle, including barcode, location, purchase price, and wine specifics. This provides granular information about each bottle in your cellar. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get detailed inventory inventory = client.get_inventory() for bottle in inventory: print(f"Barcode: {bottle['Barcode']}") print(f"Wine: {bottle['Wine']} {bottle['Vintage']}") print(f"Location: {bottle['Location']}") print(f"Price: {bottle['Price']} {bottle['Currency']}") print(f"Purchase Date: {bottle['PurchaseDate']}") print(f"Type: {bottle['Type']} - {bottle['Varietal']}") ``` -------------------------------- ### Get All Bottles Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieve records for all individual bottles, including pending, in-cellar, and consumed bottles. This method also includes consumption notes if available. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get all bottles (including consumed) bottles = client.get_bottles() for bottle in bottles: state = "Pending" if bottle['BottleState'] == '-1' else \ "Consumed" if bottle['BottleState'] == '0' else "In Cellar" print(f"{bottle['Wine']} ({bottle['Vintage']}) - {state}") print(f" Location: {bottle['Location']}") print(f" Cost: {bottle['BottleCost']} {bottle['BottleCostCurrency']}") if bottle['ConsumptionDate']: print(f" Consumed: {bottle['ConsumptionDate']} - {bottle['ConsumptionNote']}") ``` -------------------------------- ### Get Purchase History Source: https://context7.com/mathroule/cellartracker/llms.txt Retrieve your purchase history, including store information, pricing, quantities, and delivery status. This is useful for tracking where and when you bought your wines. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get purchase records purchases = client.get_purchase() for purchase in purchases: print(f"Wine: {purchase['Wine']} {purchase['Vintage']}") print(f" Purchase Date: {purchase['PurchaseDate']}") print(f" Store: {purchase['StoreName']}") print(f" Price: {purchase['Price']} {purchase['Currency']}") print(f" Quantity: {purchase['Quantity']} (Remaining: {purchase['Remaining']})") print(f" Delivered: {purchase['Delivered']}") ``` -------------------------------- ### Clone the repository Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Initial step to create a local copy of the project. ```shell $ git clone git@github.com:your_name_here/cellartracker.git ``` -------------------------------- ### CellarTracker Class Initialization Source: https://context7.com/mathroule/cellartracker/llms.txt Initialize the CellarTracker client with your username and password to authenticate and connect to the CellarTracker service. ```APIDOC ## CellarTracker Class Initialization ### Description The main CellarTracker class handles authentication and provides methods to retrieve wine collection data from the CellarTracker service. ### Method Initialization ### Endpoint N/A (Class Initialization) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from cellartracker import cellartracker # Initialize with your CellarTracker credentials client = cellartracker.CellarTracker( username="your_username", password="your_password" ) ``` ### Response #### Success Response (200) N/A (Initialization) #### Response Example N/A (Initialization) ``` -------------------------------- ### Handle authentication and connection errors Source: https://context7.com/mathroule/cellartracker/llms.txt Demonstrates how to catch specific library exceptions for authentication and connectivity issues. ```python from cellartracker import cellartracker from cellartracker.errors import AuthenticationError, CannotConnect client = cellartracker.CellarTracker(username="your_username", password="your_password") try: wines = client.get_list() print(f"Found {len(wines)} wines in your collection") except AuthenticationError: print("Error: Invalid username or password") except CannotConnect: print("Error: Unable to connect to CellarTracker") ``` -------------------------------- ### Use the command-line interface Source: https://context7.com/mathroule/cellartracker/llms.txt Export wine data directly from the terminal with various formatting options. ```bash # Get wine list in tab-separated format (default) cellartracker -u your_username -p your_password # Get inventory data cellartracker -u your_username -p your_password -t Inventory # Get bottles in CSV format cellartracker -u your_username -p your_password -t Bottles -f csv # Get consumed wines in XML format cellartracker -u your_username -p your_password -t Consumed -f xml ``` -------------------------------- ### Clone the CellarTracker Repository Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Clone your forked repository locally to begin development. ```shell git clone git@github.com:your_name_here/cellartracker.git ``` -------------------------------- ### Create a development branch Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Command to switch to a new branch for implementing changes. ```shell $ git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Deploy project updates Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Commands for maintainers to bump the version and push tags for deployment. ```shell $ bump2version patch # possible: major / minor / patch $ git push $ git push --tags ``` -------------------------------- ### Deploy to PyPI Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Update the version and deploy to PyPI. Ensure HISTORY.rst is updated and all changes are committed. ```shell bump2version patch # possible: major / minor / patch git push git push --tags ``` -------------------------------- ### Accessing raw data via low-level client Source: https://context7.com/mathroule/cellartracker/llms.txt Use the client.get method to retrieve raw data from specific tables in supported formats. Requires valid CellarTracker credentials. ```python from cellartracker import cellartracker from cellartracker.enum import CellarTrackerFormat, CellarTrackerTable client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get raw CSV data raw_csv = client.client.get( table=CellarTrackerTable.List, format=CellarTrackerFormat.csv ) print(raw_csv) # Get raw XML data raw_xml = client.client.get( table=CellarTrackerTable.Inventory, format=CellarTrackerFormat.xml ) print(raw_xml) ``` -------------------------------- ### Run quality checks and tests Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Commands to verify code style and run test suites. ```shell $ flake8 cellartracker tests $ python setup.py test or pytest $ tox ``` -------------------------------- ### Initialize CellarTracker Client Source: https://context7.com/mathroule/cellartracker/llms.txt Initialize the main CellarTracker class with your username and password. This client object is used to authenticate and interact with the CellarTracker web service. ```python from cellartracker import cellartracker # Initialize with your CellarTracker credentials client = cellartracker.CellarTracker( username="your_username", password="your_password" ) ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Stage, commit, and push your changes to your forked repository. ```shell git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Clone CellarTracker source repository Source: https://github.com/mathroule/cellartracker/blob/main/docs/installation.md Download the source code by cloning the public GitHub repository. ```console $ git clone git://github.com/mathroule/cellartracker ``` -------------------------------- ### Download CellarTracker tarball Source: https://github.com/mathroule/cellartracker/blob/main/docs/installation.md Download the source code as a tarball using curl. ```console $ curl -OJL https://github.com/mathroule/cellartracker/tarball/master ``` -------------------------------- ### Run a Subset of Tests Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Execute a specific test module using the `unittest` module. ```shell python -m unittest tests.test_cellartracker ``` -------------------------------- ### Run Code Quality and Tests Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Ensure your changes pass linting with flake8 and all tests, including cross-version compatibility with tox. ```shell flake8 cellartracker tests python setup.py test or pytest tox ``` -------------------------------- ### Command-Line Interface Source: https://context7.com/mathroule/cellartracker/llms.txt Export data directly from the terminal using the cellartracker CLI command with various table and format options. ```APIDOC ## Command-Line Interface ### Description Export data directly from the terminal using the cellartracker CLI command with various table and format options. ### Usage `cellartracker -u -p [-t ] [-f ]` ### Options - **-u, --username**: Your CellarTracker username. - **-p, --password**: Your CellarTracker password. - **-t, --table**: The data table to retrieve (e.g., Bottles, Inventory, Consumed). Defaults to 'List'. - **-f, --format**: The output format (e.g., tsv, csv, xml, json). Defaults to 'tsv'. ### Examples # Get wine list in tab-separated format (default) ```bash cellartracker -u your_username -p your_password ``` # Get inventory data ```bash cellartracker -u your_username -p your_password -t Inventory ``` # Get bottles in CSV format ```bash cellartracker -u your_username -p your_password -t Bottles -f csv ``` # Get consumed wines in XML format ```bash cellartracker -u your_username -p your_password -t Consumed -f xml ``` ``` -------------------------------- ### Commit and push changes Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Standard git workflow for submitting contributions. ```shell $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Run specific tests Source: https://github.com/mathroule/cellartracker/blob/main/CONTRIBUTING.rst Command to execute a subset of tests using the unittest module. ```shell $ python -m unittest tests.test_cellartracker ``` -------------------------------- ### Retrieve tasting notes Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches both public community tasting notes and private user notes. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get public tasting notes notes = client.get_notes() # Get private tasting notes private_notes = client.get_private_notes() for note in private_notes: print(f"Wine: {note.get('Wine', 'Unknown')}") print(f"Note: {note.get('Note', 'No note')}") ``` -------------------------------- ### Create a New Branch Source: https://github.com/mathroule/cellartracker/blob/main/docs/contributing.md Create a new branch for your bug fixes or feature development. ```shell git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Retrieve wine availability and maturity Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches data regarding drinking windows, inventory levels, and community scores. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get availability/maturity data availability = client.get_availability() for wine in availability: print(f"Wine: {wine['Wine']} ({wine['Vintage']})") print(f" Availability Score: {wine['Available']}") print(f" Inventory: {wine['Inventory']} bottles") print(f" Drink Window: {wine['BeginConsume']} to {wine['EndConsume']}") print(f" Community Score: {wine['CScore']} ({wine['CNotes']} notes)") ``` -------------------------------- ### Error Handling Source: https://context7.com/mathroule/cellartracker/llms.txt The library provides custom exceptions for authentication failures and connection errors. ```APIDOC ## Error Handling ### Description The library provides custom exceptions for authentication failures and connection errors. ### Exceptions - **AuthenticationError**: Raised when authentication fails (invalid username or password). - **CannotConnect**: Raised when the library is unable to connect to the CellarTracker service. ### Request Example ```python from cellartracker import cellartracker from cellartracker.errors import AuthenticationError, CannotConnect client = cellartracker.CellarTracker(username="your_username", password="your_password") try: wines = client.get_list() print(f"Found {len(wines)} wines in your collection") except AuthenticationError: print("Error: Invalid username or password") except CannotConnect: print("Error: Unable to connect to CellarTracker") ``` ``` -------------------------------- ### CellarTracker Console Usage Source: https://github.com/mathroule/cellartracker/blob/main/docs/usage.md Use this command to interact with CellarTracker from your terminal. Specify user credentials and desired output type. ```bash $ cellartracker [-h] -u USERNAME -p PASSWORD [-t {List,Inventory,Notes,PrivateNotes,Purchase,Pending,Consumed,Availability,Tag,ProReview,Bottles,FoodTag}] [-f {html,xml,tab,csv}] ``` -------------------------------- ### Retrieve pending purchases Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches a list of wines that have been ordered but not yet delivered. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get pending deliveries pending = client.get_pending() for order in pending: print(f"Wine: {order['Wine']} ({order['Vintage']})") print(f" Ordered: {order['PurchaseDate']}") print(f" Expected: {order['DeliveryDate']}") print(f" Quantity: {order['Quantity']}") print(f" Price: {order['Price']} {order['Currency']}") ``` -------------------------------- ### CellarTracker Python API Usage Source: https://github.com/mathroule/cellartracker/blob/main/docs/usage.md Import and instantiate the CellarTracker client in your Python project to access various data retrieval methods. Ensure you have your username and password available. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username, password) client.get_list() # Return List client.get_inventory() # Return Inventory client.get_notes() # Return Notes client.get_private_notes() # Return PrivateNotes client.get_purchase() # Return Purchase client.get_pending() # Return Pending client.get_consumed() # Return Consumed client.get_availability() # Return Availability client.get_tag() # Return Tag client.get_pro_review() # Return ProReview client.get_bottles() # Return Bottles client.get_food_tag() # Return FoodTag ``` -------------------------------- ### Retrieve professional reviews Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches scores and reviews provided by professional critics. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get professional reviews reviews = client.get_pro_review() for review in reviews: print(f"Wine: {review.get('Wine', 'Unknown')}") print(f"Reviewer: {review.get('Reviewer', 'Unknown')}") print(f"Score: {review.get('Score', 'N/A')}") ``` -------------------------------- ### Retrieve wine tags Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches custom user tags and food pairing tags assigned to wines. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get custom tags tags = client.get_tag() # Get food pairing tags food_tags = client.get_food_tag() for tag in tags: print(f"Wine: {tag.get('Wine', 'Unknown')}") print(f"Tags: {tag.get('Tag', 'None')}") ``` -------------------------------- ### Retrieve consumption history Source: https://context7.com/mathroule/cellartracker/llms.txt Fetches a list of consumed wines including dates, notes, pricing, and locale details. ```python from cellartracker import cellartracker client = cellartracker.CellarTracker(username="your_username", password="your_password") # Get consumed wines consumed = client.get_consumed() for wine in consumed: print(f"Wine: {wine['Wine']} ({wine['Vintage']})") print(f" Consumed: {wine['Consumed']} ({wine['ShortType']})") print(f" Value: {wine['Value']} {wine['Currency']}") print(f" Note: {wine['ConsumptionNote']}") print(f" Region: {wine['Locale']}") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.