Skip to main content

Python utility functions for Tetra Task Scripts

Project description

ts-task-script-utils

Build Status

Utility functions for Tetra Task Scripts

Installation

pip install ts-task-script-utils

Usage

from task_script_utils.is_number import isnumber

print(isnumber('a'))

Datetime Parser

from task_script_utils.datetime_parser import parse

parse("2004-12-23T12:30 AM +05:30")
parse("2004-12-23T12:30 AM +05:30", <datetime_config>)
parse("2004-12-23T12:30 AM +05:30", <format_list>)
parse("2004-12-23T12:30 AM +05:30", <format_list>, <datetime_config>)

Parse() returns a TSDatetime Object. You can use TSDatetime.tsformat() and TSDatetime.isoformat() to get datetime string. You can also use TSDatetime.datetime to access python datetime object.

You can read more about the datetime parser here.

Test

pipenv install --dev then pipenv run python -m pytest

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

ts-task-script-utils-1.1.0.tar.gz (19.9 kB view hashes)

Uploaded Source

Built Distribution

ts_task_script_utils-1.1.0-py3-none-any.whl (23.3 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