{"id":24973289,"url":"https://github.com/bluedynamics/bda.calendar.base","last_synced_at":"2025-03-29T06:12:57.760Z","repository":{"id":57414353,"uuid":"183401860","full_name":"bluedynamics/bda.calendar.base","owner":"bluedynamics","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-05T11:30:14.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T01:37:01.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluedynamics.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-25T09:29:27.000Z","updated_at":"2022-12-14T23:00:00.000Z","dependencies_parsed_at":"2023-01-24T06:15:46.134Z","dependency_job_id":null,"html_url":"https://github.com/bluedynamics/bda.calendar.base","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fbda.calendar.base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fbda.calendar.base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fbda.calendar.base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fbda.calendar.base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluedynamics","download_url":"https://codeload.github.com/bluedynamics/bda.calendar.base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246145089,"owners_count":20730495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-03T18:27:07.542Z","updated_at":"2025-03-29T06:12:57.737Z","avatar_url":"https://github.com/bluedynamics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==========================================================\nConvinience for Datetime handling in combination with Zope\n==========================================================\n\n``bda.calendar.base`` contains functions adressing programmers all-day tasks\nnot (or only partly) covered by pythons datetime or zopes DateTime.\n\nMajor part of these function is timezone aware. Also ist easy to deal with \ntimezones. An TimezoneFactory can be provided in the specific application\nto i.e. be aware of the users timezone (i.e. in case of webapps).\n\n\ncalculators\n-----------\n\nCWof(date)\n    the calendar week number of a date.\n    \nfirstDayOfCW(year, cw, tzinfo=None)\n    first day of a numbered calendar week\n    \ndaysOfWeek(year, cw, tzinfo=None)\n    yields 7 datetimes of the given calendar week\n    \nnumberOfDaysInYear(dt)\n    calculate number of day of the year of the given datetime year\n           \nnumberOfDaysInMonth(dt)           \n    calculates number of days of the given datetimes month \n\ndaysOfMonth    \n    yields all days as datetimes of the given month\n    \nhoursOfDay(year, month, day, tzinfo=None)\n    yields all hours of a day as datetimes    \n    \nisSameDay(first, second)    \n    detects if two dates are the same day. bool.\n    \n\nconverter\n---------\n\ndt2DT(dt)\n    Convert Python's datetime to Zope's DateTime. Acts timezone-aware.\n    \nDT2dt(DT)\n    Convert Zope's DateTime to Pythons's datetime. Acts timezone-neutral, \n    outcome is on UTC.\n    \ndt2UTCString(dt)\n    build a '-' separated string from the datetime timetuple as UTC.\n    \ndtFromUTCString(utcstr)\n    build datetime from timetuple UTC string.\n    \ndt2epochday(dt)\n   Number of days since epoch.  \n   timezone gets a problem here, we need to normalize all to GMT to make it \n   recognize the same day even if it a different timezone:\n   i.e. 2008-05-01T00:00:00+02:00 (CEST) \n\n\ninspector\n---------\n\nAll functions are using the timezoneAdjuster (see below). therefore a context is \npassed\n \ndtYear(dt, context=None):\n    year of datetime.\n    \ndtMonth(dt, context=None)\n    month of datetime.\n\ndtDay(dt, context=None)\n    day of datetime.\n\ndtHour(dt, context=None)\n    hour of datetime.\n\ndtMinute(dt, context=None)\n    minute of datetime.\n    \ndtWeekday(dt, context=None)\n    Weekday of datetime.\n    \npyDt\n    Detect wether dt is instance of datetime object.\n\n  \nrecurring\n---------\n\nSimple recurring features. for more sophisticated recurring feature refer to\ndateutils.rrule\n\nrecueDays(start, until, recuemode, offset)\n    Generates list of recue days.    \n\n\ntimezone\n--------\n\nDealing with timezones is always pain. With these common features it get less \npain. Using ZCA where registering a common ``TimezoneFactory`` using the computers \nsystem timezone. It is used by the ``timezoneAdjuster``. If you register a more \nspecific TimezoneFactory following its simple interface - its just a callable -\n, you can implement user configurated multi-timezone aware applications.\nThis is all based on pytz, because pytz just works.\n\nServerTimezoneFactory(context)\n    The timezone of the server (current computer). You never need to use this \n    directly.\n\ntimezoneAdjuster(context, dt)\n    New datetime with given timezone. Given datetime cant be naive!\n    \ntzawarenow()\n    timezone aware ``now`` datetime using utc timezone. if you need \n    the current timezone adjust it.\n\n\nContributors\n============\n\n- Jens Klein \u003cjens@bluedynamics.com\u003e\n- Robert Niederreiter \u003crnix@squarewave.at\u003e\n\n\nLicense\n=======\n\nCopyright (c) 2008-2022, BlueDynamics Alliance, Austria\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n* Neither the name of the BlueDynamics Alliance nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance ``AS IS`` AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nChanges\n=======\n\n1.2.5 (2022-12-05)\n------------------\n\n- Try again to release wheel with zest.releaser.\n  [rnix]\n\n\n1.2.4 (2022-12-05)\n------------------\n\n- Release wheel.\n  [rnix]\n\n\n1.2.3\n-----\n\n- Remove superfluous import.\n  [rnix, 2020-08-12]\n\n\n1.2.2\n-----\n\n- conditional ZCML for pyramid and zope.\n  [rnix, 2011-11-16]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedynamics%2Fbda.calendar.base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluedynamics%2Fbda.calendar.base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedynamics%2Fbda.calendar.base/lists"}