Skip to main content

A simple sample package

Project description

Log-hub Python API library

Introduction

The pyloghub package provides convinient access to various Log-hub API services for Supply Chain Visualization, Network Design Optimization, and Transport Optimization.

Prerequisites

  • Python 3.10 or later recommended
  • Pip (Python package manager)
  • Log-hub API key
  • Supply Chain APPS PRO subscription

Installation

Setting Up Python Environment

Recommended Python Version

Python 3.10 or later is recommended for optimal performance and compatibility.

Optional: Setting Up a Virtual Environment

A virtual environment allows you to manage Python packages for different projects separately.

  1. Create a Virtual Environment:

    • Windows:
      python -m venv loghub_env
      
    • macOS/Linux:
      python3 -m venv loghub_env
      
  2. Activate the Virtual Environment:

    • Windows:
      .\loghub_env\Scripts\activate
      
    • macOS/Linux:
      source loghub_env/bin/activate
      

    Deactivate with deactivate when done.

Installing pyloghub Package

Within the environment, install the package using:

pip install pyloghub

Configuration

Obtaining an API Key

  1. Sign up or log in at Log-hub Account Integration.
  2. Obtain your API key.

Setting Up Your Environment

Securely store your API key for use in your Python scripts or as an environment variable.

Usage

Sample Code: Reverse Distance Calculation

This example demonstrates using the Reverse Distance Calculation feature:

  1. Import Functions:

    from pyloghub.distance_calculation import reverse_distance_calculation, reverse_distance_calculation_sample_data
    
  2. Load Sample Data:

    sample_data = reverse_distance_calculation_sample_data()
    geocode_data_df = sample_data['geocode_data']
    parameters = sample_data['parameters']
    
  3. Perform Calculation:

    reverse_distance_result_df = reverse_distance_calculation(geocode_data_df, parameters, 'YOUR_API_KEY')
    

    Replace 'YOUR_API_KEY' with your actual Log-hub API key.

  4. View Results:

    print(reverse_distance_result_df)
    

Support

For additional support, questions, or feedback, please reach out to us via email:

Alternatively, for more information and resources, visit Log-hub API Documentation.

License

Distributed under the MIT License.

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

pyloghub-0.1.1.tar.gz (314.2 kB view hashes)

Uploaded Source

Built Distribution

pyloghub-0.1.1-py3-none-any.whl (361.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page