Saravanan666/pypi-org huggingface dataset:
Package: timecalculator
TimeCalculatorThe TimeCalculator package is a Python package for converting time units to seconds. It provides a TimeCalculator class that can be used to convert any time unit to seconds, not just the predefined time units.FeaturesThe TimeCalculator package provides the following features:Conversion of any time unit to seconds using the TimeCalculator classPredefined time units for convenience, including:MINUTE: number of seconds in a minuteHOUR: number of seconds in an hourDAY: number of seconds in a dayWEEKEND: number of seconds in a weekend (2 days)WORK_WEEK: number of seconds in a work week (5 days)WEEK: number of seconds in a weekMONTH: number of seconds in a month (30 days)YEAR: number of seconds in a year (365 days)InstallationThe TimeCalculator package can be installed via pip:pip install timecalculatorUsageTo use the TimeCalculator package, you first need to create a TimeCalculator object:from timecalculator import TimeCalculator
tc = TimeCalculator()Once you have a TimeCalculator object, you can use theto_secondsmethod to convert any time unit to seconds. Theto_secondsmethod takes two arguments:time_valueandtime_unit. Thetime_valueargument is the value you want to convert, and thetime_unitargument is the unit of the value, expressed in seconds.Here's a simple example of how to use theto_secondsmethod to convert 5 minutes to seconds:minutes = 5
total_seconds = tc.to_seconds(minutes, tc.MINUTE)
print(f"{minutes} minutes is {total_seconds} seconds")In this example, we pass the value5and theMINUTEconstant to theto_secondsmethod to convert the time to seconds. The resulting value is stored in thetotal_secondsvariable. Finally, we print out the result.The output of this code will be:5 minutes is 300 secondsAPI ReferenceThe TimeCalculator class provides the following methods and attributes:to_seconds(time_value: float, time_unit: int) -> floatConvert a time value from one unit to another.time_value(float): The value to convert.time_unit(int): The unit of the value, in seconds.Returns:float: The converted value, in seconds.Predefined Time UnitsThe TimeCalculator class provides the following predefined time units for convenience:MINUTE(int): Number of seconds in a minute.HOUR(int): Number of seconds in an hour.DAY(int): Number of seconds in a day.WEEKEND(int): Number of seconds in a weekend (2 days).WORK_WEEK(int): Number of seconds in a work week (5 days).WEEK(int): Number of seconds in a week.MONTH(int): Number of seconds in a month (30 days).YEAR(int): Number of seconds in a year (365 days).ContributionsContributions to the TimeCalculator package are welcome.
Package: timecat
Usage: timecat -s ‘2016-01-02 20:13:14’ -e ‘2016-01-02 20:14:13’, or: timecat -d ‘2016-01-02’ -s ‘20:13:14’ -e ‘20:14:13’. timecat output contents within the specified [start, end) range, saving huge amounts of disk I/Os. Timecat supports popular datetime formats say syslog, apache, nginx, timestamp, etc. Datetime formats of -s and -e do not need to be consistent with that in file.
Package: timechimp
TimeChimp Python SDKDescriptionSDK to interact with TimeChimp APICan return a converted response to JSON and check for errors.Log HTTP method, url, params (hide access token)How to installpip3 install timechimpPackage Documentationhttps://timechimp.readthedocs.io/en/latest/Source structureTimeChimp endpoints are defined intimechimp.apiHow to useaccess token is retrieved through env variablesTIMECHIMP_ACCESS_TOKENTimeChimp API DocumentationGet the requests response objectimport timechimp

response = timechimp.api.users.get_all()Convert the response object to jsonimport timechimp

users = timechimp.api.users.get_all(to_json=True)Testpytest
Package: time-convert
Time ConvertIntroduction中文语义时间提取转换Installpip install time-convertUsageeg1:from time_convert import TimeNormalizertc = TimeNormalizer()msg =明天去你家'res = tc.parse(msg)print``(res){'key': '明天', 'type': 'timestamp', 'date': '2019-09-26 00:00:00'}eg2：from time_convert import TimeNormalizertc = TimeNormalizer()msg =明天去你家'timeBase=2013-02-28 16:30:29`res = tc.parse(msg, timeBase)print``(res){'key': '明天', 'type': 'timestamp', 'date': '2013-03-01 00:00:00'}返回值类型说明Time_Convert总的会返回四种类型的情况：1、timespan2、timestamp3、timedelta4、errorMark1、时间解析的默认basetime时间为请求的当前时间。2、也可以指定basetime，basetime的格式为：YYYY-MM-DD 00:00:00To do list1、timedelta的拼接2、'一会儿'等口语化表述时间的提取3、过两天，明天吧4、下礼拜
Package: time-converter
time_converterA Python class that allows for convenient conversion between different date and time formats and units.
The library supports both general-purpose Earth-based time units (such as Python'sdatetimetype, Day-of-year or
POSIX time) as well as time units useful for working with data from the Mars Science Laboratory and Chang'e 4 space
missions. It can be easily extended to support additional units.Notetime_converterwas developed in 2019 by Johan von Forstner while he was working on the MSL and LND missions,
with the goal of creating a simple API for time unit conversions with little external dependencies.The conversion between spacecraft clock and UTC is based on apure Python implementationof the SCLK kernel functionality from NASA's SPICE library, together with theSCLK kernel filethat is baked in to the library and needs to be updated occasionally.As Johan has since left the space science field, this library is no longer under active development - so use it at
your own risk.Especially if very high accuracy (on the order of a few seconds or better) is required and/or the dependency on
compiling the SPICE library is not an issue, I would instead recommend to use SPICE directly for MSL SCLK conversions.
In Python, this can be done withSpiceyPyor with one of the available
wrapper libraries (e.g.,ET SPICE).Installationpip3installtime_converterUsagefromtime_converterimportTimeTime(2019.5,'decimalyear').to('dt')# > datetime.datetime(2019, 7, 2, 12, 0)you can also supply list-like objects as input, the output will be anumpyarray.Time([2018.0,2018.1],'decimalyear').to('dt')# > array([datetime.datetime(2019, 1, 1, 0, 0),#          datetime.datetime(2019, 2, 6, 11, 59, 59, 999997)], dtype=object)Supported unitsEarth-based time unitsUnitExampleNameAbbreviated NamePython datetime (UTC)datetime.datetime(2019, 1, 1, 0, 0)datetimedtDoY Tuple (year, day of year)(2019, 1.0)doyDecimal year2019.0decimalyeardyPOSIX time1546300800posixMars Science LaboratoryThe MSL spacecraft clock (sclk) measures the number of seconds since January 1 2000, 11:58:55.816 UTC. However, due to
drifting of the clock, some corrections need to be applied based ona file supplied by NASA,
which this tool uses to do the conversion betweensclkand other units.UnitExampleNameMSL mission sol2276.8306983767375solMSL spacecraft clock599570768.5720837sclkChang'E 4For Chang'E 4, the conversion of spacecraft clock time to datetime has already implemented, so it does not need to be
included in time_converter. But we have implemented a converter for the lunar day number and local solar time at
Chang'E 4's landing site:UnitExampleNameLocal solar time at Chang'E 41, datetime.time(7, 32, 30)ce4lst
Package: time-cord
Quantify & take control of time spent on DiscordAbout timecordtime-cord is a library that:Tracks time spent on DiscordTracks time spent on specific servers & channelsCurrently only Mac OS is supported.Areas for improvement:Support for non-Mac OS devicesDependencies:PillowEasyocrtendotzlocalWith the rise of Discord as a platform for teams and friend groups alike, it's important to watch your time management on the platform. There are no current apps specifically for discord time management, so this library aims to fill that gap.Contributing to timecordIf you have suggestions for improving or extending this project, please submit a pull request or issue!InstallationThis library can be installed through pip: just type the commandpip install time-cord.
Package: timecount
timecountWork time tracking for hackers.RequirementsPython>= 3.8InstallInstall thetimecountpython package via pip from pypi.org:pip install --user timecountGetting StartedSimply create an executable file~/timelog(it doesn't matter where you put it) with the following example content:#!/usr/bin/env python3fromtimecountimportprocessfromtimecount.tctypesimport(EmploymentContract,Balance,Day,HoliDay,SickDay,VacationDay,)# fmt: offentries=[EmploymentContract(begin="01-04-2020",hours_per_week=30,vacation_days_per_year=23),Balance(remove_vacation_days=7,note="Contract starts with April, thus remove 3 Month."),Balance(reduce_week_target_by_days=2,note="You need to balance for two work days here, because you start in the middle of the week."),Day("01-04-2020",(12.30,20.00),(20.30,01.15),"Configure Workstation"),Day("02-04-2020",(14.30,00.30),"Configure Workstation"),Day("03-04-2020",(10.30,15.00),"Configure Workstation"),Day("06-04-2020",(10.00,14.30),(17.00,22.15),"Pair Programming Daniel."),Day("07-04-2020",(10.30,14.30),(15.30,21.45),"Pair Programming Daniel."),SickDay("08-04-2020","Covid19")Day("09-04-2020",(11.00,15.00),(19.30,22.00),"Meeting; Try test automation."),HoliDay("10-04-2020",(12.00,13.00),"Karfreitag; Tooling"),# I worked on this holiday..Day("11-04-2020",(11.00,14.00),(21.15,00.00),"Tooling, Testing."),Day("12-04-2020",(11.15,13.15),"Configure Workstation; Tooling;"),HoliDay("13-04-2020",(11.00,16.00),"Ostermontag; Slack Channel Catchup; System Setup; Tooling"),Day("14-04-2020",(11.00,14.00),(15.30,18.30),"Tooling; SlackMeetings;"),# Continue with your logs ...]process(entries)Now run~/timelogin your terminal to see the results.For convenience I suggest creating a symlink for thetimelogfile in your~/bindirectory, so you can calltimelogfrom anywhere in your terminal:ln-s~/timelog~/bin/timelogEntry TypesFor a list of EntryTypes and their arguments, seetctypes.py.ExamplesLook in./testsfor a more complete example.
Package: time-cross-validation
#Overview:The package provides quick train/test split indexing for cross validation, specifically optimized for time series data.
There are two primary output options:Expanding Window - in which the training window becomes larger with each fold and is always overlapping with part of the previous.Rolling Window - in which the training window is of a fixed pre specified dimension, and it may or may not overlap depending on the rolling step specified.#Example:'''
from time_cross_validation import TimeCV
import pandas as pd#sample X and Y variables:
X = pd.DataFrame([10,20,10,4,5,1,7,20])
Y = pd.DataFrame([5,1,7,20,10,20,10,4])CV = TimeCV(X, train_sample_size = 3,
test_sample_size = 3,
step = 1)
for train_index, test_index in CV.expanding_train_test_split():
x_train = X.iloc[train_index]
x_test = X.iloc[test_index]
'''
Package: timecube
timecube.pyWhen you need to fill up space with something more interesting than Lorem IpsumInstallpipinstalltimecubeUsageimport timecubeprint(timecube.generate(0, timecube.timecubeLength))Parametersstart: number (optional)default - 0stop: number (optional)default - timecube.timecubeLengthLicenseMIT ©FullstackSoftwareInnovations
Package: timed
timeda command-line time tracker.INTRODUCTION.1.  Timed stays out of your way.2.  Timed is as simple as possible.INSTALLATION.Method 1.$ git clone git://github.com/adeel/timed.git$ cd timed# python setup.py installMethod 2.# pip install timedUSAGE.$ timed start myprojectstarting work on myprojectat 16:35 on 07 Feb 2011$ timedworking on myproject:from     16:35 on 07 Feb 2011to now,  17:00 on 07 Feb 2011=> 0h25m have elapsed$ timed stopworked on myprojectfrom    16:35 on 07 Feb 2011to now, 17:40 on 07 Feb 2011=> 1h5m elapsed$ timed summarymyproject   1h5m$ cat ~/.timedmyproject: 16:35 on 07 Feb 2011 - 17:40 on 07 Feb 2011Remember that ~/.timed is just a text file so the standard UNIX textprocessing tools (grep et al.) are available.  For example, to see a summaryof your work during the month of January 2011:$ cat ~/.timed | grep "Jan 2011" | timed parseCOMMANDS.timed: alias for 'timed status'timed status:print current statustimed start <project>:start tracking for <project>timed stop:stop tracking for the active projecttimed summary:show a summary of all projectstimed parse:parses a stream with text formatted as a Timed logfile and shows asummarytimed help:print helpCHANGELOG.0.35: Added `timed parse`.0.30: Complete refactoring.0.20: Updated formatting (colors!).0.13: Stopped using ez_setup for installation.0.12: YAML turned out to be pretty slow, so it's been dropped.0.11: Using YAML to store the log.0.10: First release.AUTHOR.  Adeel Ahmad Khan <adeel@adeel.ru>.
Package: timed-batch-worker
Timed Batch WorkerPython library for efficiently batch-processing workloads asynchronously with batch-size- and time-based flushes using short-circuiting events.Installationpipinstalltimed-batch-workerUsagefromtimed_batch_workerimportTimedBatchWorker# Handle the batched itemsdefhandle_batch(items):http.post('/api/logs/bulk',data=items)# Create a worker that flushes the queue when:# 1. The batch contains 20 objects, or# 2. Five seconds have passed since the last flushworker=TimedBatchWorker(handler=handle_batch,flush_interval=5,flush_batch_size=20,)# Worker started in separate thread to avoid throttling main event loop# in case the batch handler includes synchronous workloads.worker.start()# Add objects to the current batch at any time@app.get('/users/create')defcreate_user():...# Hand off an object to the workerworker.enqueue({'event':'USER_CREATED','data':user})...
Package: timedcapture
timedcapturea cython-based module to achieve on-time video capture through V4L2.For a general usage, refer toUSAGE.PrerequisitesIMPORTANT NOTE: the current implementation only allows 16-bit grayscale acquisition.IMPORTANT NOTE: there is no functionality that controls the frame rate. Frame-capture timings must be controlled elsewhere, either using software or hardware timers.The library is tested on Ubuntu 18.04 LTS, but it is supposed to work on any Linux environment that runs V4L2.Please note that the library is optimized for cameras fromImagingSource.
By using devices from other manufacturers, you will not have control over functionalities such as:1 microsecond-order exposure control (V4L2 only allows the order of 10 microseconds)auto-gain/manual-gain switch (the gain control will be totally manual- or auto-controlled)trigger modes (by default, only the free-running mode will be allowed)"strobe" output
These settings must be configured elsewhere.InstallationFor the time being, we only provide the source distribution on PyPI.
You will need a working Cython and Numpy combinationpre-installed.$pipinstallnumpy>=1.19cython>=0.29# or: "conda install numpy cython", in case you use Anaconda$pipinstalltimedcaptureLicense2020 Keisuke Sehara, the MIT License.
Package: timed-count
timed-counttimed-countprovides an iterator that delays each iteration by a specified time period. It can be used to repeatedly  execute code at a precise frequency.timed-countis a good replacement for a loop that contains a call totime.sleep. It is precise, does not dependent on the loop execution time, and won't accumulate temporal drift.InstallationInstall fromPyPIvia:pipinstalltimed-countUsageBasic usage is as follows:fromtimed_countimporttimed_countforcountintimed_count(0.5):# Prints at exactly every half a secondprint(count)TimedCount(index=0,count=0.0,time=0.000,missed=False)TimedCount(index=1,count=0.5,time=0.500,missed=False)TimedCount(index=2,count=1.0,time=1.000,missed=False)...For all usage examples seeexamples/.
Package: timedctl
timedctlClick TUI forTimedusinglibtimed.InstallingThere are currently only packages for arch linux available in theAUR.$yay-StimedctlPeople on other distributions can use pip to install the package from pypi:$pipinstalltimedctlNix / NixOS people can just run the flake:nix run github:adfinis/timedctlShell completiontimedctlsupport shell completion for the unaliased commands:bash_TIMEDCTL_COMPLETE=bash_sourcetimedctl>>~/.bashrczsh_TIMEDCTL_COMPLETE=zsh_sourcetimedctl>>~/.zshrcfish_TIMEDCTL_COMPLETE=fish_sourcetimedctl>~/.config/fish/completions/timedctl.fishLocal developmentClone the repository and install the dependencies withpoetry install. You can now run the project withpoetry run timedctl. For building wheels, you can usepoetry build.
Run tests withpoetry run pytest --cov --cov-fail-under 100.Known issuesMake sure to have a polkit-agent running, otherwise the poetry installation during the installation on arch might fail.You need a keyring installed in order for timedctl to store the SSO token, for examplegnome-keyring.Feature roadmapSSO authOvertimeReportsGetAddDeleteUpdateActivitiesStartStopDeleteRestartAbsencesGetAddDeleteUpdateHolidaysGetAddDeleteUpdateConfigurationYour config file should already be created on the first launch under$XDG_CONFIG_HOME/timedctl/config.toml.
If this isn't the case you can see the default config options below:username="<your username>"timed_url="<timed url>"sso_url="<sso url>"sso_realm="<sso realm>"sso_client_id="<client id>"LicenseCode released under theGNU Affero General Public License v3.0.
Package: time-decode
Time DecodeA Python 3 timestamp and date decoder/encoder.I noticed a lack of timestamp conversion utilities in a number of different linux systems. Since I happen to use linux in my day-to-day work I thought this would help.This was developed with the Digital Forensics field in mind, so all of the testing has been done with the up-to-date SIFT Kit from SANS.
If you have any questions, suggestions, helpful thoughts of any kind, please feel free to drop me a line.RequirementsFor python3, dateutil does not come pre-installed as a module. It will need to be installed manually:sudo apt-get install python3-dateutilorpython3 -m pip install python-dateutilInstallpython3 -m pip install time-decodeorpython3 -m pip install git+https://github.com/digitalsleuth/time_decodeThis python script provides the following conversions from existing timestamps:128-bit SYSTEMTIME32-bit MS-DOS time, result is LocalActive Directory valueApple Biome 64-bit decimal formatApple Biome hex formatBitwise decimal 10-digitBPlist (as NSDate)Cocoa Core (as NSDate)DHCP6 DUIDDiscord URLexFATFAT Date + Time (wFat)FILETIMEGMail BoundaryGMail Message IDGoogle Chrome valueGoogle EI URL (thanks tohttp://cheeky4n6monkey.blogspot.com/2014/10/google-eid.html)GPSGSMHFS(+) BE, HFS Local, HFS+ UTCHFS(+) LE, HFS Local, HFS+ UTCHotmailiOS 11+ (as NSDate)KSUID 27-characterKSUID 9-digitMac Absolute Time (as NSDate)Mac OS/HFS+ Decimal TimeMastodon URLMetasploit Payload UUIDMotorola's 6-byteMozilla's PRTimeMS Excel 1904 Date.NET DateTimeNokia 4-byteNokia 4-byte LENokia S40 7-byteNokia S40 7-byte LEOLE Automation DateS32 Encoded (Bluesky Social timestamp)Samsung/LG 4-byteSonyflake URL (Sony version of Twitter Snowflake)Symantec's 6-byte AVTikTok URLTwitter URLUnix Hex 32-bit BEUnix Hex 32-bit LEUnix MillisecondsUnix SecondsUUIDVMWare Snapshot (.vmsd)Windows 64-bit Hex BEWindows 64-bit Hex LEWindows Cookie Date (Low,High)Windows OLE 64-bit BE (SRUM as well)Windows OLE 64-bit LENote that HFS times are in Local Time, where HFS+ times are in UTC. MS-DOS 32 bit Hex values and MS-DOS FAT Date+Time are also in Local Time of the source generating the timestamp. All other times, unless expressly mentioned, are in UTC.I have added a feature to 'guess' in what format the timestamp is that you've provided. This will run the timestamp you provide against all methods, and provide an output if human-readable.
There is also the ability to convert a date-time to all of the aforementioned timestamps. Simply use the following command:time-decode --timestamp "2023-04-27 16:14:15.678"or for timezones use:time-decode --timestamp "2023-04-27 16:14:15 -5"The date/time you enter should be in the "YYYY-mm-dd HH:MM:SS.sss" format with the double-quote included, but does not require milli/micro/nano seconds to work. (Double-quote required for Windows Python)
If anyone has any other timestamps they think should be added to this tool, please let me know.References/Sources for all material can also be found in the docstrings in the python script.
Package: timedelta
Installation$[sudo]pipinstalltimedeltaExamples>>>importtimedelta>>>td=timedelta.Timedelta(days=2,hours=2)# init from datetime.timedelta>>>td=timedelta.Timedelta(datetime1-datetime2)totalseconds, minutes, hours, days>>>td=timedelta.Timedelta(days=2,hours=2)>>>td.total.seconds180000>>>td.total.minutes3000>>>td.total.hours50>>>td.total.days2Linkstimedelta Objectsreadme42.com
Package: timedeltafmt
timedeltafmtA tool to parse and formattimedeltaExamplesfromdatetimeimporttimedeltafromtimedeltafmtimportparse_timedelta,format_timedelta,make_formatter,MICROSECOND,SECONDprint(parse_timedelta('1day 24h'))# 2 days, 0:00:00print(parse_timedelta('10s 1m 1s'))# 0:01:11print(format_timedelta(timedelta(weeks=1)))# 7dprint(format_timedelta(timedelta(days=365.25)))# 1yJIFFY_FMT=make_formatter({MICROSECOND:'ms',SECOND//50:'jiffies',})print(JIFFY_FMT.format(timedelta(seconds=2)))# 100jiffies
Package: timedelta-iso8601
timedelta-iso8601timedelta-iso8601provides supplementary ISO8601 duration support fordatetime.timedelta.The library contains a pure-Python implementation of ISO 8601 duration parsing that does not rely on regular expressions.Functionality is provided in a subclass ofdatetime.timedeltathat implements additionalisoformat()andfromisoformat(duration_string)methods.Usage>>>fromtimedelta_iso8601importtimedelta>>>fromdatetimeimportdatetime>>>>>>millenium=datetime(year=2000,month=1,day=1)>>>now=datetime.utcnow()>>>>>>td=timedelta(seconds=(now-millenium).total_seconds())>>>td.isoformat()'P8310DT16H21M3S'>>>>>>millenium+timedelta.fromisoformat('P8310DT16H21M3S')datetime.datetime(2022,10,2,16,21,3)
Package: timedelta-isoformat
Thetimedelta-isoformatlibrary provides supplementalISO 8601 durationsupport to thedatetime.timedeltaclass.The library is pure-Python, and does not depend upon regular expressions.Functionality is provided in a subclass ofdatetime.timedeltathat implements additionalisoformat()andfromisoformat(duration_string)methods.Usage>>>fromtimedelta_isoformatimporttimedelta>>>fromdatetimeimportdatetime>>>>>>first=datetime(year=2022,month=10,day=2)>>>second=datetime(year=2022,month=11,day=27,hour=14)>>>>>>td=timedelta(seconds=(second-first).total_seconds())>>>td.isoformat()'P56DT14H'>>>>>>first+timedelta.fromisoformat('P56DT14H')datetime.datetime(2022, 11, 27, 14, 0)Design decisionsA variety of ISO 8601 duration parsers exist across a range of programming languages, and many of them have made slightly different design decisions.Some of the significant design decisions made within this library are:Values in parsed duration strings must be zero-or-greater (PT1His considered valid;P-2Dis not)Empty time segments at the end of duration strings are allowed (P1DTis considered valid)Measurement limits are checked within date/time segments (PT20:59:01is within limits;PT20:60:01is not)Measurement values are parsed into floating-point values (at the time of writing, precise procedural algorithms to parse base-ten strings into integers for large inputs are not practical – or not widely known)When inputs are reliably known to be of correct type and format, assertions should be safe to remove (for example, by including the-O command-line flag when invoking the Python interpreter) to improve runtime performance
Package: timedelta-nice-format
Table of ContentsOverview.datetime.timedelta into nice formatted stringduration in seconds into nice formatted stringInstallation via pip:LinksContactsLicenseOverview.timedelta_nice_format is a PYPI package made with only one simple
goal to convert time durations into nice human readable formatdatetime.timedelta into nice formatted stringimportdatetimefromtimedelta_nice_formatimporttimedelta_nice_formatstart=datetime.datetime.now()# ...# You code here# ...print("Duration:",timedelta_nice_format(datetime.datetime.now()-start))duration in seconds into nice formatted stringimporttimefromtimedelta_nice_formatimportseconds_nice_formatstart=time.time()# ...# You code here# ...print("Duration:",seconds_nice_format(time.time()-start))Installation via pip:pipinstalltimedelta_nice_formatLinksPYPIGitHubContactsEmail:stas.prokopiev@gmail.comvk.comFacebookLicenseThis project is licensed under the MIT License.