Saravanan666/pypi-org huggingface dataset:
Package: datefinder-lexpredict
A python module for locating dates inside text. Use this package to extract all sorts
of date like strings from a document and turn them into datetime objects.This module finds the likely datetime strings and then uses thedateparserpackage to convert
to the datetime object.InstallationpipinstalldatefinderHow to UseIn[1]:string_with_dates="""
   ...: ...
   ...: entries are due by January 4th, 2017 at 8:00pm
   ...: ...
   ...: created 01/15/2005 by ACME Inc. and associates.
   ...: ...
   ...: """In[2]:importdatefinderIn[3]:matches=datefinder.find_dates(string_with_dates)In[4]:formatchinmatches:...:printmatch...:2017-01-0420:00:002005-01-1500:00:00SupportYou can talk to us onGitteror just submit an issue ongithub.
Package: datefns
Seems like I constantly need some kind of date functions that aren’t found (or
aren’t found easily enough anyway) in the standard library or in 3rd party
packages that I use regularly. This library attempts to remedy that so I know
where to add the functions when I build them and know where to look for them
when I need them.Getting StartedThere are no dependancies to install. You just need to:pip install datefnsor:git clone git@github.com:ktr/datefns.git
cd datefns
python setup.py installOnce installed, you can iterate through the entire file without using much
memory by doing the following:import datefns, datetime
d1 = datetime.date(2018, 7, 10)
d2 = datetime.date(2018, 12, 31)
we = datefns.week_ending(d1, week_ends_on='Sun')
ds = datefns.date_table(d1, d2)
me = datefns.eomonth(d1, 5) # datetime.date(2018, 12, 31)

ts = datefns.time_table()

datefns.date_table_to_csv(ds, '/path/to/date-file.csv', overwrite=True)
datefns.time_table_to_csv(ts, '/path/to/time-file.csv', overwrite=True)

import sqlite3
conn = sqlite3.connect(':memory:')
datefns.load_date_table(conn, datefns.date_table(start_date=d1, end_date=d2))
datefns.load_time_table(conn, ts)

ds = datefns.date_range(d1, d2, datefns.by_month)Running TestsTo run tests:python -m tests.test_datefnsLicenseThe project is licensed under the MIT License - see theLICENSE.mdfile for
details
Package: date-formatter
date_time_formata Python package that formats a ten character string to a dateInstallationpipinstalldate_formatterUsageMinimal examplefromdate_formatterimport*date_time_string_US="12-18-2014"date_time_string_AUS="18-12-2014"myDates_US=DateFormatter.dateFormat(date_time_string_US,False,True,"US")myDates_AUS=DateFormatter.dateFormat(date_time_string_AUS,True,False)print(myDates_US)print(myDates_AUS)returns:18-Dec-1418 December 2014Parametersdate_time_string: strThe date string you want to formatUSE_FULL_MONTH_NAME : boolWhether to display the full name of the month. If this is set toTrue, shows "January"; if this is set toFalse, shows "Jan".USE_HYPHEN_AS_SPACER : boolWhether to show interval between characters as single space, or hyphen. If this is set toTrue, shows "18-Jan-14"; if this set toFalse, shows "18 Jan 14"REGION_FORMAT : str, optionalWhich region's date format to use. If set to "US" assumes string is "MM-DD-YYYY"; if this is set to something or is missing, assumes string is "DD-MM-YYYY"
Package: dategen
Table of ContentsInstallUsagefolder structuresDategen is a python package that yield a generator of dates.Install$ python3 -m pip install dategenUsageimport dategen
g = dategen.dategen.backward
help(g)

x=g()

# only the last command will be displayed.

# type( x )  # generator

# list( x )  # 5000 datetime, a very long list.

# next( x )  # one datetime form the generator

# len( list(x) )  # 5000folder structuresdate

tree

Fri Jul 23 17:57:13 CST 2021
 .
 ├── LICENSE
 ├── Pipfile
 ├── Pipfile.lock
 ├── README.md
 ├── Untitled.ipynb
 ├── Untitled1.ipynb
 ├── dategen
 │   ├── __init__.py
 │   └── dategen.py
 ├── log.org
 ├── pyproject.toml
 └── tests
     └── dategen.ipynb
Package: dateglob
dateglobconverts a set of dates into a list of globs. For example:>>> import dateglob; from datetime import date, timedelta
>>> # build list of dates from 2009-12-31 thru 2011-02-01
>>> dates = [date(2009, 12, 31) + timedelta(i) for i in xrange(1+365+31+1)]
>>> dateglob.strftime(dates, '%Y-%m-%d')
['2009-12-31', '2010-*-*', '2011-01-*', '2011-02-01']The original use case for this library was to generate compact command lines
for command that take daily log files as input, for example:>>> args += dateglob.strftime(dates, '/logs/foo/%Y/%m/%d/*.gz')dateglob.strftime()handles all of the standard arguments todatetime.strftime(). Currently, it only does something special with
full months, years, and full ten-day periods (we don’t glob weeks).source: <http://github.com/Yelp/dateglob>documentation: <http://packages.python.org/dateglob/>datetime.strftime(): <http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior>
Package: date-guesser
A library to extract a publication date from a web page, along with a measure of the accuracy.
This was produced as a part of themediacloud project, in order to accurately extract dates from content.InstallationThe library is availableon PyPI, and may be installed withpipinstalldate_guesserQuickstartThe date guesser uses both the url and the html to work, and uses some heuristics to decide which of many possible dates might be the best one.fromdate_guesserimportguess_date,Accuracy# Uses url slugs when availableguess=guess_date(url='https://www.nytimes.com/2017/10/13/some_news.html',html='<could be anything></could>')#  Returns a Guess object with three propertiesguess.date# datetime.datetime(2017, 10, 13, 0, 0, tzinfo=<UTC>)guess.accuracy# Accuracy.DATEguess.method# 'Found /2017/10/13/ in url'In case there are two trustworthy sources of dates,date_guesserprefers the more accurate onehtml='''
    <html><head>
    <meta property="article:published" itemprop="datePublished" content="2017-10-13T04:56:54-04:00" />
    </head></html>'''guess=guess_date(url='https://www.nytimes.com/2017/10/some_news.html',html=html)guess.date# datetime.datetime(2017, 10, 13, 4, 56, 54, tzinfo=tzoffset(None, -14400))guess.accuracyisAccuracy.DATETIME# TrueButdate_guesseris not led astray by more accurate, less trustworthy sources of informationhtml='''
    <html><head>
    <meta property="og:image" content="foo.com/2016/7/4/whatever.jpg"/>
    </head></html>'''guess=guess_date(url='https://www.nytimes.com/2017/10/some_news.html',html=html)guess.date# datetime.datetime(2017, 10, 15, 0, 0, tzinfo=<UTC>)guess.accuracyisAccuracy.PARTIAL# TrueFuture WorkLanguagesThe code does quite poorly on foreign news sources. This page is Ukranian and has a date on it that
a non-Ukranian could identify, but it is not extracted:importrequestsguess=guess_date(url='https://www.dw.com/uk/коментар-націоналізм-родом-зі-східної-європи/a-42081385',html=requests.get(url).text)guess.date# Noneguess.accuracyisAccuracy.NONE# Trueguess.method=='Did not find anything'# TrueReckless ModeWe keep track of the accuracy of extracted dates, but we do not keep track of the confidence of extracted
dates being accurate. This may be a way to do more tuning given a particular use case. For example, one
strategy we donotemploy is a regex for all the date patterns we recognize, since that was far too
error-prone. Such an approach might be preferable to returningNonein certain cases.PerformanceWe benchmarked the accuracy against the wonderfulnewspaperlibrary, using one hundred urls gathered from each of four very different topics in themediacloudsystem. This includes blogs and news articles, as well as many urls that have no date (in which case a guess is marked correct only if it returnsNone).Vaccinesdate_guessernewspaper1 days57487 days615115 days6653Aadhar Card in Indiadate_guessernewspaper1 days73447 days744415 days7444Donald Trump in 2017date_guessernewspaper1 days79607 days836115 days8561Recipes for desserts and chocolatedate_guessernewspaper1 days83657 days856915 days8769
Package: dateint
dateintHelper library for manipulation of formatted date/datetime valuesIt's very common to store date/datetimes asintegersorstringsusing formats
such asYYYYmmddorYYYYmm. In python, to perform date/datetime arithmetic on those
values, one needs to:convert the original value todateordatetimeperform the date/datetime operationconvert the result back to the original formatWithdateint, weabstractall convertion operations so you can focus on thearithmetic step:single value:importdateintasdidi.add(20220510,days=15)# 20220525pandas:importdateintasdiimportpandasaspddates=pd.Series([202201,202202,202203])di.add(dates,months=2)'''0    2022031    2022042    202205dtype: int64'''DocumentationSee thedocumentation pagefor the complete and
detailed documentation.Installationpipinstalldateint
Package: datek-app-utils
Utilities for building applications.Contains:Config loading from environmentBootstrap for loggingBase class for creating async workersAsync timeout decorator, which is very useful for writing async testsExamples:Env configimportosfromdatek_app_utils.env_config.baseimportBaseConfigos.environ["COLOR"]="RED"os.environ["TEMPERATURE"]="50"classConfig(BaseConfig):COLOR:strTEMPERATURE:intassertConfig.COLOR=="RED"assertConfig.TEMPERATURE==50TheConfigclass casts the values automatically.
Moreover, you can test whether all the mandatory variables have been set or not.importosfromdatek_app_utils.env_config.baseimportBaseConfigfromdatek_app_utils.env_config.utilsimportvalidate_configfromdatek_app_utils.env_config.errorsimportValidationErroros.environ["COLOR"]="RED"classConfig(BaseConfig):COLOR:strTEMPERATURE:intAMOUNT:int=Nonetry:validate_config(Config)exceptValidationErroraserror:forattribute_errorinerror.errors:print(attribute_error)Output:TEMPERATURE: Not set. Required type: <class 'int'>Async timeout decoratorfromasyncioimportsleep,runfromdatek_app_utils.async_utilsimportasync_timeout@async_timeout(0.1)asyncdefsleep_one_sec():awaitsleep(1)run(sleep_one_sec())Output:TimeoutError
Package: datelibrary-javis
Package InfoDate Extraction library built on top of Python native date libraries to support business vocabularies.Installationpip install datelibrary-javisUsageimportdatelibraryfromdatelibrary.datesimportDateDatatext="my sales from june to aug'date_obj=DateData(text)print(date_obj.comile_dates())>>>['2018-06-01','2018-08-31']#list of stringsScopecurrent date = 5th November 2019current day = TuesdayTypeParsed Dateytd (year to date)['2019-01-01', '2019-11-05']mtd (month to date)['2019-11-01', '2019-11-05']qtd (quarter to date)['2019-10-01', '2019-11-05']l3m (last 3 months)['2019-07-01', '2019-10-30']june to august['2019-06-01', '2019-08-31']june 2018 to august 2018['2018-06-01', '2018-08-31']june 2018['2018-06-01']1/6/2019 to 2/6/2019['2019-06-01', '2019-06-02']last month['2019-10-01', '2019-10-31']last week['2019-10-27', '2019-10-03']last year['2019-01-01', '2019-01-31']
Package: datelist-sdk-python
SDK forhttps://datelist.ioin PythonUsagefromdatelist.clientimportClientclient=Client('WGQqyEjfXLtK74K5YuxrHn7v')calendars=client.list_calendars()products=client.list_products({'calendar_id':441,'name':"Table"})slots=client.list_booked_slots({'email':"test@test.com",'calendar_id':441,'from':"2021-08-04T04:51:59.945Z",'to':"2021-08-30T04:51:59.945Z",})print(calendars)print(products)print(slots)print(client.update_booked_slot(slots[0]['id'],{'email':'test2@test.com'}))print(client.update_booked_slot(slots[0]['id'],{'email':'test@test.com'}))
Package: date-location-extractor
Date Location Extractordate_location_extractor is a date_location extractor that retrieves dates and locations found in a list of strings. The input can either be a json file with a list or you can use a list directlyInstall & SetupGrab the package usingpip(this will take a few minutes)pipinstalldate-location-extractorDater Location Extractor uses the following dependencies:datetimedateutilgeotextdatefinderastosBasic UsageImport the module, give some text or a URL, and presto.fromdate_location_extractorimportDateLocationExtractordate_location_extractor=DateLocationExtractor()print(date_location_extractor.get_date_location_from_json_file("list_to_parse.json",use_simple_parser=True))use_simple_parserdoes not use datefinder and uses the simple dateutil parserThe result is a list of dictionaries, e.g:[{"address":"San Juan Costa Rica","date_iso":"2009-11-27","ranking":1.0,"normalized_address":{"City":"San Juan","Country":"CR"}}]Without loading a file:fromdate_location_extractorimportDateLocationExtractordate_location_extractor=DateLocationExtractor()print(date_location_extractor.get_date_location_from_list(["13 May 2009","12/15/2010"]))print(date_location_extractor.get_date_location_from_list_with_parser(["13 May 2009","12/15/2010"]))The ranking algorithm has the following weights set:RANKING_WEIGHT_HAS_DATE = 0.3RANKING_WEIGHT_HAS_DAY = 0.2RANKING_WEIGHT_HAS_COUNTRY = 0.3RANKING_WEIGHT_HAS_CITY = 0.2
Package: datels
datelsdatelsis a simple CLI that displays a list of dates line by line.InstallationTo install datels with pip, run:pip install datelsBasic Usage$datels1994-03-071994-03-101994/03/071994/03/081994/03/091994/03/10Date format option$datels1994-03-071994-03-10--sep="-"1994-03-071994-03-081994-03-091994-03-10

$datels1994-03-071994-03-10--format"%c"MonMar700:00:001994TueMar800:00:001994WedMar900:00:001994ThuMar1000:00:001994Seestrftime documentationfor more information.Inclusive option$datels1994-03-071994-03-10--inclusiveboth1994/03/071994/03/081994/03/091994/03/10

$datels1994-03-071994-03-10--inclusiveleft1994/03/071994/03/081994/03/09

$datels1994-03-071994-03-10--inclusiveright1994/03/081994/03/091994/03/10Using in your python code not CLI$python
>>>fromdatelsimportlist_dates
>>>dates=list_dates("1994-03-07","1994-03-10",sep="-",inclusive="both")>>>dates['1994-03-07','1994-03-08','1994-03-09','1994-03-10']>>># list_dates retuens list of string>>>type(dates)<class'list'>
>>>type(dates[0])<class'str'>
Package: date_machine
Date Machine is a Date parsing system.It is based onReparse, and includes 14 date patterns, and a Javascript version.date_machine_parse('All day Thursday-Sunday, Sept. 20-23., Friday September 21')#       [Date(month=9, day=20),#        Date(month=9, day=21),#        Date(month=9, day=22),#        Date(month=9, day=23)],FastScannable: Use over full text and find datesHonest: no approximations given about the dates (i.e. if the year is missing it’s not included)Portable: Parser description compiles to Regex/Json. You just have to write the output builder functions.Highly-Customizable: Adding more formats at different levels is easy (if you know regular expressions).Installationpip install date_machineorpython setup.py installin the base directory.Usageimportdate_machinedate_machine.parse('Jan 1st')# [Date(month=1, day=11)]SupportNeed some help? Send me an email attheandychase@gmail.comand I’ll do my best to help you.ContributionThe code is located onGithub.
Send me suggestions, issues, and pull requests and I’ll gladly review them!LicenceThe MIT License (MIT)Copyright (c) 2013 Andrew ChasePermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: datemagic
Date Magicdatemagicmodule provides convenience function for operating with dates and
time types.Install the module the usual way usingpipto start using it.ExampleSplitting year in 30-day chunks>>>importdatetime>>>importdatemagic>>>datemagic.split_interval(datetime.date(2016,1,1),...datetime.date(2016,12,31))[(datetime.date(2016,1,1),datetime.date(2016,1,30)),(datetime.date(2016,1,31),datetime.date(2016,2,29)),(datetime.date(2016,3,1),datetime.date(2016,3,30)),(datetime.date(2016,3,31),datetime.date(2016,4,29)),(datetime.date(2016,4,30),datetime.date(2016,5,29)),(datetime.date(2016,5,30),datetime.date(2016,6,28)),(datetime.date(2016,6,29),datetime.date(2016,7,28)),(datetime.date(2016,7,29),datetime.date(2016,8,27)),(datetime.date(2016,8,28),datetime.date(2016,9,26)),(datetime.date(2016,9,27),datetime.date(2016,10,26)),(datetime.date(2016,10,27),datetime.date(2016,11,25)),(datetime.date(2016,11,26),datetime.date(2016,12,25)),(datetime.date(2016,12,26),datetime.date(2016,12,31))]Default chunk size is 30 days.For detailed description see the Python docstrings in the code.
Package: datemangler
This script modifies the last four bits of an NTFS timestamp to hide
information.Data entered is encrypted with AES.InstallationGet the latest version withpip install datemangler.Notes about DependenciesThis program requires thexattrpackage to function which will
only installif the development files forlibffiare installed. Usesudoapt-getinstalllibffi-devon Debian/Ubuntu before installingxattror this package.The datemangler package is a universal package that is compatible with
bothpython 2 and 3.Usage example# create test file system in a file
$ truncate --size 20M volume
$ mkfs.ntfs -F volume
$ mount volume test/

# create test files
$ for i in {0..100}; do touch $i; done

# write to a single file
$ datemangler -i "helo" write 0

# read again
$ datemangler read 0

# write more text to a directory of files
$ datemangler -i "hello world, how are you?" write .

# read again
$ datemangler read .NotesThis script has been tested successfully on the following platforms:Ubuntu 12.10 with kernel 3.5.0-18-generic x64 with ntfs-3g
2012.1.15AR.5 external FUSE 29Debian testing with kernel 4.2.0-1-amd64 with ntfs-3g 2015.3.14AR.1
integrated FUSE 28Note that the script must be run on files in an NTFS volume!
Package: datemore
This is a small python package that wraps useful extension helper methods
around the standard librarydatetimepackage.$pipinstalldatemoreThis package extendsdateanddatetimeobjects with
useful methods for:LocalizingdateanddatetimeobjectsAdding and subtractingGenerating date rangesMocking (you cannot mock builtins, so why not use this library in the first place :wink:)Example:importdatemore.datesunday=datemore.date.Date(2020,2,2)tuesday=sunday.add_days(2)passed_days=sunday.range_to(tuesday)tuesday.native()# Get the native datetime.date objectDo you want to add new extensions? Go ahead!
Contributions are welcome, have a look atCONTRIBUTING.DevelopmentFor detailed instructions seeCONTRIBUTING.TestsYou can run tests with$invoketest$invoketest--min-coverage=90# Fail when code coverage is below 90%$invoketype-check# Run mypy type checksLinting and formattingLint and format the code with$invokeformat$invokelintAll of this happens when you runinvokepre-commit.NoteThis project is still in the alpha stage and should not be considered production ready.
Package: datenraffinerie
# DatenraffinerieThe Datenraffinerie is a tool to acquire data from the various frontend systems of HGCAL and provide a framework
for online and offline analyses to plug in to. The Datenraffinerie automates the entire DAQ process for test
systems from a user perspective. It handles configuration of the DAQ system and target and conversion of the
data from the target system into a pandas DataFrame, simplifying the life of the analysis developer.
Package: date-offset
Date-offset.. image::https://badge.fury.io/py/date-offset.svg:target:http://badge.fury.io/py/date-offset.. image::https://codecov.io/gh/django-advance-utils/date-offset/branch/main/graph/badge.svg?token=QPGW5TIGX3:target:https://codecov.io/gh/django-advance-utils/date-offsetThis allow you to offset date / time with a string.Example.. code-block::d = DateOffset()
tomorrow = d.get_offset("1d")
yesterday = d.get_offset("-1d")Keywordstart of week (Monday)* end of week% first day of the monthd offset by days (1d)w offset by weeks (1w)m offset by months (1m)y offset by years (1y)~ not weekends offset by seconds (3600s)i offset by minutes (60m)h offset by hours (1h)t time (10t = 10hr. 10:15t = 10hr 15mins. 10:15:45t = 10hr 15mins 45secs)UsageIf you want to include time in your output theinclude_timemust be set... code-block::d = DateOffset()
one_hours_time = d.get_offset("1h", include_time=True)Nested string can be used.. code-block::d = DateOffset()
second_day_of_current_month = d.get_offset("%1d")
Package: date-operations
date-operations🗓 Easy to use functions for common date operationsUsageDays between 2 datesGet the amount of days between 2 dates:fromdate_operationsimportdays_betweendays_between("2023-01-01","2023-01-02")# 1days_between("01 01 2023","01/01/2024")# 365# You can omit the day:days_between("jan-2023","01/02/2023")# 31Months between 2 datesGet the amount of full months between 2 dates:fromdate_operationsimportmonths_betweenmonths_between("01 05 2023","31 05 2023")# 0months_between("01-05-2023","01-06-2023")# 1months_between("10/05/2022","10/05/2023")# 12months_between("10-may-2022","09-may-2023")# 11# You can omit the day:months_between("05-2023","06-2023")# 1Months started between 2 datesGet the amount of months started between 2 dates:fromdate_operationsimportmonths_started_betweenmonths_started_between("31 05 2023","01 06 2023")# 1months_started_between("01-05-2023","01-06-2023")# 1months_started_between("31/12/2022","01/01/2023")# 1Years between 2 datesGet the amount of full years between 2 dates:fromdate_operationsimportyears_betweenyears_between("15 01 2022","15 01 2023")# 1years_between("15-01-2022","14-01-2023")# 0years_between("31/12/2022","01/01/2023")# 0# You can omit the day:years_between("05/2023","06/2023")# 0years_between("05/2023","01/2024")# 0years_between("05/2023","05/2024")# 1Years started between 2 datesGet the amount of years started between 2 dates:fromdate_operationsimportyears_started_betweenyears_started_between("31 12 2022","01 01 2023")# 1years_started_between("01-01-2023","31-12-2023")# 0years_started_between("31/12/2022","01/01/2024")# 2Date formatsDate formats are inferred giventhis priority list. If the format of your date is not within the list you can add it or explicitly indicate the format of a given date. The formats added to the list are given priority.fromdate_operationsimportmonths_betweenmonths_between("01-01","01-02",format_1="%d-%m",format_2="%d-%m")# 1months_between("01-01","01-02",extra_formats=["%d-%m"])# 1The same parameters are used for all the functions.
Package: date-parser-sari
sari/bso-date-parserA parser to convert textual dates into EDTFInstallationInstall using pip$pipinstalldate-parser-sariUsage>>>fromsariDateParser.dateParserimportparse>>>parse("4 December 1920")'4.12.1920'>>>parse("um 1920")'1920?'>>>parse("zwischen 1870 und 1890")'1870/1890'>>>parse("nicht vor 1450?")'1450/'
Package: dateparse-tobiasli
dateparseDateparser for creating datetime objects from arbitrarily formated date strings. Primary support for Norwegian date formats.New version is a complete refactor:Much faster parsing.Reduced pattern complexity.Improved matching rutine.Some reduced functionality with less used time formats (centuries, relative dates, text based).Installpip install dateparse-tobiasliUsageimportdatetimefromdateparseimportDateParserparser=DateParser()# Dates with alpha components:dt=parser.parse('5. januar 2015')print(dt==[datetime.datetime(2015,1,5,0,0)])# Multiple dates from same string:dt=parser.parse('1/12/2014 kl 12, 11.12.2015 kl 14')print(dt==[datetime.datetime(2014,12,1,12,00),datetime.datetime(2015,12,11,14,00)])