Giter VIP home page Giter VIP logo

vatcomply's Introduction

VATcomply

VATcomply is a free API service for vat number validation, user ip geolocation and foreign exchange rates published by the European Central Bank.

Usage

Lates & specific date rates

Get the latest foreign exchange rates.

GET /rates

Rates are quoted against the Euro by default. Quote against a different currency by setting the base parameter in your request.

GET /rates?base=USD

Request specific exchange rates by setting the symbols parameter.

GET /rates?symbols=USD,GBP

Rates history and query parameters combinations

Get historical rates for a date

GET /rates?date=2018-01-01

Limit results to specific exchange rates to save bandwidth with the symbols parameter.

GET /rates?date=2018-01-01&symbols=ILS,JPY

Quote the historical rates against a different currency.

GET /rates?date=2018-01-01&base=USD

Client side usage

The primary use case is client side. For instance, with money.js in the browser

let demo = () => {
  let rate = fx(1).from("GBP").to("USD");
  alert("£1 = $" + rate.toFixed(4));
};

fetch("https://api.vatcomply.com/rates")
  .then((resp) => resp.json())
  .then((data) => (fx.rates = data.rates))
  .then(demo);

Stack

VATcomply API is built upon Django with asyncronous views, Pydantic and asyncronous ORM queries to achieve high throughput. The current setup can asyncronously handle thousands of requests per second.

Libraries used

Deployment

Virtualenv

pyenv shell 3.x.x

Install packages

virtualenv env
. env/bin/activate
pip install -r requirements.in --upgrade

Load in initial data & Scheduler

The scheduler will keep your database up to date hourly with information from European Central bank. It will download the last 90 days worth of data every hour.

The reference rates are usually updated around 16:00 CET on every working day, except on TARGET closing days. They are based on a regular daily concertation procedure between central banks across Europe, which normally takes place at 14:15 CET.

On initialization it will check the database. If it's empty all the historic rates will be downloaded and records created in the database.

Development

export DEBUG=True; uvicorn vatcomply.asgi:application --reload

or for simplicity a Makefile is provided with all the commands for development.

make run

Migrations

Make migrations

make migrations

Run migrations

make migrate

Tests

make test

Contributing

Thanks for your interest in the project! All pull requests are welcome from developers of all skill levels. To get started, simply fork the master branch on GitHub to your personal account and then clone the fork into your development environment.

Madis Väin (madisvain on Github) is the original creator of the VATcomply API.

License

MIT

vatcomply's People

Contributors

madisvain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vatcomply's Issues

Missing an OpenAPI specification.

I wasn't able to see an OpenAPI specification.
Can you provide schema endpoint so that we can use automated tools to generate an API client (for c#, typescript) in order to consume your API?

Urgent question with VATComply - The error of "MS_MAX_CONCURRENT_REQ"

Hello Madisvain,

I would like to explain our actual issue.

The context is when are are checking the VAT Number (in the payment form), sometimes it is showing us the error of "MS_MAX_CONCURRENT_REQ" as attached in the image as below :

image_2023_09_27T13_38_36_475Z.

This is the API end point's link (https://api.vatcomply.com/) that we are using to check the VAT Number.
Now, when we click on this link, it shows us the 404 Error.

Therefore, we need your kind support to look into this and let us know why this issue is coming now and what can we do to resolve this because next week, we will launch our product concerning the payment module (which is included the VAT Number as important input).

Many thanks & best regards

Suggest to loosen the dependency on databases

Dear developers,

Your project vatcomply requires "databases==0.5.2" in its dependency. After analyzing the source code, we found that the following versions of databases can also be suitable without affecting your project, i.e., databases 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.5.1, 0.5.3, 0.5.4, 0.5.5. Therefore, we suggest to loosen the dependency on databases from "databases==0.5.2" to "databases>=0.4.0,<=0.5.5" to avoid any possible conflict for importing more packages or for downstream projects that may use ddos_script.

May I pull a request to further loosen the dependency on databases?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



Details:

Your project (commit id: ce3a5be) directly uses 1 APIs from package databases.

databases.core.Database.__init__

Beginning fromwhich, 6 functions are then indirectly called, including 3 databases's internal APIs and 3 outsider APIs as follows:

[/madisvain/vatcomply]
+--databases.core.Database.__init__
|      +--databases.core.DatabaseURL.__init__
|      +--databases.importer.import_from_string
|      |      +--databases.importer.ImportFromStringError.__init__
|      |      +--importlib.import_module
|      +--aiocontextvars.ContextVar
|      +--contextvars.ContextVar

Since all these functions have not been changed between any version for package "databases" from [0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.5.1, 0.5.3, 0.5.4, 0.5.5] and 0.5.2. Therefore, we believe it is safe to loosen the corresponding dependency.

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.