Saravanan666/pypi-org huggingface dataset:
Package: date-pick
Welcome to date_pick ⛏️DescriptionPick date by conditions and list of re-like wildcardsQuickstart>>> from date_pick import DatePick
>>> import datetime
>>> 
>>> datetime.datetime.now()
datetime.datetime(2021, 11, 22, 15, 53, 20, 357911)
>>> 
>>> picker = DatePicker()
>>> # pick the nearest Monday 4 AM
>>> picker.pick(["*-*-*-0 04:00:00"])
"2021-11-29 04:00:00"AuthorsNick Kuzmenkov
Package: datepy
datepyVisit Github.datepy is a versatile Python library for parsing dates from various string formats into standardized RFC 3339 timestamps. It supports a wide range of date formats, including ISO 8601, RFC 822, long date formats, and more, with the ability to extend support through custom formats.FeaturesBroad Format Support: Handles numerous standard and custom date formats out of the box.Customizable: Easily extendable to parse non-standard date formats.Easy to Use: Simple and intuitive API.InstallationTo install datepy, simply use pip:pip install datepyUsagedatepy is easy to use. Simply import the library and call theparsefunction with the date string and the format of the date string. The function will return a standardized RFC 3339 timestamp.fromdatepyimportdatepydate_string="2021-01-01 12:00:00"rfc3339_date=datepy.convert_to_rfc3339(date_string)print(rfc3339_date)Additional FormatsPlease suggest a request and I can add the code/feature or format!
Package: date_range
In Python I can produce a range of numbers like this.range(1, 10)date_rangeproduces a range of dates like this.date_range(datetime.date(1990, 3, 30), datetime.date.today())Install from PyPI.pip install date_rangeRun tests like so.python test.pyIt currently supports only full dates, just as range only supports integers,
It would be cool to add support for producing datetimes spaced by something smaller,
like half-days; this would be akin to adding support for floats in range.
Package: date-range-filter
Date range FilterDate range Filter is a Dash component library.This is a dash datetime range picker based on React Advanced Date Time Range Picker
. In contrast to the dash datepicker from dash-core-components, it is also possible to specify hours and minutes on a certain day.Get started with:Install Dash and its dependencies:https://dash.plotly.com/installationRunpython usage.pyVisithttp://localhost:8050in your web browserContributingSeeCONTRIBUTING.mdInstall dependenciesIf you have selected install_dependencies during the prompt, you can skip this part.```Create a virtual env and activate.$ virtualenv venv
$ . venv/bin/activateNote: venv\Scripts\activate for windowsInstall python packages required to build components.$ pip install -r requirements.txtInstall the python packages for testing (optional)$ pip install -r tests/requirements.txt
Package: date-ranges
date-rangesADateRangetype and related utility functions.QuickstartInstall from pip:pipinstalldate-rangesImport and create an instance:fromdatetimeimportdatefromdate_rangesimportDateRangemy_date_range=DateRange(start=date(2023,5,10),end=date(2023,11,3))Usagefromdatetimeimportdatefromdate_rangesimportDateRange,MAX_DATE# end date defaults to MAX_DATEdr=DateRange(date(2023,11,1))date(2023,11,22)indr# True# An empty date (0 days in range):empty=DateRange.empty()bool(empty)# False# IterationfordinDateRange(date(2023,1,1),date(2023,1,3)):print(d)# 2023-01-01# 2023-01-02# 2023-01-03# Create from stringsdr=DateRange.from_string('20230101-20230103')repr(dr)# 'DateRange(start=datetime.date(2023, 1, 1), end=datetime.date(2023, 1, 3))'# Create range for a single datedr=DateRange.from_string('20231031')repr(dr)# 'DateRange(start=datetime.date(2023, 10, 31), end=datetime.date(2023, 10, 31))'# Create range for given year-monthdr=DateRange.from_string('202305')repr(dr)# 'DateRange(start=datetime.date(2023, 5, 1), end=datetime.date(2023, 5, 31))'# Create range for multiple full monthsdr=DateRange.from_string('202305-202311')repr(dr)# 'DateRange(start=datetime.date(2023, 5, 1), end=datetime.date(2023, 11, 30))'# Formatted printdr=DateRange(date(2023,1,1),date(2023,1,3))dr# 20230101-20230103print(f'{dr:H}')# H for human# 2023-01-01 to 2023-01-03# Full months rendered appropriatelydr=DateRange.from_string('202305')f'{dr:H}'# H for "human readable"# 'May 2023'f'{dr:C}'# C for compact# '202305'dr# '202305'DevelopmentFor those developing or maintaining thedate-rangespackage itself,
be sure to install it with the[dev]option to pull in packages
used when developing.pip install --editable .[dev]When developing, this package usespre-commit.  After the initial
clone of the repository, you will need to set up pre-commit with:# in the top level of the checked-out repository:
pre-commit installChangelog0.0.1 released 2023-11-03Initial Version
Package: daterangestr
Create meaningful date/time ranges using strings like e.g. “201301” or
“201301-201302”.Installpip install daterangestrQuickstartThedaterangestrhas exactly one function,to_dates, which
converts a date string of a certain, simple format to a datetime tuple.Example:>>> from daterangestr import to_dates
>>> (start, end) = to_dates("20131014-20131018")
>>> print start, end
2013-10-14 00:00:00 2013-10-18 23:59:59Supported string formatsRulesDates can be given in formatYYYY,YYYYMMorYYYYMMDD.The date string can contain either only one date or two dates,
seperated by a dash.If the dash seperator is present and only one date is given, the
other date is assumed to be the minimum possible or the maximum
possible date.Examples2012Jan 1 2012 - Dec 31 2012 (whole year)201201Jan 1 2012 - Jan 31 2012 (whole month)2012101Jan 1 2012 - Jan 1 2012 (whole day)2011-2011same as “2011”, which means whole year 20122011-2012Jan 1 2011 - Dec 31 2012 (two years)201104-2012Apr 1 2011 - Dec 31 2012201104-201203Apr 1 2011 - March 31 201220110408-2011Apr 8 2011 - Dec 31 201120110408-201105Apr 8 2011 - May 31 201120110408-20110507Apr 8 2011 - May 07 20112011-Jan 1 2012 - Dec 31 9999 (unlimited)201104-Apr 1 2011 - Dec 31 9999 (unlimited)20110408-Apr 8 2011 - Dec 31 9999 (unlimited)-2011Jan 1 0000 - Dez 31 2011-201104Jan 1 0000 - Apr 30, 2011-20110408Jan 1 0000 - Apr 8, 2011
Package: date-reclass
Json-Datetime-utilConvert data from str to datetime or datetime to str.
Can also get all dict or list values to convert all to requested type.How to Installpip install date-reclassHow to UseJson-datetime-util will allow the user to simply convert entire lists or dicts of data.All datetimes inside of the list or dict will be converted from str to datetime or vice-versa.When you have a str and need a datetime:from date_reclass import cast

date = '17/05/2020'
result = cast(date, '%d/%m/%Y').todatetime()
>>> '2020-05-17 00:00:00'If you have a list or dict the same code can be used:# dict example
from date_reclass import cast

date = {'date1':'17/05/2020','date2':'17/05/2021'}
result = cast(date, '%d/%m/%Y').todatetime()
>>> {'date1': datetime.datetime(2020, 5, 17, 0, 0), 'date2':{'date2': datetime.datetime(2021, 5, 17, 0, 0)}

# list example
from date_reclass import cast

date = ['17/05/2020','17/05/2021']
result = cast(date, '%d/%m/%Y').todatetime()
>>> [datetime.datetime(2020, 5, 17, 0, 0), datetime.datetime(2021, 5, 17, 0, 0)]When you have a datetime and need a string:from date_reclass import cast
import datetime

date = datetime.datetime(2020, 5, 17)
result = cast(date).tostr()
>>> '2020-05-17 00:00:00'For list or dict:# dict
from date_reclass import cast
import datetime

date = {'date1':'17/05/2020','date2':'17/05/2021'}
result = cast(date, '%d/%m/%Y').todatetime()
>>> {'date1': datetime.datetime(2020, 5, 17, 0, 0), 'date2': datetime(2021, 5, 17, 0, 0)}

# list
from date_reclass import cast
import datetime

date = ['17/05/2020', '17/05/2021']
result = cast(date, '%d/%m/%Y').todatetime()
>>> [datetime.datetime(2020, 5, 17, 0, 0), datetime(2021, 5, 17, 0, 0)]Run TestsRun tests by runningpython3 -m unittest app/tests/*/**.pyYou can also check coverage and generate a coverage reportcoverage run -m unittest tests/*.py && coverage report
Package: dates
I needed a console friendly tool to print dates, so I made one, basing it
on python-dateutil. Here is the output of –help:NAMEdates - prints a list of datesSYNOPSISdates [OPTIONS]OPTIONS–help:Print this help–freq <frequency>:Choose frequency (values admitted: YEARLY, MONTHLY, WEEKLY,
DAILY). Defaults to DAILY.–from, –dtstart:Recurrence start–to, –until:limit of the recurrence–step, –interval:The interval between each freq iteration. For example, when using
YEARLY, an interval of 2 means once every two years.–wkst:The week start day. Must be one of the MO, TU, WE constants, or an
integer, specifying the first day of the week.–count:How many occurrences will be generated.–byweekday:If given, it must be either an integer (0 == MO), a sequence of
integers, one of the weekday constants (MO, TU, etc), or a
sequence of these constants. When given, these variables will
define the weekdays where the recurrence will be applied.–bysetpos:If given, it must be either an integer, or a sequence of integers,
positive or negative. Each given integer will specify an
occurrence number, corresponding to the nth occurrence of the rule
inside the frequency period. For example, a bysetpos of -1 if
combined with a MONTHLY frequency, and a byweekday of (MO, TU, WE,
TH, FR), will result in the last work day of every month. )–bymonth:If given, it must be either an integer, or a sequence of integers,
meaning the months to apply the recurrence to.–bymonthday:If given, it must be either an integer, or a sequence of integers,
meaning the month days to apply the recurrence to.–byyearday:If given, it must be either an integer, or a sequence of integers,
meaning the year days to apply the recurrence to.–byweekno:If given, it must be either an integer, or a sequence of integers,
meaning the week numbers to apply the recurrence to. Week numbers
have the meaning described in ISO8601, that is, the first week of
the year is that containing at least four days of the new year.–byweekday:If given, it must be either an integer (0 == MO) or a sequence of
integers. When given, these variables will define the weekdays
where the recurrence will be applied.--byeasterIf given, it must be either an integer, or a sequence of integers,
positive or negative. Each integer will define an offset from the
Easter Sunday. Passing the offset 0 to byeaster will yield the
Easter Sunday itself.EXAMPLES:Prints the Mondays and Tuesdays that occur every 5 days in 2010:
dates –from 2010-01-01 –to 2011-01-01 –step 5 –byweekday ‘[“MO”,”TU”]’Prints the last friday of each month of 2010:
dates –freq MONTHLY –from 2010-01-01 –to 2011-01-01 –byweekday ‘FR(-1)’
Package: datesearch
Библиотека написана в рамках хакатона школы 21 совместно с ленинской библиотекойПредназначена для матчинга извлеченных из произвольного текста токенов, относящихся к датам, с неким языком регулярных выражений.Пример:fromdatesearchimportsearchprint(search("ночью, в двадцать минут третьего",'ne'))Вывод программы:[Number(20), Period("m")]По полученным спискам токенов гораздо проще уже находить нужные комбинации чисел, промежутков времени и прочих видов токенов.
Package: date-spacy
Date spaCyDate spaCy is a collection of custom spaCy pipeline component that enables you to easily identify date entities in a text and fetch the parsed date values using spaCy's token extensions. It uses RegEx to find dates and then uses thedateparserlibrary to convert those dates into structured datetime data. One current limitation is that if no year is given, it presumes it is the current year. Thedateparseroutput is stored in a custom entity extension:._.date.This lightweight approach can be added to an existing spaCy pipeline or to a blank model. If using in an existing spaCy pipeline, be sure to add it before the NER model.InstallationTo installdate_spacy, simply run:pipinstalldate-spacyUsageAdding the Component to your spaCy PipelineFirst, you'll need to import thefind_datescomponent and add it to your spaCy pipeline:importspacyfromdate_spacyimportfind_dates# Load your desired spaCy modelnlp=spacy.blank('en')# Add the component to the pipelinenlp.add_pipe('find_dates')Processing Text with the PipelineAfter adding the component, you can process text as usual:doc=nlp("""The event is scheduled for 25th August 2023.We also have a meeting on 10 September and another one on the twelfth of October and afinal one on January fourth.""")Accessing the Parsed DatesYou can iterate over the entities in thedocand access the special date extension:forentindoc.ents:ifent.label_=="DATE":print(f"Text:{ent.text}-> Parsed Date:{ent._.date}")This will output:Text: 25th August 2023 -> Parsed Date: 2023-08-25 00:00:00
Text: 10 September -> Parsed Date: 2023-09-10 00:00:00
Text: twelfth of October -> Parsed Date: 2023-10-12 00:00:00
Text: January fourth -> Parsed Date: 2023-01-04 00:00:00
Package: datestamp
Automatically generates new software version stamp asyear.month.dayformat.Install, update & uninstall (Alpha)Usepipto install, upgrade & uninstall:pip install datestamp

pip install --upgrade datestamp

pip uninstall datestampExample #1# ./pyproject.toml[build-system]requires=["datestamp"]# ./setup.pyfromdatestampimportstampsetup(...,version=stamp('package_name'),# '2020.2.9'...)Example #2# ./datestamp.py...# ./MANIFEST.inincludedatestamp.py# ./setup.pyfromdatestampimportstampsetup(...,version=stamp('package_name'),# '2020.2.9'...)Optionsversion=stamp('package_name')# '2020.2.9'version=stamp('package_name','.post1')# '2020.2.9.post1'version=stamp('package_name','rc1')# '2020.2.9rc1'NoteMake sure to pre-installdatestampbefore runningpython3 setup.py sdist. This is only required for publishers, for users it will be build at setup time (but not installed).New date stamp is only generated when you are ready to publish your project bypython3 setup.py sdistor current version date is used.When new date is generated atsetup(version=stamp(...))it also replaces__version__line with__version__ = '2020.2.9'in__init__.pyfile.Works for One-Off script file as well likedatestamp.pypackage itself.LicenseFree, No limit what so ever.Read more
Package: datestr
DateStr PackageDateStrpackage provide a wrapper object around relativedelta to manage date and datetime stringsInstallation :pipinstalldatestrExamples :Example 1:>>>fromdatestrimportDate>>>Date('2017-06-04').relativedelta(days=2)'2017-06-06'>>>type(Date('2017-06-04').relativedelta(days=2))<class'str'>Example 2:>>>fromdatestrimportDate>>>Date('2017-06-04').relativedelta(month=2,day=3)'2017-02-03'>>>Date('2017-06-04').relativedelta(last_day=True)'2017-06-30'>>>Date('2017-06-04').relativedelta(months=4,last_day=True)'2017-10-31'Example 3:>>>fromdatestrimportDate>>>Date('2017-06-04').relativedelta(hour=12)>>>'2017-06-04'>>>Date('2017-06-04').relativedelta(hour=12,rtype='datetime')>>>'2017-06-04 12:00:00'Example 4:>>>fromdatestrimportDate>>>Date('2017-06-04 04:30:00').relativedelta(days=4,hour=12)>>>'2017-06-08 12:30:00'>>>Date('2017-06-04 04:30:00').relativedelta(days=4,hour=12,rtype='date')>>>'2017-06-08'Example 5:>>>fromdatestrimportDate>>>fromdatetimeimportdatetime,date>>>Date(date(2018,6,3)).relativedelta()>>>'2018-06-03'>>>Date(datetime(2018,6,3,12,15,30)).relativedelta()>>>'2018-06-03 12:15:30'LicenceThis software is made available under the LGPL v3 license.Bug TrackerPlease, feel free to report bugs or suggestions in theBug Tracker!Credits:Mohamed Cherkaoui <http://mohamedcherkaoui.com>News0.1.0Release date: 04-Jun-2017First stable version
Package: date-string
DateStringCreates a manipulable date string in the form of 'YYYYmmdd'.Usagecreates date string from various inputs.>>>ds=DateString('20180624')>>>ds'20180624'>>>ds=DateString('2018/06/24')>>>ds'20180624'>>>ds=DateString('2018-06-24')>>>ds'20180624'>>>ds=DateString('2018年6月24日')>>>ds'20180624'>>>ds=DateString(datetime.datetime(2018,6,24))>>>ds'20180624'>>>today=DateString.today()>>>yesterday=DateString.today(-1)>>>tomorrow=DateString.today(1)supports date calculation.>>>DateString('2018/6/24')+90'20180922'>>>DateString('2018-09-22')-90'20180624'>>>DateString('2018-09-22')-'2018/06/24'90>>>DateString('2018/9/22')-datetime.datetime(2018,6,24)90>>>DateString('20180922')-DateString('2018-6-24')90>>>DateString('2018年9月22日')-pd.Timestamp('2018-06-24')90supports date comparison.>>>DateString('20180922')=='2018/9/22'True>>>DateString('20180922')=='2018/6/24'False>>>DateString('20180922')>='2018/6/24'True>>>DateString('20180922')>='2019/9/22'Falsesupports date-related properties.>>>ds=DateString('2018-06-24')>>>ds.year2018>>>ds.month6>>>ds.day24>>>ds.dayofweek6>>>ds.dayofyear175>>>ds.is_leap_yearFalse>>>ds.is_weekdayFalse>>>ds.is_weekendTruecompatible withpandas.date_range().>>>begin_ds=DateString('2019-01-01')>>>end_ds=DateString('2019/1/3')>>>pd.date_range(begin_ds,end_ds)DatetimeIndex(['2019-01-01','2019-01-02','2019-01-03'],dtype='datetime64[ns]',freq='D')supports date string reformatting.>>>ds=DateString('20180624')>>>ds.reformat()'2018-06-24'>>>ds.reformat(delimiter='/')'2016/06/24'
Package: datesuninfo
# datesuninfoMimics PHPs `date_sun_info()` using python and `ephem`.Sunrise, solar noon, sunset, and twilight start/end times for a given location and datetime.## Example```pythonimport datetimeimport pytzfrom datesuninfo import date_sun_info# Get the current time in utc and assign it the pytz utc time zonecalc_date = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)# Shift the calc_date to Central time zonecalc_date = calc_date.astimezone(pytz.timezone('US/Central'))# Get the date_sun_info for Moore, OK using the current time in the central time zone.sun_info = date_sun_info(latitude='35.3484055', longitude='-97.48163', calc_date=calc_date)print('Sunrise: {0}'.format(sun_info['sunrise']))print('Solar Noon: {0}'.format(sun_info['transit']))print('Sunset: {0}'.format(sun_info['sunset']))print(sun_info.keys())```outputs:```Sunrise: 2016-02-26 07:03:57.190347-06:00Solar Noon: 2016-02-26 12:42:50.328314-06:00Sunset: 2016-02-26 18:22:14.118211-06:00['civil_twilight_end', 'nautical_twilight_end', 'transit', 'previous_sunset', 'sunset', 'next_sunrise', 'astronomical_twilight_begin', 'astronomical_twilight_end', 'civil_twilight_begin', 'sunrise', 'nautical_twilight_begin']```## HistoryThis is a functional work-in-progress.  I use it for personal projects; that is the purpose it serves.The last time this project saw love was early April 2016.
Package: datesy
Datesy: the easy introduction in data handling with pythonThis library wants to help getting started with data handling in python3 and take care of just some stuff you don't wont to worry aboutInstallationThe minimal required python version isPython3.6.
The easiest installation can be done bypip3 install datesy.Getting startedOnce installed, justimport datesythe package and start using as simple as:data = datesy.convert.pandas_data_frame_to_dict(data_sheet)for handling your data as easy as a dictionary
For further guidance and help look at the documentation:DocumentationPlease find the documentation here:documentationRelease NotesPlease find all release notes here:release notes0.9.0refactored and separated datesy into 4 repositories:datesy: converting, inspecting, matching and sorting datafil_io: selecting, reading and writing filesquerious: sql query helperpythomy: pythonic mysql interactionRequests & contributionIf you desire anything changed in the package, need another feature please just create an issue.I am happy for everybody wanting to contribute. Simplest way is to start writing issues, forking the repository and contacting me ;)
Package: datetime2
datetime2Thedatetime2module provides similar
features to those given by the standarddatetimemodule,
adding the capability of constructing and representing date and time in many
formats. Additionally, it removes a few limits that the original package has.datetime2is a one-man, free-time work. Project is hosted at GitHub, please
follow the source code link on the right to see the latest version of this
page (e.g. for an updated release map).Current and future releasesCurrent:0.9.4: Implementation of WesternTimeDeltaPlanned:1.0: Implementation of DateTime, first production release1.1: Implementation of Julian and Hebrew calendarsProject objectivesDecoupling between operations on date and time objects and their
representation.Access to different calendars, for input parsing and output formatting.Access to different time representations, also for input and output.Infinite precision in converting between different time representations.Ability to dynamically register new formatting classes.Internationalization.Implementation of the part of the Unicode Locale Database concerned with
dates and times.Interface with other Python modules or inclusion of their
functionalities in submodules.These objectives are very long term ones, which I am setting because I think it is
important to establish a direction for the project.LicenseDatetime2 is distributed under the terms of the new BSD license. You are free
to use it for commercial or non-commercial projects with little or no
restriction, all I ask is that:Redistributions of the code, in whole or part, retain the original
copyright notice and license text.You do not claim my endorsement of any derived product.For a complete text of the license see the LICENSE.txt file in the source distribution.
Package: datetime-diff
Thedatetime_diffpackage provides a useful function for comparing
two different datetime objects and returns the time elapsed since.for example, a datetime object when turned into a string (being
2015-12-03 03:34:57.281000) when compared with a new datetime object
(equivalent to the current time) one can determine how many years,
months, days, hours, minutes, and seconds ago the prior datetime object
was.This returns the data as a string readable by humans denoting how much
time has passed since the specified prior datetime object.