Saravanan666/pypi-org huggingface dataset:
Package: timeless
Timeless - a datetime toolkit for people in a hurry.Timelesssits on sholders of giants to provide a simple and easy to use datetime
toolkit. Simple date ranges, datetime operations and just one import.This package is a work in progress and it was created as a study object.🧠 Features✔️ very simple API✔️ minimal code to get things done✔️ easy use with other packages✔️ just one import✔️ few dependencies📦 Installationpipinstalltimeless📝 Why Timeless?It provides a simple API, heavily inspired byPendulum.I love Pendulum, although since last year (maybe 2 years) it doesn't seem to be actively maintained. If you like Pendulum, you will like Timeless. If you want a easy to adopt, integrate and expand package, you will like Timeless.💻 Sample usageTimeless use two main concepts:DatetimeandPeriod. A datetime is a point in Time, and a Period is a duration.Timeless doesn`t differentiate between datetime and date objects.All datetimes are assumed to be in the UTC+00:00 timezone if any other timezone isn`t specified.importtimelessstart=timeless.datetime(1900,1,1,zone="UTC")end=start.add(years=1)end.subtract(months=1)start.set(year=2099,month=2,day=26,hour=5,zone="America/Sao_Paulo")start.is_past()# Truestart.is_future()# Falsestart.set(year=2099).is_future()# True📜 DocsThe docs are under development, but it's (very) early stage is alreadyavailable.🏗️ DevelopmentTimeless relies onPoetry.Install the Python dependencies with:poetryinstall⚗️ Testingpoetryrunpytest--cov=timelesstests/
Package: timeless-loop
timeless_looptimeless_loop is a Python library that provides a custom asyncio event loop, allowing you to freeze time and avoid pesky delays while writing or testing async code.
It does so by defining a subclass of the standard librarySelectorEventLoop, which behaves nearly identically to the real one.
It differs in that it does not actually wait for any time to pass; instead, it simply advances the loop's internal clock to the exact time of execution of the next scheduled callback when there are no immediately ready loop callbacks available.
This allows you to run code that uses asyncio'ssleepandwaitfunctions without having to wait for the actual time to pass, without having to change any lines of code between the real and the fake time event loop.Installationtimeless_loop is available on PyPI and can be installed withpoetry,pip, or your favorite package manager.pipinstalltimeless_loopUsageThe recommended way of setting the TimelessEventLoop is through setring the loop policy withasyncio.set_event_loop_policy. It can be used as follows:importasyncioasyncdefmain():# code here will run on the TimelessEventLooppassif__name__=="__main__":# Set the event loop policy to use the TimelessEventLoopfromtimeless_loopimportTimelessEventLoopPolicyasyncio.set_event_loop_policy(TimelessEventLoopPolicy())asyncio.run(main())# OR:# Use the context manager:importtimeless_loopwithtimeless_loop:asyncio.run(main())Licensetimeless_loop is licensed under the MIT License. See the LICENSE file for more details.
Package: timelessnesses-typed-env
typed-envA python module that help you have a type safety on enviroment variableDocumentationtimelessnesses.TypedEnvA parent class that will help you ensure type safetiness on your enviroment variable.Usage:fromtimelessnessesimporttyped_envimportdatetimeclassMyDotEnv(typed_env.TypedEnv):# define your enviroment variable name and it's type (default value is optional and typing.Optional is also supported)AMONG_US:bool=TrueDISCORD_TOKEN:strDATETIME:datetime.datetime=datetime.datetime.now()NICE_DICTIONARY:typing.Dict[str,int]={"a":1,"b":2}DAMN_LIST:typing.List[int]=[1,2,3]BALLS_KIND:BallsEnum# oh no! TypedEnv doesn't support my custom class!# don't worry you can implement your own converter!a=MyDotEnv()a.add_validator(BallsEnum,lambdax:BallsEnum(int(x)))a.get_env(typed_env.Method.dotenv,dotenv=".env")# you have options to either get only from dotenv or os.environ or both!"""a.get_env(typed_env.Method.all, dotenv="path_to_.env") # this fetch all the variable from both dotenv and os.environa.get_env(typed_env.Method.env) # this fetch all the variable from os.environa.get_env(typed_env.Method.dotenv, dotenv="path_to_.env") # this fetch all the variable from dotenvNOTE: for dotenv/all method you have to supply dotenv argument"""a.raise_error_on_unknown_env(False)# if this set to true any excessive enviroment variable will raise an error (default is True)a.load()# let it do the work!TypedEnvsupports normal types likestrorintand alsotyping.Dictandtyping.Listetc. But it also supports custom type by adding a validator, you are also allowed to overwrite the default validator by usingTypedEnv.add_validatormethod.Check out more examples attestsfolder!
Package: timelib
Usagetimelib is a short wrapper around php’s internal timelib module.
It currently only provides a few functions:timelib.strtodatetime:>>> timelib.strtodatetime("today")
datetime.datetime(2009, 6, 23, 0, 0)
>>> timelib.strtodatetime("today")
datetime.datetime(2009, 6, 23, 0, 0)
>>> timelib.strtodatetime("next friday")
datetime.datetime(2009, 6, 26, 0, 0)
>>> timelib.strtodatetime("29 feb 2008 -108 years")
datetime.datetime(1900, 3, 1, 0, 0)timelib.strtotime:>>> import time, timelib
>>> time.ctime(timelib.strtotime("now"))
'Tue Jun 23 15:17:32 2009'
>>> time.ctime(timelib.strtotime("4 hours ago"))
'Tue Jun 23 11:17:38 2009'
>>> time.ctime(timelib.strtotime("20080229 -1 year"))
'Thu Mar  1 01:00:00 2007'BuildTo build timelib, first create a virtual environment, then run the following command:pip install –upgrade build pip
python -m buildLicenseext-date-lib contains unmodified sources from the php source
distribution. These are distributed under thephp license, version
3.01.The remaining part is distributed under the zlib/libpng license:Copyright (c) 2009-2011 PediaPress GmbHThis software is provided ‘as-is’, without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.This notice may not be removed or altered from any source
distribution.
Package: timelibWAM
timelibWAMtimelibWAM is an open source package meant to alert the user about the
completion of a program. This can work best with larger
projects in which may take longer periods of time to
finish running. The package can also alert the user
about errors that occur.InstallationCopy into terminal/command prompt:pip install timelibWAMUse1. Run:from timelibWAM import *IMPORTANT:When utilizing the library, run the import statement by itself. After
completing the entry, run the rest of your code. You will incur errors otherwise!2. Run tl.start() and save its return value in a variablefrom timelibWAM import * 

s = tl.start()3. Enter your code!from timelibWAM import * 

s = tl.start()

#Your code here4. Run one of our ending functions (print_end(), frame_end(), send_end(), or send_frame_end()) after your codefrom timelibWAM import * 

s = tl.start()

#Your code here

tl.send_frame_end(s)IMPORTANT:If you'd like to be alerted in the case of error, steps 2-4 should be within a try statement
followed by an except statement that runs one of our error functions (frame_alert() or error_alert())Best Setup -Copy and paste this bad boy for text and frame alerts:from timelibWAM import *

  try:
    s = tl.start() 

    *your code*

    tl.send_frame_end(s)

  except Exception as e:

    tl.error_alert()We know that there are plenty of things to be improved upon, so please let us know, or better yet, join in to create a better experience!
Package: timelimit
timelimitSets the time limit for slow-running functions. Runs functions in parallel
threads or processes.Tested with Python 3.6-3.9 on macOS, Ubuntu and Windows.Installpip3installtimelimitUsefromtimelimitimportlimit_thread,limit_process,TimeLimitExceededdefsluggish(a,b):...returna+b# will run sluggish(1, 2) in parallel thread no more than 5 secondsa_plus_b=limit_thread(sluggish,(1,2),timeout=5)# will run sluggish(1, 2) in parallel process no more than 5 secondsa_plus_b=limit_process(sluggish,(1,2),timeout=5)If the time is upIf the function did not complete its work within the specified time, aTimeLimitExceededexception is thrown.try:limit_thread(sluggish,(1,2),timeout=5)exceptTimeLimitExceeded:print("Oops!")If you set thedefaultargument (at least toNone), the default value is
returned instead of an exception.result=limit_thread(sluggish,(1,2),timeout=5,default=-1)ifresult==-1:print("Oops!")If time doesn't matterIf you do not specify thetimeoutparameter it will default tofloat('inf').
Thesluggishfunction will run in a parallel thread or process, but without
time constraints.# both call run the function in parallel thread without time limitslimit_thread(sluggish,(1,2))limit_thread(sluggish,(1,2),timeout=float('inf'))If you specify the valuetimeout = None, then thesluggishwill be
executed like a regular function, without starting processes or threads.# the following calls are equivalentsluggish(1,2)limit_thread(sluggish,(1,2),timeout=None)Thus, the limitation can be made optional and resource-saving.limit_thread(sluggish,(1,2),timeout=5ifin_hurryelseNone)
Package: timelimiter
Welcome to timelimiterPython time limit library, using event loop to schedule job.Resources:ChangelogPyPIInstallpipinstalltimelimiterUsageExtendTimeoutHandlerwithtimeoutexpressed in seconds。Override_runmethod。MySQLTimeoutHandlerfor example.fromtimelimiter.timeout_handlerimportTimeoutHandler,TimeoutHandlerFactoryclassMySQLTimeoutHandler(TimeoutHandler):timeout=0.5def__init__(self):super(MySQLTimeoutHandler,self).__init__()# Some way to get MySQL thread idself.thread_id=1def_run(self):# Kill MySQL connectionprint(self.thread_id)classMySQLTimeoutHandlerFactory(TimeoutHandlerFactory):defcreate_handler(self)->TimeoutHandler:returnMySQLTimeoutHandler()UseTimeLimiterto wrap the function。fromtimelimiter.event_loopimportstart_loopfromtimelimiter.time_limiterimportTimeLimiterstart_loop()factory=MySQLTimeoutHandlerFactory()@TimeLimiter(factory)deffoo():# Do something...ConfigurationUse environment to set configuration.NameDescriptionDefaultTIME_LIMITER_CAPACITYMax capacity for time limiter queue100,000Run testsmaketestAuthor👤Keyes HsuGithub:@KeyesHsu🤝 ContributingContributions, issues and feature requests are welcome!Feel free to checkissues page.Show your supportGive a ⭐️ if this project helped you!📝 LicenseCopyright © 2022Keyes Hsu.This project isMITlicensed.This README was generated with ❤️ byreadme-md-generator
Package: timeline
Copyright (c) 2011, Canonical LtdThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, version 3 only.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.The timeline package provides a way to model a series of actions. For instance,
during a web request the appserver might call out to a number of backend
services, make sql queries and memcached lookups. All of these actions can be
tracked in a single timeline, and that serialised or analysed for slow points.DependenciesPython 2.6+pytzTesting Dependenciessubunit (http://pypi.python.org/pypi/python-subunit) (optional)testtools (http://pypi.python.org/pypi/testtools)UsageCreate a timeline object:>>> from timeline.timeline import TimeLine
>>> log = TimeLine()Then add actions:>>> action = log.start('mycategory', 'mydetails')Perform your action and then tell the action it has finished:>>> action.finish()At this point you can start another action. If you wish to nest actions, pass
allow_nested=True to start().One of the things needed when working with timelines in complex applications is
locating the right one. Timeline provides a helper for WSGI apps:>>> from timeline import wsgi
>>> app = wsgi.make_app(inner_app)Calls to app will now inject a ‘timeline.timeline’ variable into the wsgi
environwhich can be used by inner_app to record actions.InstallationEither run setup.py in an environment with all the dependencies available, or
add the working directory to your PYTHONPATH.DevelopmentUpstream development takes place athttps://launchpad.net/python-timeline.
To setup a working area for development, if the dependencies are not
immediately available, you can use ./bootstrap.py to create bin/buildout, then
bin/py to get a python interpreter with the dependencies available.To run the tests use the runner of your choice, the test suite is
timeline.tests.test_suite.For instance:$ bin/py -m testtools.run timeline.tests.test_suiteIf you have testrepository you can run the tests with testr:$ testr run
Package: timelink
Timelink is an information system for person related information collected from historical sources.History1.1.2 (2024-02-27)Bug fixes #16 #24 #281.1.1 (2024-02-26)Includes basic templates, better integration with Travis CI1.0.5 (2024-02-07)Fix minor bugs, better interaction with Docker and Jupyter notebooks.1.0.4 (2024-02-06)Improved notebook integration, new tutorial and receipts notebooks in progress.1.0.3 (2024-02-01)Use new deployment method with Travis1.0.1 (2024-01-31)Fix travis build1.0.0 (2024-01-30)First release with Jupyter notebooks integration.0.3.10 (2022-06-07)Fix to_kleio() in models: now generates quotes and
triple quotes when necessary.0.3.9 (2022-05-26)Fix missing import in kleio.groups0.3.8 (2022-03-28)Fix bug with Session import in mhk.models.db0.3.3 to 0.3.7 (2022-03-27)Fix build on travis with auto deployment0.3.2 (2022-03-27)Fixes bug in package descrition preventing release in Pypi.0.3.1 (2022-03-25)All core ORM models for MHK databasesDynamic generation of ORM models from XML
files produced by the Kleio translator.Python definition of Kleio groups allows synonyms to be defined for
localized elements.Import from XML file to MHK databaseCLI interface refactored withTyperImproved documentationDevelopement related changesblackcan be used to format codeMore and better tests, handling of MHK
installation or lack of in CI tests0.3.0 (2022-03-05)Fixes bugs related to mapping legacy MHK databases0.2.9 (2021-09-30)Update requirements and docs0.2.10 (2022-03-30)Adds indexes to modelsAdded sqlite test dbBetter testing, travis integration improvedReplaced click with typer in cli interface0.2.9 (2021-09-30)Update documentation.0.2.8 (2021-09-30)Add to_json() method to KGroup, enabling Kleio to JSon serialization.0.2.7 (2021-08-29)Auto build on Travis, with release to pypiSkeleton docs on readthedocs0.1.0 (2021-07-09)First release on PyPI.
Package: timeloading
timeloadingAnimated loading bar. This package is a loading bar that appears when a specific function is run an animation and text. This bar is stoped to run after the function has finished working. You can control the shape and the waiting message, even the animation and its colors.Languages:* python3Supported Distributions:DistributionVersion CheckPython Test VersionSupportedStatusEverything worksUbuntu20.04.33.6, 3.7, 3.8, 3.9YesWorkingYesWindwos11.6.43.6, 3.7, 3.8, 3.9YesWorkingYesMacOS10.0.203483.6, 3.7, 3.8, 3.9YesWorkingYesInstallation:pip install timeloadingUsage:fromtimeloadingimport*# Default usage:exec(timeloading().loading(function))# In-depth use:exec(timeloading(animation,time_w).loading(function,args,msg,done))"""Help:# animation : ascii animation text list. ex: ["⢿","⣻","⣽","⣾","⣷","⣯","⣟","⡿"] OR "⢿⣻⣽⣾⣷⣯⣟⡿"# time_w : Transition time between animations.# function : The function name must be a string.# args : Function variables. ex: (var_name,) OR [var_name]# msg : Waiting message text.# done : Message after completion."""Examples:fromtimeloadingimport*# func1:deffunc1():time.sleep(3)# func2:deffunc2(x):time.sleep(x)# example-1:# Run the wait function "func1" for 3 seconds with default settings.exec(timeloading().loading(function="func1"))# example-2:# Run the wait function "func2" for 5 seconds and change the message settings.exec(timeloading().loading(function="func2",args=[5],msg="Loading....",done="ok"))# example-3:# The same as the previous example, but with a change in the speed and shape of the animation.exec(timeloading(animation=["[*  ]","[ * ]","[  *]","[ * ]",],time_w=0.1).loading(function="func2",args=[5],msg="Loading....",done="ok"))# example-4:# Example with colorfromhexorimport*# pip install hexorp2=hexor(True,"hex")s0=p2.c("*","#ff0000")s1=p2.c("*","#760e0e")s2=p2.c("*","#ff7272")l=[f"[{s0}{s1}{s2}]",f"[{s1}{s2}{s0}]",f"[{s2}{s0}{s1}]"]exec(timeloading(animation=l,time_w=0.1).loading(function="func2",args=[5],msg="Loading....",done="ok"))Screenshot:Changelog History:## 0.0.1 [13-03-2022]
- First public release.Go to this link to get more information
Package: timelog2csv
TimeLog2CSVtimelog2csv- converts a TimeLog calendar to a CSV file.TimeLog was a time tracking application for OS X. It stored it’s data
using iCal. OS X Mountain Lion (and Mavericks)dropped some featuresthat TimeLog
needed to talk to iCal. So it’s impossible to access the recorded data
because the application won’t even start.But this small tool can help: Export the iCal calendar which you used to
store TimeLog’s data. Then usetimelog2csvto convert it to a CSV file.Free software: BSD licenseDocumentationRepositoryIssue trackerFeaturesConvert an iCal file to CSVFilter by project nameInstallationAt the command line usingpip:$ pip install timelog2csvOr, if you havevirtualenvwrapperinstalled:$ mkvirtualenv timelog2csv
$ pip install timelog2csvUsageRuntimelog2csvlike so to see the help:$ timelog2csv -hChangelog0.1.1 (2013-11-06)Fixed release date of 0.1.0.0.1.0 (2013-11-06)First release on PyPI.
Package: timelogger
timelogger:A stopwatch-like time logger for Python programsIt provides:Tracking time spent throughout a program in a method similar to a stopwatchOutput via standard Python logger for simplicityOriginal use case:Python program containing many packages and modulesNeeded ability to log time gaps in a centralized way.e.g. time consumed for imports or function callsInstallation:pip install timelogger(Tested for Python >=3.6.5 on Linux (Ubuntu) and Windows 7/10)Usage:short example:# Set up your root logger, or use logcontrol
import logcontrol

# Import the package
import timelogger

# Customize the package logger, if needed
logcontrol.register_logger(timelogger.logger, "timelogger")
logcontrol.set_level(logcontrol.DEBUG, group="timelogger")
logcontrol.log_to_console(group="timelogger")

# Add a start time with a relevant name
timelogger.start("imports")

# imports of other packages for example purposes
import binascii
import decimal
import hashlib
import requests

# To log the time differential, set a stop time for the same name
timelogger.stop("imports")

# To set a specific log level for the time differential logs: (default is logging.INFO)
timelogger.set_log_level(logcontrol.DEBUG)
Package: timelogging
InstallationInstalltimeloggingin your shell with thePython Package Installer:pip3installtimeloggingUsageLogging functionalitiesTime LogThelogfunction is designed to be a drop-in replacement forprint:fromtimelogging.timeLogimportloglog('This is a log entry.')And this outputs the current time before the printout:16:20:00 INFO    This is a log entry.Day LogYou can also add the current day within the timestamp:fromtimelogging.dayLogimportloglog('This is a log entry.')And this outputs the current time with the day before the printout:31 16:20:00 INFO    This is a log entry.Cutom LogAdditionally, you can also create a custom timestamp formatting of thelogfunction according to thePython time formatting directivesand a custom start log level according to thePython logging level values:fromtimeloggingimportconfigLog,logconfigLog(timeFmt='%Y-%m-%d%H:%M:%S',startLevel=20)log('This is a log entry.')And this outputs your custom timestamp before the printout:2020-12-31 16:20:00 INFO    This is a log entry.Changing the log levelSetting the log level globallyThe functions above set the log level immediately tologging.INFO. When this is not wanted, you can also importtimeLogLater,dayLogLaterto keep the log level atlogging.WARNat start or set thestartLevelparameter of the configLog function as you want.Then you can import the functionsstartLoggingandendLoggingto change the log level on the fly.fromtimelogging.timeLogLaterimportlog,startLogging,endLogginglog('not seeable')startLogging()log('seeable')endLogging()log('not seeable')This example logs this output only:16:20:00 INFO    seeableChanging the log level toINFOfor one log entryThis is possible with the functionlogOnce. It changes the log level toINFOjust for this log entry and after that it switches back toWARN(the default level). Simply use it as you would uselog.fromtimelogging.timeLogLaterimportlog,logOncelog('not seeable')logOnce('seeable')log('not seeable')This example logs the output oflogOnceonly, because otherwise the log level is set toWARN. This helps avoiding unwantedINFOlogs:16:20:00 INFO    seeable
Package: timeloop
# TimeloopTimeloop is a service that can be used to run periodic tasks after a certain interval.![timeloop](http://66.42.57.109/timeloop.jpg)Each job runs on a separate thread and when the service is shut down, it waits till all tasks currently being executed are completed.Inspired by this blog [`here`](https://www.g-loaded.eu/2016/11/24/how-to-terminate-running-python-threads-using-signals/)## Installation```shpip install timeloop```## Writing jobs```pythonimport timefrom timeloop import Timeloopfrom datetime import timedeltatl = Timeloop()@tl.job(interval=timedelta(seconds=2))def sample_job_every_2s():print "2s job current time : {}".format(time.ctime())@tl.job(interval=timedelta(seconds=5))def sample_job_every_5s():print "5s job current time : {}".format(time.ctime())@tl.job(interval=timedelta(seconds=10))def sample_job_every_10s():print "10s job current time : {}".format(time.ctime())```## Start time loop in separate threadBy default timeloop starts in a separate thread.Please do not forget to call ```tl.stop``` before exiting the program, Or else the jobs wont shut down gracefully.```pythontl.start()while True:try:time.sleep(1)except KeyboardInterrupt:tl.stop()break```## Start time loop in main threadDoing this will automatically shut down the jobs gracefully when the program is killed, so no need to  call ```tl.stop``````pythontl.start(block=True)```## Author* **Sankalp Jonna**Email me with any queries: [sankalpjonna@gmail.com](sankalpjonna@gmail.com).
Package: timelooper
TimelooperI found myself re-implementing the same
pattern over and over
when it comes to repeating some task until
some condition is met OR
the time is up, so here it is abstracted and generalized into
a neat package.Yep, that's 25 lines of code + tests.Here's a demo use case:fromtimelooperimportLooped,loop_timedfromdatetimeimporttimedelta# Suppose we are listening to some queue#   and want to batch the incoming messages.#   However, we only want to wait for#   some limited time for a batch#   to be formed.classCollectableBatch(Looped):def__init__(self,queue,maxsize):self.batch=[]self._queue=queueself._maxsize=maxsizeasyncdefdo(self)->None:self.batch.append(awaitself._queue.get())defshould_stop(self)->bool:returnlen(self.batch)==self._maxsizecollected=CollectableBatch(queue,maxsize=10)awaitloop_timed(collected,timedelta(seconds=30))print(collected.batch)# or whateverInstallationpipinstalltimelooper