Skip to content

Commit 247b0d4

Browse files
authored
Doc/updating docs after readthedocs first build (#40)
* Add URLs of readthedocs in README * Add readthedocs badge * Add tests readme * Add pypi badge * Add documentation url to pyproject * Fix typo in readme
1 parent 61df48b commit 247b0d4

File tree

3 files changed

+50
-33
lines changed

3 files changed

+50
-33
lines changed

README.md

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Abstract API Python SDK
22

3+
[![Documentation Status](https://readthedocs.org/projects/abstractapi-python-sdk/badge/?version=latest)](https://abstractapi-python-sdk.readthedocs.io/en/latest/?badge=latest)
4+
[![PyPI version](https://badge.fury.io/py/abstract-api.svg)](https://badge.fury.io/py/abstract-api)
5+
36
This is a simple and intuitive Python SDK for using [AbstractAPI's](https://www.abstractapi.com/) services.
47

58
Current supported services:
@@ -73,7 +76,7 @@ Pythonic way for handling responses.
7376
The `EmailValidation` class's `check()` method expects the same parameters `email` and `auto_correct`.\
7477
(No need to pass `api_key`. It is already passed during service instantiation.)
7578

76-
**Recommended**:\
79+
**Recommended**:
7780
- Check service class and service class response documentations.
7881
- Response fields used in examples are not only the ones. Check documentation to see\
7982
all the capabilities.
@@ -88,8 +91,8 @@ Pythonic way for handling responses.
8891
if response.is_disposable_email:
8992
print("Email is disposable, not this time :( ")
9093
```
91-
`EmailValidation` documentation can be found [here](TODO)\
92-
`EmailValidationResponse` documentation can be found [here](TODO)
94+
`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)\
95+
`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)
9396

9497
- Phone Validation
9598
```python
@@ -99,8 +102,8 @@ Pythonic way for handling responses.
99102
if response.valid:
100103
print("Phone number is valid!")
101104
```
102-
`PhoneValidation` documentation can be found [here](TODO)\
103-
`PhoneValidationResponse` documentation can be found [here](TODO)
105+
`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)\
106+
`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)
104107

105108
- VAT Validation/Calculation/Inquiry
106109
```python
@@ -110,10 +113,10 @@ Pythonic way for handling responses.
110113
calculation_response = service.calculate(amount=100, country_code="EG")
111114
categories_response = service.categories("EG")
112115
```
113-
`VAT` documentation can be found [here](TODO)\
114-
`VATValidationResponse` documentation can be found [here](TODO)\
115-
`VATCalculationResponse` documentation can be found [here](TODO)\
116-
`VATCategoriesResponse` documentation can be found [here](TODO)
116+
`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)\
117+
`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)\
118+
`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)\
119+
`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)
117120

118121
- IBAN Validation
119122
```python
@@ -123,8 +126,8 @@ Pythonic way for handling responses.
123126
if response.is_valid:
124127
print("IBAN is valid!")
125128
```
126-
`IBANValidation` documentation can be found [here](TODO)\
127-
`IBANValidationResponse` documentation can be found [here](TODO)
129+
`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)\
130+
`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)
128131

129132
- IP Geolocation
130133
```python
@@ -133,8 +136,8 @@ Pythonic way for handling responses.
133136
response = service.check("156.215.70.7", fields=["city"])
134137
print("IP is in: ", response.city)
135138
```
136-
`IPGeolocation` documentation can be found [here](TODO)\
137-
`IPGeolocationResponse` documentation can be found [here](TODO)
139+
`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)\
140+
`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)
138141

139142
- Holidays Lookup
140143
```python
@@ -143,8 +146,8 @@ Pythonic way for handling responses.
143146
response = service.check("EG")
144147
print(response.holidays)
145148
```
146-
`Holidays` documentation can be found [here](TODO)\
147-
`HolidaysResponse` documentation can be found [here](TODO)
149+
`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)\
150+
`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)
148151

149152
- Exchange Rates Live/Convert/Historical
150153
```python
@@ -154,10 +157,10 @@ Pythonic way for handling responses.
154157
conversion_response = service.convert("USD", "EGP", "2023-01-17", 150)
155158
historical_response = service.historical("USD", "2023-01-17", 150)
156159
```
157-
`ExchangeRates` documentation can be found [here](TODO)\
158-
`LiveExchangeRatesResponse` documentation can be found [here](TODO)\
159-
`HistoricalExchangeRatesResponse` documentation can be found [here](TODO)\
160-
`ExchangeRatesConversionResponse` documentation can be found [here](TODO)
160+
`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)\
161+
`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)\
162+
`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)\
163+
`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)
161164

162165
- Company Enrichment
163166
```python
@@ -166,8 +169,8 @@ Pythonic way for handling responses.
166169
response = service.check("EG")
167170
print(response.holidays)
168171
```
169-
`CompanyEnrichment` documentation can be found [here](TODO)\
170-
`CompanyEnrichmentResponse` documentation can be found [here](TODO)
172+
`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)\
173+
`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)
171174

172175
- Timezone Current/Conversion
173176
```python
@@ -176,9 +179,9 @@ Pythonic way for handling responses.
176179
current_response = service.current("Cairo, Egypt", "82.111.111.111")
177180
conversion_response = service.convert((30.0594627, 31.1758899), "Cairo, Egypt")
178181
```
179-
`Timezone` documentation can be found [here](TODO)\
180-
`CurrentTimezoneResponse` documentation can be found [here](TODO)\
181-
`TimezoneConversionResponse` documentation can be found [here](TODO)
182+
`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)\
183+
`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)\
184+
`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)
182185

183186
- Avatars Generation
184187
```python
@@ -188,8 +191,8 @@ Pythonic way for handling responses.
188191
file = open("logo.png", "wb+")
189192
file.write(response.content)
190193
```
191-
`Avatars` documentation can be found [here](TODO)\
192-
`AvatarsResponse` documentation can be found [here](TODO)
194+
`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)\
195+
`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)
193196

194197
- Website Screenshot
195198
```python
@@ -199,8 +202,8 @@ Pythonic way for handling responses.
199202
file = open("github-home-screenshot.png", "wb+")
200203
file.write(response.content)
201204
```
202-
`WebsiteScreenshot` documentation can be found [here](TODO)\
203-
`WebsiteScreenshotResponse` documentation can be found [here](TODO)
205+
`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)\
206+
`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)
204207

205208
- Website Scrape
206209
```python
@@ -210,8 +213,8 @@ Pythonic way for handling responses.
210213
file = open("github-home-screenshot.png", "wb+")
211214
file.write(response.content)
212215
```
213-
`WebScraping` documentation can be found [here](TODO)\
214-
`WebScrapingResponse` documentation can be found [here](TODO)
216+
`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)\
217+
`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)
215218

216219
- Image Processing
217220
```python
@@ -225,8 +228,8 @@ Pythonic way for handling responses.
225228
response = service.url("https://example.com/image.jpeg", lossy=False, resize=resize)
226229
print(response.url)
227230
```
228-
`ImageProcessing` documentation can be found [here](TODO)\
229-
`ImageProcessingResponse` documentation can be found [here](TODO)
231+
`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)\
232+
`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)
230233

231234
### Handling Errors
232235
1. If something wrong happened on client side:
@@ -239,7 +242,7 @@ Pythonic way for handling responses.
239242
except ClientRequestError as e:
240243
print("Some error happended from client's side")
241244
print(str(e))
242-
'quality must be in range from 1 to 100 (inclusive)'
245+
# 'quality must be in range from 1 to 100 (inclusive)'
243246
```
244247
2. If the service endpoint returns a status code that is not 200 or 204.\
245248
(200 and 204 are -currently- the only accepted status codes.)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ dependencies = [
3535
Homepage = "https://github.com/ebram96/AbstractAPI-Python-SDK"
3636
"Bug Tracker" = "https://github.com/ebram96/AbstractAPI-Python-SDK/issues"
3737
Repository = "https://github.com/ebram96/AbstractAPI-Python-SDK.git"
38+
Documentation = "https://abstractapi-python-sdk.readthedocs.io/en/latest/"

tests/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Abstract API Python SDK
2+
3+
Running Tests:
4+
==============
5+
- Navigate to the root directory.
6+
- Run project tests with coverage:
7+
```shell
8+
coverage run -m pytest
9+
```
10+
- Check coverage report:
11+
```shell
12+
coverage report
13+
```

0 commit comments

Comments
 (0)