Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

FactoryFloor Helpers

A collection of helper tools for FactoryFloor projects.

Installation

pip install f9-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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

f9_factoryfloor_helpers-0.1.1.dev1.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.

f9_factoryfloor_helpers-0.1.1.dev1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file f9_factoryfloor_helpers-0.1.1.dev1.tar.gz.

File metadata

File hashes

Hashes for f9_factoryfloor_helpers-0.1.1.dev1.tar.gz
Algorithm Hash digest
SHA256 63788e51813176bd4c5def3db5534a7927ef8a83e863bc8a38d9a913be3c514d
MD5 d566abeed79b2d6109df4945ac05c89a
BLAKE2b-256 ca49e114bca8433d7d5b7788979d41f7ee5a99edb49676f4432c61fda2af5a27

See more details on using hashes here.

File details

Details for the file f9_factoryfloor_helpers-0.1.1.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for f9_factoryfloor_helpers-0.1.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec8b8370d57cb7b3e3ba58a7524546fda11676d1453e4dead4b9bbb874194ee2
MD5 4e12118c50497d5ccaf6dcfd1bc4e70c
BLAKE2b-256 eeebe7531e05f6833d60f53a6339ebf89c6aeebef2fdb60051409a195ace69eb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1.dev1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page