• Stars
    star
    110
  • Rank 305,610 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go package for dealing with EU VAT. Does VAT number validation & rates retrieval.

Package vat

Go Report Card GoDoc MIT licensed

Package for validating VAT numbers & retrieving VAT rates (from ibericode/vat-rates) in Go.

Installation

Use go get.

go get github.com/dannyvankooten/vat

Then import the package into your own code.

import "github.com/dannyvankooten/vat"

Usage

Validating VAT numbers

VAT numbers can be validated by format, existence or both. VAT numbers are looked up using the VIES VAT validation API.

package main

import "github.com/dannyvankooten/vat"

func main() {
  // Validate number by format + existence
  validity, err := vat.ValidateNumber("NL123456789B01")

  // Validate number format
  validity, err := vat.ValidateNumberFormat("NL123456789B01")

  // Validate number existence
  validity, err := vat.ValidateNumberExistence("NL123456789B01")
}

Retrieving VAT rates

This package relies on a community maintained repository of vat rates. We invite you to toggle notifications for that repository and contribute changes to VAT rates in your country once they are announced.

To get VAT rate periods for a country, first get a CountryRates struct using the country's ISO-3166-1-alpha2 code.

You can get the rate that is currently in effect using the GetRate function.

package main

import (
  "fmt"
  "github.com/dannyvankooten/vat"
)

func main() {
  c, err := vat.GetCountryRates("NL")
  r, err := c.GetRate("standard")

  fmt.Printf("Standard VAT rate for NL is %.2f", r)
  // Output: Standard VAT rate for NL is 21.00
}

License

MIT licensed. See the LICENSE file for details.

More Repositories

1

AltoRouter

PHP routing class. Lightweight yet flexible. Supports REST, dynamic and reversed routing.
PHP
1,205
star
2

PHP-Router

Simple PHP Router class (supports REST and reverse routing)
PHP
562
star
3

laravel-vat

EU VAT library for Laravel
PHP
121
star
4

grender

Go package for easily rendering JSON/XML data and HTML templates
Go
96
star
5

plugin-endpoints

Register URL endpoints for which only certain WordPress plugins are enabled.
PHP
84
star
6

populate.js

Populate form fields from a JSON object.
HTML
70
star
7

wp-plugin-profiler

Basic profiler for WordPress plugins. Measures response times with and without a given plugin activated.
PHP
56
star
8

extemplate

Wrapper package for Go's template/html to allow for easy file-based template inheritance.
Go
56
star
9

pepper-lang

The Pepper Programming Language
C
55
star
10

goseo

command line tool to assess readability and SEO score for any HTML document or web page
Go
54
star
11

change-username

A WordPress plugin to change usernames
PHP
52
star
12

advent-of-code

Solutions for Advent of Code puzzles. In C, C++, Python, Rust and Golang. All years.
C
33
star
13

1brc

C99 implementation of the 1 Billion Rows Challenge. 1οΈβƒ£πŸπŸŽοΈ Runs in ~1.7 seconds on my not-so-fast laptop CPU w/ 16GB RAM.
C
32
star
14

monkey-c-monkey-do

C implementation of the Monkey programming language. Repository moved to Sourcehut.
C
30
star
15

nederlang

Nederlandse programmeertaal πŸ‡³πŸ‡±. GeΓ―nterpreteerd en met dynamische types. Met bytecode compiler en virtuele machine, in Rust.
Rust
29
star
16

wp-cdn-loader

Loads WordPress assets from a CDN instead of of local server.
PHP
22
star
17

moneybird-go

A Go client library for Moneybird
Go
18
star
18

gozer

Fast, opinionated and simple static site generator in a single static binary.
Go
16
star
19

unja

Template engine for C, inspired by Jinja and Liquid
C
13
star
20

smtp-mailer

A WordPress plugin that configures `wp_mail` to use SMTP.
PHP
13
star
21

dutchfirecalc.nl

Source code for dutchfirecalc.nl
Jupyter Notebook
10
star
22

respond

Go package for easily replying to HTTP requests with common response types.
Go
10
star
23

www.dvk.co

Site repository for my personal blog
Jupyter Notebook
4
star
24

pull-app

Simple app to track your pull-up volume
JavaScript
4
star
25

dotfiles

My dotfiles
Shell
4
star
26

www.dannyvankooten.com

My personal website, managed by Gozer.
Jupyter Notebook
3
star
27

moneybird-belastingdienst

Makkelijker kunnen zij het niet maken, wij wel.
HTML
2
star
28

top2000spotify

Maakt 'n Spotify playlist van je Top 2000 lijstje (of die van iemand anders).
JavaScript
2
star
29

stand

Stand is a periodic reminder to stand up from your desk
C
2
star
30

argos-crypto-watch

Lightweight C program for monitoring cryptocurrency price and volume changes in Argos.
C
1
star
31

pi-volume-control

Remote volume control for my Pi over HTTP
C
1
star
32

advent-of-code-2021

My solutions for Advent of Code 2021, in Python this time.
Python
1
star
33

advent-of-code-2019

My solutions for Advent of Code 2019, in Rust.
Rust
1
star
34

top-websites-compression

Researching compression applied by the top 10.000 websites
HTML
1
star
35

cnake

Snake in your terminal. In C, no dependencies.
C
1
star