Skip to main content

Main - Floriday Suppliers API

Project description

Floriday Supplier API Client

A Python client for interacting with the Floriday Supplier API. This client provides a clean, type-safe interface to Floriday's supplier endpoints.

Overview

This client library is automatically generated from the Floriday Supplier API OpenAPI/Swagger specification using Swagger Codegen. It provides Python developers with a convenient way to interact with Floriday's supplier services.

Features

  • Auto-generated API client from Swagger/OpenAPI specs
  • Type-safe API interactions
  • Comprehensive API coverage for supplier operations
  • Environment-based configuration
  • OAuth2 authentication handling
  • Support for all Floriday Supplier API endpoints
  • Entity synchronization utilities for efficient data retrieval

Installation

Requirements

  • Python 3.4+ (developed and tested with Python 3.12)
  • Required Python packages (automatically installed as dependencies):
    • requests
    • urllib3
    • certifi
    • six

Installation Methods

From GitHub

pip install git+https://github.com/serraict/vine-floriday-python-supplier-api-client

Using Setuptools

python setup.py install --user

Or for all users:

sudo python setup.py install

Configuration

The client requires several environment variables to be set for authentication and API access:

Variable Description
FLORIDAY_CLIENT_ID OAuth client ID
FLORIDAY_CLIENT_SECRET OAuth client secret
FLORIDAY_API_KEY API key for Floriday API
FLORIDAY_AUTH_URL Authentication server URL
FLORIDAY_BASE_URL Base URL for API requests

See .env.example in the repository root for a template.

Basic Usage

Direct API Access

from floriday_supplier_client import TradeItemsApi
from floriday_supplier_client.api_factory import ApiFactory
from floriday_supplier_client.rest import ApiException

# Create API factory and client
factory = ApiFactory()
client = factory.get_api_client()

# Initialize specific API instance
api_instance = TradeItemsApi(client)

try:
    # Call API methods
    response = api_instance.get_trade_items_summary(
        trade_item_ids=["your-trade-item-id"]
    )
    print(response)
    
except ApiException as e:
    print(f"API Exception: {e}")

Entity Synchronization

The client includes utilities for efficiently synchronizing entities from the Floriday API:

from floriday_supplier_client import TradeItemsApi
from floriday_supplier_client.api_factory import ApiFactory
from floriday_supplier_client.sync import sync_entities

# Create API factory and client
factory = ApiFactory()
client = factory.get_api_client()
api_instance = TradeItemsApi(client)

# Define a persistence function
def persist_trade_item(item):
    # In a real application, save to database
    print(f"Processing trade item: {item.trade_item_id}")
    return item.trade_item_id

# Synchronize trade items
result = sync_entities(
    entity_type="trade_items",
    fetch_entities_callback=api_instance.get_trade_items_by_sequence_number,
    persist_entity_callback=persist_trade_item,
    start_seq_number=0
)

# Handle the result
print(f"Processed {result.entities_processed} trade items")
if not result.success:
    print(f"Error: {result.error}")

Documentation

  • API endpoint documentation is available in the docs/ directory
  • Example usage can be found in example.py
  • For architecture details, see architecture.md

Development

All code in floriday_supplier_client and test directories is generated. Files that should not be overwritten on generation should be included in .swagger-codegen-ignore.

To regenerate the client:

make local_specs  # get a local copy of the swagger specification
make client       # generate the client

For development and testing:

make bootstrap
./venv/bin/activate
make update
python example.py

Upgrade to a newer version of hte Floriday API

The Floriday API changes roughly twice per year, see Floriday docs.

To update to a newer version:

  • change the API_VERSION in the makefile
  • change the EXPECTED_API_VERSION in api_factory.py
  • update the FLORIDAY_BASE_URL in .env.example

Then regenerate the client and make a new release.

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

floriday_supplier_client-0.4.1.tar.gz (639.9 kB view details)

Uploaded Source

Built Distribution

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

floriday_supplier_client-0.4.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file floriday_supplier_client-0.4.1.tar.gz.

File metadata

  • Download URL: floriday_supplier_client-0.4.1.tar.gz
  • Upload date:
  • Size: 639.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for floriday_supplier_client-0.4.1.tar.gz
Algorithm Hash digest
SHA256 31d9e51cb97b7ac1138b189f3f535115f96882ac4447fa10a3b09886bb6719a5
MD5 7aaa34ce798f9bdbfadbb58f7b44f122
BLAKE2b-256 0c5b40f1b848701899a297105b1d31e97a3253f837c5c048c8dbc54705535602

See more details on using hashes here.

Provenance

The following attestation bundles were made for floriday_supplier_client-0.4.1.tar.gz:

Publisher: python-publish.yml on serraict/vine-floriday-python-supplier-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file floriday_supplier_client-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for floriday_supplier_client-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8152ca19670f81e71b84ed0ef97d9a5ddf6f43ef5254a68dab0fa723860f1c7
MD5 87a53faf83c861ce47d2515efd04c322
BLAKE2b-256 28d6343dba3e6cf3cade5ea082bcf49754864cc47b87c961d5da7fc8efde0bc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for floriday_supplier_client-0.4.1-py3-none-any.whl:

Publisher: python-publish.yml on serraict/vine-floriday-python-supplier-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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