Skip to main content

Helper tools for FactoryFloor projects

Project description

FactoryFloor Helpers

A collection of helper tools for FactoryFloor projects.

Installation

pip install factoryfloor-helpers

Features

Context Services

The context_services module provides classes for working with Five9 context services:

  • Holiday: A Pydantic model representing a holiday with a name and date
  • HolidayBuilder: A builder class for retrieving and formatting holiday information
  • TableBuilder: A builder class for creating and managing Five9 context service tables

Environment Utilities

The environment module provides utilities for environment-specific configurations:

  • get_base_url: A function to get the base URL for the Five9 API based on the region

Usage Examples

Working with Holidays

from factoryfloor_helpers.context_services import HolidayBuilder

# Create a holiday builder for the UK
holiday_builder = HolidayBuilder("GB")

# Get the next public holidays
holidays = holiday_builder.get_next_public_holidays()

# Print the holidays
for holiday in holidays:
    print(f"{holiday.name}: {holiday_builder.get_date(holiday)}")

Creating Context Service Tables

from factoryfloor_helpers.context_services import TableBuilder
from factoryfloor_helpers.environment import get_base_url
from five9 import RestAdminAPIClient

# Create a Five9 client
f9client = RestAdminAPIClient(
    base_url=get_base_url("US"),
    username="your_username",
    password="your_password",
    domain_id="your_domain_id"
)

# Create a table builder
table_builder = TableBuilder(f9client, dev_mode=True)

# Create a datatable
table = table_builder.create_datatable("MY_TABLE", "My test table")

# Define attributes
attributes = [
    {
        'name': 'ID',
        'type': 'STRING',
        'unique': True,
        'required': True,
    },
    {
        'name': 'NAME',
        'type': 'STRING',
        'unique': False,
        'required': True,
    }
]

# Create attributes
table_builder.create_attributes(table, attributes)

# Create a query
table_builder.create_query(table.id, "MY_QUERY", "My test query", "AND", ["ID"])

License

MIT

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

factoryfloor_helpers-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

factoryfloor_helpers-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file factoryfloor_helpers-0.1.0.tar.gz.

File metadata

  • Download URL: factoryfloor_helpers-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for factoryfloor_helpers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bee807cfb5522a2efd7927adcf5744b40e8e99d4b1726776a083dd783fd9f46
MD5 6c797d3341f92da2a8b874e83572c0ab
BLAKE2b-256 de22e18d23fc77a41bde879e1f636c0a87f43a67ed49513191b7f25e41a9aa87

See more details on using hashes here.

File details

Details for the file factoryfloor_helpers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for factoryfloor_helpers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3636e3f08b544031dabeccfe8e2439325559e866f7918189028bca3fc5f9d3a7
MD5 1f3c89c2ce3f8868df9f10382b4d256f
BLAKE2b-256 0fa00deab13ba792411d4a9571d8f07714b9241d593d39ccbb6bfc218e735a97

See more details on using hashes here.

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