Skip to main content

Easily convert differt time-range format to standard ones

Project description

PyTime Converter

codecov Build Status

Easily manage different time interval values and convert them to milliseconds.

How To use

Available time formats

Unit Measure Allowed Sigles default
milliseconds ms , milliseconds, sec X
seconds seconds , s, sec
minutes min , minute, minutes
hours h , hours, hrs, hour
days d , days, day
years y , years, yrs, year
  • Simply using the get_milliseconds_value_for_input with the string value to convert. The below example use the number value 90 and the sigle s.
from pytime_converter.service.convert_service import get_milliseconds_value_for_input

job_time =  '90 seconds' 

assert 90000 == get_milliseconds_value_for_input(job_time)
  • When the time measure unit is missing the default value is milliseconds
from pytime_converter.service.convert_service import get_milliseconds_value_for_input

assert 90 == get_milliseconds_value_for_input('90')

# Using seconds
assert 9000 == get_milliseconds_value_for_input('9 seconds')
assert 9000 == get_milliseconds_value_for_input('9 s')
assert 9000 == get_milliseconds_value_for_input('9 sec')

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • Poetry >=0.12
  • Python ^3.5
  • Virtualenvwrapper or other virtualenv environment
  • make utility

Installing

  • Install it with pypi

    pip install pytime-converter
    
  • Or Clone/download the repository

    git clone https://github.com/massicer/Env-Time-Converter.git
    

    Install project package

    make install
    

    or without the make utility

    poetry install
    

Running the tests

Clone the rempo and simply type

make test

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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

pytime-converter-0.1.8.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

pytime_converter-0.1.8-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file pytime-converter-0.1.8.tar.gz.

File metadata

  • Download URL: pytime-converter-0.1.8.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.6 Darwin/19.5.0

File hashes

Hashes for pytime-converter-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7c3ea1846b469718b91927174ccbedd8d414f90f39af981bfe2053a862a29d9b
MD5 ae1184234a7273db386200333b35da2f
BLAKE2b-256 63cb70715986e5db2772f65caca4b3d20dbeced912413f0bd6bbc19a31262d3b

See more details on using hashes here.

File details

Details for the file pytime_converter-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: pytime_converter-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.6 Darwin/19.5.0

File hashes

Hashes for pytime_converter-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e21ac0c43fe1581a952ab13ae7adb4188747bd3691d723928d79aa07d39dd1
MD5 4d69c513957952631120da46b1f25c61
BLAKE2b-256 7d00fc516489e4b1ddacac7f5ffe7f4186df4c90d7f7bb3ea438228ba820cc1b

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