Skip to content

Commit

Permalink
Doc/updating docs after readthedocs first build (#40)
Browse files Browse the repository at this point in the history
* Add URLs of readthedocs in README

* Add readthedocs badge

* Add tests readme

* Add pypi badge

* Add documentation url to pyproject

* Fix typo in readme
  • Loading branch information
ebram96 authored Jan 19, 2024
1 parent 61df48b commit 247b0d4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 33 deletions.
69 changes: 36 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Abstract API Python SDK

[![Documentation Status](https://readthedocs.org/projects/abstractapi-python-sdk/badge/?version=latest)](https://abstractapi-python-sdk.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/abstract-api.svg)](https://badge.fury.io/py/abstract-api)

This is a simple and intuitive Python SDK for using [AbstractAPI's](https://www.abstractapi.com/) services.

Current supported services:
Expand Down Expand Up @@ -73,7 +76,7 @@ Pythonic way for handling responses.
The `EmailValidation` class's `check()` method expects the same parameters `email` and `auto_correct`.\
(No need to pass `api_key`. It is already passed during service instantiation.)
**Recommended**:\
**Recommended**:
- Check service class and service class response documentations.
- Response fields used in examples are not only the ones. Check documentation to see\
all the capabilities.
Expand All @@ -88,8 +91,8 @@ Pythonic way for handling responses.
if response.is_disposable_email:
print("Email is disposable, not this time :( ")
```
`EmailValidation` documentation can be found [here](TODO)\
`EmailValidationResponse` documentation can be found [here](TODO)
`EmailValidation` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.email_validation.email_validation.html#abstract_api.email_validation.email_validation.EmailValidation)\
`EmailValidationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.email_validation.email_validation_response.html#abstract_api.email_validation.email_validation_response.EmailValidationResponse)
- Phone Validation
```python
Expand All @@ -99,8 +102,8 @@ Pythonic way for handling responses.
if response.valid:
print("Phone number is valid!")
```
`PhoneValidation` documentation can be found [here](TODO)\
`PhoneValidationResponse` documentation can be found [here](TODO)
`PhoneValidation` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.phone_validation.phone_validation.html#abstract_api.phone_validation.phone_validation.PhoneValidation)\
`PhoneValidationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.phone_validation.phone_validation_response.html#abstract_api.phone_validation.phone_validation_response.PhoneValidationResponse)
- VAT Validation/Calculation/Inquiry
```python
Expand All @@ -110,10 +113,10 @@ Pythonic way for handling responses.
calculation_response = service.calculate(amount=100, country_code="EG")
categories_response = service.categories("EG")
```
`VAT` documentation can be found [here](TODO)\
`VATValidationResponse` documentation can be found [here](TODO)\
`VATCalculationResponse` documentation can be found [here](TODO)\
`VATCategoriesResponse` documentation can be found [here](TODO)
`VAT` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.vat.vat.html#abstract_api.vat.vat.VAT)\
`VATValidationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.vat.vat_validation_response.html#abstract_api.vat.vat_validation_response.VATValidationResponse)\
`VATCalculationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.vat.vat_calculation_response.html#abstract_api.vat.vat_calculation_response.VATCalculationResponse)\
`VATCategoriesResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.vat.vat_categories_response.html#abstract_api.vat.vat_categories_response.VATCategoriesResponse)
- IBAN Validation
```python
Expand All @@ -123,8 +126,8 @@ Pythonic way for handling responses.
if response.is_valid:
print("IBAN is valid!")
```
`IBANValidation` documentation can be found [here](TODO)\
`IBANValidationResponse` documentation can be found [here](TODO)
`IBANValidation` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.iban_validation.iban_validation.html#abstract_api.iban_validation.iban_validation.IBANValidation)\
`IBANValidationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.iban_validation.iban_validation_response.html#abstract_api.iban_validation.iban_validation_response.IBANValidationResponse)
- IP Geolocation
```python
Expand All @@ -133,8 +136,8 @@ Pythonic way for handling responses.
response = service.check("156.215.70.7", fields=["city"])
print("IP is in: ", response.city)
```
`IPGeolocation` documentation can be found [here](TODO)\
`IPGeolocationResponse` documentation can be found [here](TODO)
`IPGeolocation` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.ip_geolocation.ip_geolocation.html#abstract_api.ip_geolocation.ip_geolocation.IPGeolocation)\
`IPGeolocationResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.ip_geolocation.ip_geolocation_response.html#abstract_api.ip_geolocation.ip_geolocation_response.IPGeolocationResponse)
- Holidays Lookup
```python
Expand All @@ -143,8 +146,8 @@ Pythonic way for handling responses.
response = service.check("EG")
print(response.holidays)
```
`Holidays` documentation can be found [here](TODO)\
`HolidaysResponse` documentation can be found [here](TODO)
`Holidays` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.holidays.holidays.html#abstract_api.holidays.holidays.Holidays)\
`HolidaysResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.holidays.holidays_response.html#abstract_api.holidays.holidays_response.HolidaysResponse)
- Exchange Rates Live/Convert/Historical
```python
Expand All @@ -154,10 +157,10 @@ Pythonic way for handling responses.
conversion_response = service.convert("USD", "EGP", "2023-01-17", 150)
historical_response = service.historical("USD", "2023-01-17", 150)
```
`ExchangeRates` documentation can be found [here](TODO)\
`LiveExchangeRatesResponse` documentation can be found [here](TODO)\
`HistoricalExchangeRatesResponse` documentation can be found [here](TODO)\
`ExchangeRatesConversionResponse` documentation can be found [here](TODO)
`ExchangeRates` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.exchange_rates.exchange_rates.html#abstract_api.exchange_rates.exchange_rates.ExchangeRates)\
`LiveExchangeRatesResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.exchange_rates.live_exchange_rates_response.html#abstract_api.exchange_rates.live_exchange_rates_response.LiveExchangeRatesResponse)\
`HistoricalExchangeRatesResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.exchange_rates.historical_exchange_rates_response.html#abstract_api.exchange_rates.historical_exchange_rates_response.HistoricalExchangeRatesResponse)\
`ExchangeRatesConversionResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.exchange_rates.exchange_rates_conversion_response.html#abstract_api.exchange_rates.exchange_rates_conversion_response.ExchangeRatesConversionResponse)
- Company Enrichment
```python
Expand All @@ -166,8 +169,8 @@ Pythonic way for handling responses.
response = service.check("EG")
print(response.holidays)
```
`CompanyEnrichment` documentation can be found [here](TODO)\
`CompanyEnrichmentResponse` documentation can be found [here](TODO)
`CompanyEnrichment` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.company_enrichment.company_enrichment.html#abstract_api.company_enrichment.company_enrichment.CompanyEnrichment)\
`CompanyEnrichmentResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.company_enrichment.company_enrichment_response.html#abstract_api.company_enrichment.company_enrichment_response.CompanyEnrichmentResponse)
- Timezone Current/Conversion
```python
Expand All @@ -176,9 +179,9 @@ Pythonic way for handling responses.
current_response = service.current("Cairo, Egypt", "82.111.111.111")
conversion_response = service.convert((30.0594627, 31.1758899), "Cairo, Egypt")
```
`Timezone` documentation can be found [here](TODO)\
`CurrentTimezoneResponse` documentation can be found [here](TODO)\
`TimezoneConversionResponse` documentation can be found [here](TODO)
`Timezone` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.timezone.timezone.html#abstract_api.timezone.timezone.Timezone)\
`CurrentTimezoneResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.timezone.current_timezone_response.html#abstract_api.timezone.current_timezone_response.CurrentTimezoneResponse)\
`TimezoneConversionResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.timezone.timezone_conversion_response.html#abstract_api.timezone.timezone_conversion_response.TimezoneConversionResponse)
- Avatars Generation
```python
Expand All @@ -188,8 +191,8 @@ Pythonic way for handling responses.
file = open("logo.png", "wb+")
file.write(response.content)
```
`Avatars` documentation can be found [here](TODO)\
`AvatarsResponse` documentation can be found [here](TODO)
`Avatars` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.avatars.avatars.html#abstract_api.avatars.avatars.Avatars)\
`AvatarsResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.avatars.avatars_response.html#abstract_api.avatars.avatars_response.AvatarsResponse)
- Website Screenshot
```python
Expand All @@ -199,8 +202,8 @@ Pythonic way for handling responses.
file = open("github-home-screenshot.png", "wb+")
file.write(response.content)
```
`WebsiteScreenshot` documentation can be found [here](TODO)\
`WebsiteScreenshotResponse` documentation can be found [here](TODO)
`WebsiteScreenshot` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.website_screenshot.website_screenshot.html#abstract_api.website_screenshot.website_screenshot.WebsiteScreenshot)\
`WebsiteScreenshotResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.website_screenshot.website_screenshot_response.html#abstract_api.website_screenshot.website_screenshot_response.WebsiteScreenshotResponse)
- Website Scrape
```python
Expand All @@ -210,8 +213,8 @@ Pythonic way for handling responses.
file = open("github-home-screenshot.png", "wb+")
file.write(response.content)
```
`WebScraping` documentation can be found [here](TODO)\
`WebScrapingResponse` documentation can be found [here](TODO)
`WebScraping` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.web_scraping.web_scraping.html#abstract_api.web_scraping.web_scraping.WebScraping)\
`WebScrapingResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.web_scraping.web_scraping_response.html#abstract_api.web_scraping.web_scraping_response.WebScrapingResponse)
- Image Processing
```python
Expand All @@ -225,8 +228,8 @@ Pythonic way for handling responses.
response = service.url("https://example.com/image.jpeg", lossy=False, resize=resize)
print(response.url)
```
`ImageProcessing` documentation can be found [here](TODO)\
`ImageProcessingResponse` documentation can be found [here](TODO)
`ImageProcessing` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.image_processing.image_processing.html#abstract_api.image_processing.image_processing.ImageProcessing)\
`ImageProcessingResponse` documentation can be found [here](https://abstractapi-python-sdk.readthedocs.io/en/latest/api_reference/abstract_api.image_processing.image_processing_response.html#abstract_api.image_processing.image_processing_response.ImageProcessingResponse)
### Handling Errors
1. If something wrong happened on client side:
Expand All @@ -239,7 +242,7 @@ Pythonic way for handling responses.
except ClientRequestError as e:
print("Some error happended from client's side")
print(str(e))
'quality must be in range from 1 to 100 (inclusive)'
# 'quality must be in range from 1 to 100 (inclusive)'
```
2. If the service endpoint returns a status code that is not 200 or 204.\
(200 and 204 are -currently- the only accepted status codes.)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ dependencies = [
Homepage = "https://github.com/ebram96/AbstractAPI-Python-SDK"
"Bug Tracker" = "https://github.com/ebram96/AbstractAPI-Python-SDK/issues"
Repository = "https://github.com/ebram96/AbstractAPI-Python-SDK.git"
Documentation = "https://abstractapi-python-sdk.readthedocs.io/en/latest/"
13 changes: 13 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Abstract API Python SDK

Running Tests:
==============
- Navigate to the root directory.
- Run project tests with coverage:
```shell
coverage run -m pytest
```
- Check coverage report:
```shell
coverage report
```

0 comments on commit 247b0d4

Please sign in to comment.