Saravanan666/pypi-org huggingface dataset:
Package: pytimeNSW
PyTimeNSW is a fork ofPyTimewith additional days added for NSW public holidays.InstallationpipinstallpytimeNSWTo Do ListAdd family_day public holiday for CanberraAdd is_public_can and public_holidays_can functions for CanberraAdd is_weekend function takes string or datimeTime and returns
BooleanAdd ‘Monday rollover’ for public holidays that land on a weekendAdd days_until that accepts public holiday name as argument and
returns intChange is_public to work for python2 list comprehensions ## Basic
Usage>>>frompytimeNSWimportpytimeNSW>>>>>>queen=pytimeNSW.queen()# Queen's Birthday>>>print(queen)datetime.date(2017,6,12)>>>>>>pytimeNSW.public(easter)# Easter Public Holidays[datetime.date(2017,3,30),datetime.date(2017,3,31),datetime.date(2017,4,1),datetime.date(2017,4,2)]>>>>>>labour=pytimeNSW.labour(2019)# 2019 Labour Day>>>print(labour)datetime.date(2019,10,7)Other public holidays>>>pytimeNSW.boxing()# Boxing Daydatetime.date(2015,12,26)>>>>>>pytimekr.anzac()# Anzac Daydatetime.date(2017,4,25)>>>>>>pytimeNSW.australia()# Australia Daydatetime.date(2017,1,26)>>>pytimeNSW.public_holidays(1995)# List of public holidays in given year[datetime.date(1995,4,25),datetime.date(1995,1,26),datetime.date(1995,4,14),datetime.date(1995,4,15),datetime.date(1995,4,16),datetime.date(1995,4,17),datetime.date(1995,1,1),datetime.date(1995,12,25),datetime.date(1995,12,26),datetime.date(1995,6,12),datetime.date(1995,10,2)]>>>pytimeNSW.ispublic('April 25 2015')# Verifies if a date is a public holidayTrueLicenseMIT
Package: py-timeout
py-timeoutpy-timeout - pure Python process based decorator that provides execution timeout for Python functions and methods. Since it is not based on signals, py-timeout works fine outside the main thread.Prerequisitespy-timeout requires python 3.6 or newer versions to run.InstallingCloning project from git repositorygitclonehttps://github.com/YADRO-KNS/py-timeout.gitInstalling from PyPipip3installpy-timeoutExamplesimporttimeout@timeout.timeout(duration=0.5)deffoo(value:int)->None:......@timeout.timeout(duration=0.5)defbar(self,value:str)->str:...Decorated function or method will be executed as a sub-process with expected life-time of passed duration value.importtimeoutimporttime@timeout.timeout(duration=5)deffoo()->None:whileTrue:time.sleep(1)try:foo()excepttimeout.TimeoutException:passIn case if for some reason execution will take longer than expected the process will be terminated and TimeoutException will be raised.VersioningWe useSemVerfor versioning.AuthorsAndrey AbramenkoSergey ParshinSee also the list ofcontributorswho participated in this project.LicenseThe code is available as open source under the terms of theMIT License.
Package: pytimeparse
Copyright (c) 2014 Will Roberts <wildwilhelm@gmail.com>Licensed under the MIT License (see source filetimeparse.pyfor
details).A small Python library to parse various kinds of time expressions,
inspired bythis StackOverflow question.The single functionpytimeparse.timeparse.timeparsedefined in the
library (also available aspytimeparse.parse) parses time
expressions like the following:32m2h32m3d2h32m1w3d2h32m1w 3d 2h 32m1 w 3 d 2 h 32 m4:134:13:024:13:02.2662:04:13:02.2662 days,  4:13:02(uptimeformat)2 days,  4:13:02.2665hr34m56s5 hours, 34 minutes, 56 seconds5 hrs, 34 mins, 56 secs2 days, 5 hours, 34 minutes, 56 seconds1.2 m1.2 min1.2 mins1.2 minute1.2 minutes172 hours172 hr172 h172 hrs172 hour1.24 days5 d5 day5 days5.6 wk5.6 week5.6 weeksIt returns the time as a number of seconds (an integer value if
possible, otherwise a floating-point number):>>> from pytimeparse import parse
>>> parse('1.2 minutes')
72A number of seconds can be converted back into a string using thedatetimemodule in the standard library, as noted inthis other StackOverflow question:>>> from pytimeparse import parse
>>> import datetime
>>> parse('1 day, 14:20:16')
138016
>>> str(datetime.timedelta(seconds=138016))
'1 day, 14:20:16'Future workGive the user more flexibility over which characters to use as
separators between fields in a time expression (e.g.,+might
be useful).Internationalisation?Wow,https://github.com/bear/parsedatetime.
Package: pytimeparse2
This is apytimeparsebased project with the aim of optimizing functionality and providing stable support.Copyright (c) 2021 Sergey Klyuykov <onegreyonewhite@mail.ru>Licensed under the MIT License (see source filepytimeparse2.pyfor
details).A small Python library to parse various kinds of time expressions,
inspired bythis StackOverflow question.The single functionpytimeparse2.parsedefined in the library parses time
expressions like the following:32m2h32m3d2h32m1w3d2h32m1w 3d 2h 32m1 w 3 d 2 h 32 m4:134:13:024:13:02.2662:04:13:02.2662 days,  4:13:02(uptimeformat)2 days,  4:13:02.2665hr34m56s5 hours, 34 minutes, 56 seconds5 hrs, 34 mins, 56 secs2 days, 5 hours, 34 minutes, 56 seconds1.2 m1.2 min1.2 mins1.2 minute1.2 minutes172 hours172 hr172 h172 hrs172 hour1.24 days5 d5 day5 days5.6 wk5.6 week5.6 weeksIt returns the time as a number of seconds (an integer value if
possible, otherwise a floating-point number):>>> from pytimeparse import parse
>>> parse('1.2 minutes')
72For months and years, the library does not consider complications such as leap-
years and leap-seconds. Instead, it assumes “30 days for a month” and “365 days
for a year” as the basis for calculations with those units.2 mo2 months3y3 years1y2mo3w4d5h6m7s8msFor better capability with dates, use keywordas_timedelta=Truewhich mark for function returns
value asdatetime.timedeltaordateutil.relitivedelta.relativedelta(if installed):>>> from pytimeparse import parse
>>> parse('24h', as_timedelta=True)
relativedelta(days=+1)You can also forced disable dateutil support by callingdisable_dateutil()beforeparse(...).
For returning support callenable_dateutil().NotesA number of seconds can be converted back into a string using thedatetimemodule in the standard library, as noted inthis other StackOverflow question:>>> from pytimeparse import parse
>>> import datetime
>>> parse('1 day, 14:20:16')
138016
>>> str(datetime.timedelta(seconds=138016))
'1 day, 14:20:16'Future workSpeed up with Cython for some python versions.Use github actions for testing and releasing.
Package: pytimeparser
Python time expressions parserBasic Python module to parse time expressions.Free software: MIT licenseDocumentation:https://pytimeparser.readthedocs.io.UsageTo use Python time expressions parser in a project:import pytimeparser

output_timedelta = pytimeparser.parse('3 days 5:12:43.123')

print(output_timedelta.total_seconds())CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.0 (2018-06-11)RaiseValueErrorin case no time expression recognized.0.1.0 (2018-04-02)First release on PyPI.
Package: py-timer
模块名称 MODULE NAMEtimer简介 DESCRIPTIONA Python timer module, containing class Timer() and decorator function timer(),
as well as some useful related functions, can be used for program performance analysis.
一个Python计时器模块, 其中包含Timer()类和timer()装饰器, 以及一些有用的相关函数, 可用于程序性能分析。包含的函数和类 Functions & Classes:类:class Timer一个计时器类start()开始计时。此方法在Timer类初始化时会被自动调用。gettime()获取从计时开始到现在的时间。printtime(fmt_str=”用时:{:.8f}秒”)打印出从计时开始到现在的时间, 也就是获取的值。函数:timer(msg=None, file=sys.stdout, flush=False):一个装饰器, 为某个函数计时 (比使用Timer类更快、更简单)。
用法:@timer(msg="用时:{time}秒")
def func(args):
        print("Hello World!")

#或:
@timer
def func(args):
        print("Hello World!")示例代码 EXAMPLES示例1:importtimert=timer.Timer()#初始化Timer对象do_something()t.printtime()#输出执行do_something()所用时间 (也可使用t.gettime()获取所用时间)示例2:#退出with语句时自动打印出所用时间。importtimerwithtimer.Timer():#在这里开始计时do_something()示例3:# 为某个函数计时fromtimerimporttimer@timerdeffunc():print("Hello World!")示例4:# 程序精确地延迟一段时间fromtimeimportsleepfromtimerimportsleepassleep2sleep(0.0001)sleep2(0.0001)# 经测试表明, time模块的sleep()函数与本模块的函数相比, 有明显的延迟版本 VERSION1.2.3作者 AUTHOR七分诚意 qq:3076711200 贴吧账号:qfcy_作者CSDN主页:https://blog.csdn.net/qfcy_
Package: pytimers
Pytimers is a python micro library that allows you to quickly measure time to run functions, methods or individual blocks of codes. Here’s a quick demo.importloggingfromtimeimportsleepfrompytimersimporttimerlogging.basicConfig(level=logging.INFO)@timerdeffoo()->None:print("Some heavy lifting.")sleep(2)if__name__=="__main__":print("Let's call the function decorated with timer.")foo()print("Use timer context manager.")withtimer.label("sleeping block"):print("Some more work to do.")sleep(1)Let's call the function decorated with timer.
Some heavy lifting.
INFO:pytimers.triggers.logger_trigger:Finished foo in 2s 0.494ms [2.0s].
Use timer context manager.
Some more work to do.
INFO:pytimers.triggers.logger_trigger:Finished sleeping block in 1s 1.247ms [1.001s].See the fullDocumentation.Build StatusPyPi
Package: pytimes
A small helper package for working with time intervals.This package provides a single class calledSeconds(a subclass ofint) that
represents a time interval in seconds. It also provides a number of constants that
represent common time intervals, such asONE_SECONDandONE_DAY.The intended use of this package is to provide a more readable alternative to using
raw numbers for time intervals. For example, instead of writingtime.sleep(86400)to sleep for one day, you can writetime.sleep(ONE_DAY). This makes the code more
readable and easier to understand.TheSecondsclass also provides attributes for accessing the interval in other
units of time, such asminutesandhours.Shoot me an email if you use it and find it useful, or if you have any suggestions!Usage>>>fromtimesimportTHREE_MINUTES>>>importtime>>>time.sleep(THREE_MINUTES)>>>importtimes>>>times.ONE_DAY86400>>>times.THREE_HOURS.years0.00034223866072692215>>>times.FIVE_MONTHS.minutes219145.25fromtimesimportSeconds,TEN_YEARS>>>century=Seconds(TEN_YEARS*10)>>>century3155692500>>>century.hours876581.25InstallationpipinstallpytimesReferenceTheSecondsclass is a subclass ofintthat represents a time interval in seconds. It usually won't be instantiated directly, but rather used via the constants defined in this module. It offers the following
attributes:seconds: The interval in seconds.minutes: The interval in minutes.hours: The interval in hours.days: The interval in days.weeks: The interval in weeks.months: The interval in months. A month is defined as 1/12 of a year.years: The interval in years. A year is defined as 365.242196 days.The following constants are defined in this module:ONE_SECONDONE_MINUTEONE_HOURONE_DAYONE_WEEKONE_MONTHONE_YEAR... And many more, in variations likeTWO_DAYS,THREE_WEEKS,FOUR_MONTHS, etc.RequirementsPython 3.6+LicenseMITChangelog1.11.0Now fully typed and compatible with mypy.
Package: pytimeset
PyTimeSetLibrary that defines time intervals and sets and offers typical operations
between them using Cython for speed.InstallationRequirements: Python 3.6+To install, simply runpipinstallpytimesetBasic Usage:This library defines two immutable, timezone-aware, objects: TimeInterval and TimeSet.Time intervals are defined by their start and end moments. Intervals
are defined to contain their start point, but not their end point (closed to the
left, open to the right).Time sets are defined by the minimum set of intervals that contains all the points in it.
This means that the intervals passed to the constructor of the TimeSet may not be
the same intervals contained inside it, as "touching" intervals are merged and empty intervals are
removed.fromdatetimeimportdatetimefromtimesetimportTimeInterval,TimeSett0=datetime(2019,7,19)t1=datetime(2019,7,20)t2=datetime(2019,7,21)t3=datetime(2019,7,22)t4=datetime(2019,7,23)empty=TimeInterval(t0,t0)i0=TimeInterval(t0,t2)i1=TimeInterval(t1,t3)i2=TimeInterval(t3,t4)i3=TimeInterval(t0,t4)i0.contains(t1)# Truei0.start==t0# Truei0.end==t2# Truei0.overlaps_with(i1)# Truei0.is_subset(i3)# Trueempty.is_subset(i2)# True, the empty set is subset of every other set.i0.intersection(i1)# TimeInterval(t1, t2)Undefined behaviorIntervals defined by a single point (Such as TimeInterval(t, t)) are a bit weird.
As of now, I have defined them to be equivalent to the empty set, but that might change in the future,
so just don't mess too much with them.This library is timezone-aware, meaning that you can pass timezone-aware datetimes to it and you will
get back datetimes in the same timezone. That said, if you mix timezones, the results will point to the
right moment in time, but their timezones are undefined (meaning any one of those you originally passed).
When in doubt, simply convert the results to your preferred timezone.
Package: pytimings
PyTimingsMPI Aware section timingsFree software: BSD licenseDocumentation:https://pytimings.readthedocs.io.FeaturesAutomatic, decorator-based code timingsAware of MPI parallel runsmanual controlstructured (CSV/terminal) outputmatplotlib plotting of resultsUsageSeethis sectionin our documentationCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: pytimize
Python optimization library for mathematical programming.IntroductionPytimize is a python library forFormulating and solving complex linear, integer, and nonlinear programs.Performing combinatorial optimization with directed/undirected graphs and flows.Visualizing polyhedrons and displaying computation process.Install usingpip install pytimize!DocumentationComing soon!ExampleThe following shows a code snippet for constructing a linear program and solving
it with two phase simplex. For more detailed examples, please seepytimize/examples.>>>frompytimize.formulations.linearimportvariables,minimize>>>a,b,c,d,e=variables(5)>>>p=minimize(4*c-11*d-e+17).subject_to(a+2*c+7*d<=2+e,b-4*c-5*d>=1-3*e).where(a>=0,b>=0,c>=0,d<=0,e<=0)>>>pMin[0.0.4.-11.-1.]x+17.SubjectTo:[1.0.2.7.-1.]≤[2.][0.1.-4.-5.3.]x≥[1.]x₄,x₅≤0x₁,x₂,x₃≥0>>>p.dual()Max[2.1.]xSubjectTo:[1.0.]≤[0.][0.1.]≤[0.][2.-4.]x≤[4.][7.-5.]≥[-11.][-1.3.]≥[-1.]x₁≤0x₂≥0>>>p.to_sef(in_place=True)Max[0.0.-4.-11.-1.0.0.]x+17.SubjectTo:[1.0.2.-7.1.1.0.]=[2.][0.1.-4.5.-3.0.-1.]x=[1.]x≥0>>>solution,optimal_basis,certificate=p.two_phase_simplex()>>>solution,optimal_basis,certificate(array([2.,1.,0.,0.,0.,0.,0.]),[1,2],array([0.,0.])>>>p.verify_optimality(certificate)True>>>p.optimal_value()17.0You can also formulate the exact same program by specifying the objective
function and constraints in matrix form:>>>frompytimize.programsimportLinearProgram>>>importnumpyasnp>>>A=np.array([[1,0,2,7,-1],[0,1,-4,-5,3]])>>>b=np.array([2,1])>>>c=np.array([0,0,4,-11,-1])>>>z=17>>>p=LinearProgram(A,b,c,z,"min",["<=",">="],negative_variables=[4,5])>>>pMin[0.0.4.-11.-1.]x+17SubjectTo:[1.0.2.7.-1.]≤[2.][0.1.-4.-5.3.]x≥[1.]x₄,x₅≤0x₁,x₂,x₃≥0ContributingPytimize is a work in progress project. Contributions are welcome on a pull request basis.CreditsPytimize is created and maintained by Terry Zheng, Jonathan Wang, and Colin He.
Logo is designed by Kayla Estacio.
Package: py-timod
timodLibrary for creating ThingsDB modules using the Python languageInstallation$pipinstallpy-timodUsageModules for ThingsDB read fromstdinand write a response back tostdout. Work by the module must be non-blocking.If the module requires configuration data, for example a connection string, then this configuration will be send immediately after start-up but may be received again when the module configuration is changed in ThingsDB.Do not use functions likeprintsince these function will write tostdoutand this is reserved for ThingsDB. Instead, uselogging...to write tostderrinstead.The following code may be used as a template: (see:https://github.com/thingsdb/ThingsDB/tree/master/modules/python/demo.py)importloggingfromtimodimportstart_module,TiHandler,LookupErrorclassHandler(TiHandler):asyncdefon_config(self,cfg):logging.info(cfg)asyncdefon_request(self,req):if'message'notinreq:raiseLookupError('missing `message` in request')returnreq['message']if__name__=='__main__':start_module('demo',Handler())
Package: pytineye
pytineyepytineyeis the official Python client library for the TinEye API. The TinEye API
is TinEye's paid search alternative for professional, commercial or high-volume users.
Seehttps://api.tineye.com/for more information.ContentsInstallationMigrating from previous versionsDocumentationSupportInstallationInstall the latest version of the library using pip:$python-mpipinstallpytineyeMigrating from previous versionsIf you were using any version ofpytineyebefore3.0.0, you will need
to make minor changes to your code.The API object is now instantiated using a single key,api_key. The value
of this key is the same as your previousprivate_key. The public key is no
longer used.New ✅# Sandbox key# Note that this is the same value as the old private_keyapi_key="6mm60lsCNIB,FwOWjJqA80QZHh9BMwc-ber4u=t^"api=TinEyeAPIRequest(api_url="https://api.tineye.com/rest/",api_key=api_key,)Old ❌# Sandbox keyspublic_key="LCkn,2K7osVwkX95K4Oy"private_key="6mm60lsCNIB,FwOWjJqA80QZHh9BMwc-ber4u=t^"api=TinEyeAPIRequest(api_url="https://api.tineye.com/rest/",public_key=public_key,private_key=private_key,)DocumentationViewdocumentation.SupportPlease send comments, recommendations, and bug reports tosupport@tineye.com.
Package: pytint
PyTintpython package to colorize envy icons, themes, etc.how does it work?the pytint module operates on a single svg file, or a directory of svg files. it
takes an input blueprint, and converts the basic colors into the selected
scheme.the main blueprint scheme should consist of a combination of 5 colors:main colors:#00FF00:
default color#0000FF:
accent colorscheme colors:#FF0000:
background color#FFFFFF:
background accent color#000000:
difference colorthose colors are then converted in the following way:#00FF00→ default#0000FF→ accent#FF0000→ variant#FFFFFF→ alt#000000→ differenceexamples:purple color, light schemedefault:#00FF00→#613583accent:#0000FF→#DC8ADDvariant:#FF0000→#241F31alt:#FFFFFF→#5E5C64difference:#000000→#C0BFBCyellow color, dark schemedefault:#00FF00→#E5A50Aaccent:#0000FF→#F9F06Bvariant:#FF0000→#C0BFBCalt:#FFFFFF→#F6F5F4difference:#000000→#241F31orange color, dark scheme, inverteddefault:#00FF00→#C64600accent:#0000FF→#FFBE6Fvariant:#FF0000→#241F31alt:#FFFFFF→#5E5C64difference:#000000→#C0BFBcusagepytintcolorize a single svg filefrompytint.pytintimportPyTint# blueprint filesvg_in="/home/user/blueprints/blueprint.svg"# output filesvg_out="/home/user/colorized/red.svg"PyTint("red","dark").tint_svg(svg_in,svg_out)colorize all svgs in a directorysvg_dir="/home/user/blueprints"out_dir="/home/user/colorized"# use inverted scheme (light theme uses dark colors)PyTint("blue","light",inverse_scheme=True).tint_batch(svg_dir,out_dir)colorsget default values listfrompytint.colorsimportColorscols=Colors()default_colors=cols.get_defaults()print(f"default colors:\n{default_colors}")get scheme variants listvariants=cols.get_scheme_variants()print(f"available variants:\n{variants}")get supported colors listcolors=cols.get_colors_list()print(f"available colors:\n{colors}")select scheme# normalvariant,alt,difference=cols.select_scheme("dark")# invertedvariant,alt,difference=cols.select_scheme(variants[1],inverse=True)select colordefault,accent=cols.select_color("blue")print("blue: ",default,accent)default,accent=cols.select_color(colors[0])print(f"{colors[0]}: ",default,accent)
Package: pytiny
PyTinyPyTiny is an in-memory key–value database written in Python.Set upfrom pytiny import PyTiny

db = PyTiny()FunctionsSetSet a key and valuedb.set("Key")GetGet a value from a keydb.get("Key", "Value")DeleteDelete a value from a keydb.delete("Key")ResetReset the data. All data stored will be delete.db.reset()ExportExport the data to a .db filedb.export()BringImport a file. This will be delete all data stored before, and will be restore the new data from the file.db.bring("file_name")AuthorAlvaro Azael Rodriguez Rodriguez - (Development Lead) [Gitlab,Twitter]LicenceThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: pytinybeans
Tinybeans API Wrapper (unofficial)This library will allow you to interact withTinybeans.Installationpip install pytinybeansExamplesIn[1]:frompytinybeansimportPyTinybeansIn[2]:tb=PyTinybeans()In[3]:tb.login('<username>','<password>')In[4]:print(tb.children)[<JaneDoe2019-10-1600:00:00>]In[5]:entry=tb.get_entries(tb.children[0])[0]In[6]:entry.blobsOut[6]:{'o':'https://tinybeans.com/pv/e/<url>/<url>.jpg','p':'https://tinybeans.com/pv/e/<url>/<url>.jpg'}In[7]:entry.comments[0].textOut[7]:'Ok, I got this!'NotesThis isn't a wonderful example of API design, and there's some weirdness like using.format()in some places vs old style string replacement in others. In my defense, I was extremely sleep deprived, but it's functional :)
Package: pytinyexr
PyEXRLoading OpenEXR (.exr) images using Python.It is basically a Python binding for tinyexr. Use CMake to build the module (uses pybind11). Installation script is not there, you can simply copy the resulting python module files. Supports loading functionality, saving can be easily added (pull requests welcome!).UsagefrompytinyexrimportPyEXRImage# Load an EXR image (tinyexr backend)img=PyEXRImage('2by2.exr')# Print basic detailsprint(img)# Pixel values accessr=img.getPixel(x,y,0)g=img.getPixel(x,y,1)b=img.getPixel(x,y,2)a=img.getPixel(x,y,3)# Numpy:m=np.array(img,copy=False)# orrgb=np.reshape(np.array(rgb_img,copy=False),(rgb_img.height,rgb_img.width,4))# a matrix of (height x width x channels)# DisplayfromPILimportImageImage.fromarray(np.clip(np.uint8(rgb*255.0),0,255)).show()PyPI packagePyPI package is registered as pytinyexr:https://pypi.org/project/pytinyexr/$ pip install pytinyexrFor developerFor each release, upload source distribution from local.$ rm -rf dist && python setup.py sdist
$ twine upload dist/*.tar.gzNotice.Python2.7 wheel is not provided.