Giter Site home page Giter Site logo

tom65536 / annual Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 43 KB

Python package for computing annual recurring events. Recurrence rules are described by a human-friendly mini-language.

License: MIT License

Python 97.90% Gherkin 2.10%
calendar date holidays library observances parser python

annual's Introduction

annual

PyPI - Version GitHub Actions Workflow Status OpenSSF Best Practices pre-commit Imports: isort OSS Lifecycle Codacy Badge

Synopsis

The Python package annual provides date calculations with human-readable expressions.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed Python 3.11 or later. annual is compatible with Python 3.11+.
  • You have a basic understanding of Python programming.
  • (Optional) For development: You have git installed for version control.

Installation

annual can be installed using pip. To install annual, follow these steps:

  1. Open your terminal (Command Prompt on Windows).
  2. Run the following command:
pip install annual

Usage

The simplest way of using this package is invoking the rule parser directly. The following example shows how to compute the second monday in October for the year 2024.

>>> from annual.ruleparser import rule_parser
>>> rule_parser(2024).parse('2nd monday of october')
datetime.date(2024, 10, 14)

For a full overview of the syntax supported by the rule parser consult the Syntax Guide.

Additional Documentation

For more detailed information about DateCalc, please refer to our comprehensive documentation:

  • User Guide: For in-depth explanations of annual's features and how to use them effectively, visit our User Guide.

  • API Reference: For detailed information about annual's classes, methods, and functions, check out our API Reference.

  • Tutorials: To get started quickly with practical examples, see our Tutorials.

  • FAQ: For answers to commonly asked questions, visit our FAQ page.

  • Contributing: If you're interested in contributing to annual, please read our Contribution Guidelines.

Our documentation is hosted on Read the Docs and is kept up-to-date with each release. You can find the full documentation at:

https://annual.readthedocs.io

If you can't find the information you're looking for, please open an issue on our GitHub repository. We're always looking to improve our documentation and appreciate your feedback!

License

This package is released under the terms of the MIT License.

Related Libraries

  • dateutil: extensions to the standard Python datetime module
  • Delorean: library for manipulating datetimes with ease and clarity
  • dateparser: date parsing library designed to parse dates from HTML pages
  • workalendar: worldwide holidays and working days helper and toolkit
  • convertdate: converts between Gregorian dates and other calendar systems

annual's People

Contributors

tom65536 avatar

Stargazers

 avatar

Watchers

 avatar

annual's Issues

Add `CLIP` operator

Set a date to NEVER if it is not in the year of question.

CLIP (5th Sunday after Dec 1)

would be equivalent to

5th Sunday after December 1 IF (5th Sunday after December 1 NOT AFTER December 31) AND (5th Sunday after December 1 NOT BEFORE January 1) ELSE NEVER

Add non-Gregorian calender conversions

  • add convertdate as an optional dependency
  • provide functions for computing at least the new year's days or the first day of each month in the respective calendar system
  • take care of varying calendar year lengths and include functions for the second appearance of a month in a Gregorian year

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.