> ## Documentation Index
> Fetch the complete documentation index at: https://rilwanorganization.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Welcome to the documentation for `abstract-python` library

<img className="block dark:hidden" src="https://cdn.prod.website-files.com/65166126ca18241731aa26b0/6532894c4b8441d0d19d2c83_Opengraph.png" alt="Hero Light" />

<img className="hidden dark:block" src="https://cdn.prod.website-files.com/65166126ca18241731aa26b0/6532894c4b8441d0d19d2c83_Opengraph.png" alt="Hero Dark" />

## Overview

The `abstract-python` library is a Python SDK for APIs by [AbstractAPI](https://www.abstractapi.com/). It contains helper classes
that allow Python developers use these APIs without having to know the endpoints off-hand.

It also does type validation on each request data before they are sent to the API server. This helps to manage credits, as each request costs a credit -
whether successful or otherwise.

This SDK currrently supports the **[Exchange Rates API](https://docs.abstractapi.com/exchange-rates)**,
**[IP Geolocation API](https://docs.abstractapi.com/ip-geolocation)**, and the **[VAT API](https://docs.abstractapi.com/vat-validation)**.

<Note>
  This is not an official SDK by AbstractAPI but safe to use by anyone.
</Note>

## Quickstart

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="installation">
    This page helps you to install the `abstract-python` library
  </Card>

  <Card title="Authentication" icon="key" href="authentication">
    This page helps you to get api-keys to authenticate with the library
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="Exchange API" icon="money-bills" href="essentials/exchange/Overview">
    This API helps you to get real-time exchnage rates and much more between currencies
  </Card>

  <Card title="IP Geolocation API" icon="location-dot" href="essentials/ip/ipApi">
    This API helps you to retrive user's location data with their IP address.
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="VAT API" icon="cookie" href="essentials/vat/overview">
    This API helps you to calculate VAT fees for products in a country
  </Card>

  <Card title="Error handling" icon="circle-exclamation" href="errors">
    This page helps you to gracefully handle errors without crashing your app.
  </Card>
</CardGroup>

## Response format

All responses are returned as a `JSON` object. Each response object has a `status` field that contains the response status code. Below is a sample response object for a successful request:

```python theme={null}

{
  // Other response data
  "status": 200
}
```

The `status` field is used to verify the request's success.

## Errors and exceptions

Errors in `abstract-python` are in two(2) variants.

* **Regular Python exceptions:**

A common exception you will encounter is the `TypeError`, usually from wrong data types used in arguments.

* **JSON error messages:**

These are JSON objects with detailed description of the error. They are often self-explanatory.
Below is a sample error message:

```python theme={null}
// Authorization error

{
  "error": {
    "message":"A validation error occurred.",
    "code":"validation_error",
    "details":{
      "api_key":["This field may not be blank."],
      "country_code":["\"fu\" is not a valid choice."]
    }
  },
  "status": 401
}
```
