Giter Site home page Giter Site logo

govuk-bank-holidays-rs's Introduction

GOV.UK Bank Holidays

This rust library loads the official list of bank holidays in the United Kingdom as supplied by GOV.UK, which tends to provide this list for only a year or two into the future.

A cached backup list of known bank holidays is stored in this package, though it is not updated often. GOV.UK no longer provide bank holidays for some of the older years still part of this backup list.

Bank holidays differ around the UK. The GOV.UK source currently lists these for 3 “divisions”:

  • England and Wales
  • Scotland
  • Northern Ireland

Methods on BankHolidayCalendar that take a division parameter will consider bank holidays only for the provided division (Some(Division)) or only those that are common to all divisions for None.

Using the library

github crates.io docs.rs

Add to your project with:

cargo add govuk-bank-holidays

See docs.rs for API information, usage samples and feature flags.

Developing library

Requirements

  • rust 1.75+ (using rustup is recommended)
  • just – for scripted shortcuts; like make

Releasing a new version

TODO

  • Better tests, coverage
  • Optionally merge in older known bank holidays into newly-downloaded GOV.UK data? Cached data starts in 2012, but currently GOV.UK provides nothing before 2018.
  • Performance improvements (particularly around memory and iterators)
  • Can DataSource be made private, exposing methods on LoadDataSource trait or elsewhere?
  • Allow for unknown “divisions”? Make enum non-exhaustive?

References

See also:

History

0.2.0

Allow for custom sources of bank holidays using LoadDataSource trait.

0.1.1

Very minor changes – tidier code and improved documentation.

0.1.0

Initial release with API likely to be unstable.

govuk-bank-holidays-rs's People

Contributors

dependabot[bot] avatar ushkarev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

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.