Skip to content

Commit fafca0c

Browse files
committed
Initial commit to pages with readme
1 parent a456d79 commit fafca0c

File tree

1 file changed

+114
-21
lines changed

1 file changed

+114
-21
lines changed

index.md

Lines changed: 114 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,130 @@
1-
## Welcome to GitHub Pages
21

3-
You can use the [editor on GitHub](https://github.com/FirstLanguage/fl-python/edit/gh-pages/index.md) to maintain and preview the content for your website in Markdown files.
2+
# Getting Started with FirstLanguage API
43

5-
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
4+
## Introduction
65

7-
### Markdown
6+
Collection of NLP APIs to help developers. We have grouped the APIs under Basic and Advanced. Basic APIs cover all basic text operations like POSTag, Stemmer etc and Advanced cover all the APIs like QA, translation etc.
87

9-
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
8+
### OpenAPI Specification
109

11-
```markdown
12-
Syntax highlighted code block
10+
This API is documented in **OpenAPI v3.0 format**.
11+
In addition to standard
12+
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
1313

14-
# Header 1
15-
## Header 2
16-
### Header 3
14+
## Building
1715

18-
- Bulleted
19-
- List
16+
You must have Python `3 >=3.7, <= 3.9` installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc. These dependencies are defined in the `requirements.txt` file that comes with the SDK. To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps at [https://pip.pypa.io/en/stable/installing/](https://pip.pypa.io/en/stable/installing/).
2017

21-
1. Numbered
22-
2. List
18+
Python and PIP executables should be defined in your PATH. Open command prompt and type `pip --version`. This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.
2319

24-
**Bold** and _Italic_ and `Code` text
20+
* Using command line, navigate to the directory containing the generated files (including `requirements.txt`) for the SDK.
21+
* Run the command `pip install -r requirements.txt`. This should install all the required dependencies.
2522

26-
[Link](url) and ![Image](src)
23+
![Building SDK - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=installDependencies)
24+
25+
## Installation
26+
27+
The following section explains how to use the firstlanguageapi library in a new project.
28+
29+
### 1. Open Project in an IDE
30+
31+
Open up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
32+
33+
![Open project in PyCharm - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=pyCharm)
34+
35+
Click on `Open` in PyCharm to browse to your generated SDK directory and then click `OK`.
36+
37+
![Open project in PyCharm - Step 2](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=openProject0)
38+
39+
The project files will be displayed in the side bar as follows:
40+
41+
![Open project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=openProject1)
42+
43+
### 2. Add a new Test Project
44+
45+
Create a new directory by right clicking on the solution name as shown below:
46+
47+
![Add a new project in PyCharm - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=createDirectory)
48+
49+
Name the directory as "test".
50+
51+
![Add a new project in PyCharm - Step 2](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=nameDirectory)
52+
53+
Add a python file to this project.
54+
55+
![Add a new project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=createFile)
56+
57+
Name it "testSDK".
58+
59+
![Add a new project in PyCharm - Step 4](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=nameFile)
60+
61+
In your python file you will be required to import the generated python library using the following code lines
62+
63+
```python
64+
from firstlanguageapi.firstlanguageapi_client import FirstlanguageapiClient
2765
```
2866

29-
For more details see [Basic writing and formatting syntax](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).
67+
![Add a new project in PyCharm - Step 5](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&libraryName=firstlanguageapi.firstlanguageapi_client&className=FirstlanguageapiClient&step=projectFiles)
68+
69+
After this you can write code to instantiate an API client object, get a controller object and make API calls. Sample code is given in the subsequent sections.
70+
71+
### 3. Run the Test Project
72+
73+
To run the file within your test project, right click on your Python file inside your Test project and click on `Run`
74+
75+
![Run Test Project - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&libraryName=firstlanguageapi.firstlanguageapi_client&className=FirstlanguageapiClient&step=runProject)
76+
77+
## Test the SDK
78+
79+
You can test the generated SDK and the server with test cases. `unittest` is used as the testing framework and `nose` is used as the test runner. You can run the tests as follows:
80+
81+
Navigate to the root directory of the SDK and run the following commands
82+
83+
```
84+
pip install -r test-requirements.txt
85+
nosetests
86+
```
87+
88+
## Initialize the API Client
89+
90+
**_Note:_** Documentation for the client can be found [here.](/doc/client.md)
91+
92+
The following parameters are configurable for the API Client:
93+
94+
| Parameter | Type | Description |
95+
| --- | --- | --- |
96+
| `apikey` | `string` | API Key can be copied from your dashboard |
97+
| `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests |
98+
| `override_http_client_configuration` | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
99+
| `timeout` | `float` | The value to use for connection timeout. <br> **Default: 60** |
100+
| `max_retries` | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
101+
| `backoff_factor` | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
102+
| `retry_statuses` | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
103+
| `retry_methods` | `Array of string` | The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']** |
104+
105+
The API client can be initialized as follows:
106+
107+
```python
108+
from firstlanguageapi.firstlanguageapi_client import FirstlanguageapiClient
109+
from firstlanguageapi.configuration import Environment
110+
111+
client = FirstlanguageapiClient(
112+
apikey='apikey',
113+
environment=Environment.PRODUCTION,)
114+
```
115+
116+
## Authorization
117+
118+
This API uses `Custom Header Signature`.
119+
120+
## List of APIs
30121

31-
### Jekyll Themes
122+
* [Basic AP Is](/doc/controllers/basic-ap-is.md)
123+
* [Advanced AP Is](/doc/controllers/advanced-ap-is.md)
32124

33-
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/FirstLanguage/fl-python/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
125+
## Classes Documentation
34126

35-
### Support or Contact
127+
* [Utility Classes](/doc/utility-classes.md)
128+
* [HttpResponse](/doc/http-response.md)
129+
* [HttpRequest](/doc/http-request.md)
36130

37-
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.

0 commit comments

Comments
 (0)