These libraries are maintained by the developers at Calenedarific as well as freelance developers and are the easiest way to integrate Postmark with your application.

We’re building a wishlist of Calendarific plugins, libraries, and integrations. If you have something you’d like to see, or would like to contribute, let us know!

If you have any specific questions around the examples, your best bet is to either email us directly or just open a pull request or an issue on GitHub or StackOverflow.

1. Javascript/NodeJS

The Calendarific Node.js library is available as an npm package. You can install the package by using the npm command listed here.

npm install --save node-calendarific

or just

npm install node-calendarific

Below is an example of how to use the module

 // Load the package
const Calendarific = require('node-calendarific');
 
// Initlize with an API key
const clapi = new Calendarific('_YOUR_API_KEY_');
 
const parameters = {
  country: 'US',
  year:    2019,
};
 
clapi.holidays(parameters, function (data) {
  console.log(data)
  // Insert awesome code here...
});

2. PHP

The Calendarific PHP library is available as a Composer package on Packagist.org.

Installation

composer require "calendarific/calendarific"

Usage

$ciapi = new Calendarific\v1('_YOUR_API_KEY_');

$parameters = array(
  'country' => 'US',
  'year' => 2019
);

$response = $ciapi->holidays($parameters);

3. Python

The Calendarific Python library is available as a PIP package.

Installation

pip install python-calendarific

Usage

import calendarific

calapi = calendarific.v2('_REPLACE_WITH_API_KEY_')

parameters = {
	# Required
	'country': 'US',
	'year':    2019,
}

holidays = calapi.holidays(parameters)

4. Ruby

The Calendarific Ruby library is available as a Ruby gem.

Installation

gem install ruby-calendarific

Usage

require 'ruby-calendarific'

capi = Calendarific::V2.new('_YOUR_API_KEY_HERE_')

parameters = {
  'country' => 'US',
  'year'    => 2019
}

response = capi.holidays(parameters)

5. Golang

The Calendarific Golang library is available as a Golang package. To install the package, use this command below:

dep ensure -add github.com/calendarific/go-calendarific

To use this library, create a file called main.go & insert a script like below

package main

import (
  "fmt"
  "github.com/calendarific/go-calendarific"
  "os"
)

func main() {

   // Loading the paramater struct
   cp := calendarific.CalParameters{
     ApiKey:  "",
     Country: "US",
     Year:    2019,
   }

   // It returns a response struct
   holidays, err := cp.CalData()
   if err != nil {
     fmt.Println(err)
     os.Exit(1)
    }

   fmt.Println(holidays)
}