Skip to content

Commit 9fbe856

Browse files
committed
Updated MD files
1 parent b4f2264 commit 9fbe856

File tree

2 files changed

+112
-4
lines changed

2 files changed

+112
-4
lines changed

README.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,61 @@ OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc
1313

1414
## Building
1515

16-
Download the FirstLanguage Python SDK from <a href="FirstLanguage_PythonSDK.zip">here</a>
16+
You can use the SDK either from source by cloning from GitHub using our [repo](https://github.com/FirstLanguage/firstlanguage_python.git)
17+
18+
Or you can use PIP to install our package directly by using the command.
19+
20+
```
21+
pip install firstlanguage-python
22+
```
23+
24+
## Follow below steps if you want to use SDK from our PIP published package
25+
26+
Once the package is installed you can directly use our package in your code. Below is a working example. Replace <Your_API_KEY> with your API Key from the dashboard.
27+
28+
```
29+
from firstlanguage_python.firstlanguage_client import Client
30+
from firstlanguage_python.configuration import Environment
31+
import jsonpickle
32+
33+
34+
client = Client(
35+
apikey='<Your_API_KEY>',
36+
environment=Environment.PRODUCTION,)
37+
38+
reqbody='{"input":{"text":"அவள் வேகமாக ஓடினாள்","lang":"ta"} }'
39+
40+
body = jsonpickle.decode(reqbody)
41+
basic_api_controller = client.basic_api
42+
43+
result = basic_api_controller.get_stemmer(body)
44+
45+
for res in result:
46+
print("Original Text passed: "+res.orginal_text)
47+
print("Stemmed result: "+res.stem)
48+
49+
50+
```
51+
52+
Save the above file as test.py and run it using the below command
53+
54+
```
55+
python3 test.py
56+
```
57+
58+
You will get an output like below
59+
60+
```
61+
200
62+
Original Text passed: அவள்
63+
Stemmed result: அவள்
64+
Original Text passed: வேகமாக
65+
Stemmed result: வேகம்
66+
Original Text passed: ஓடினாள்
67+
Stemmed result: ஓடி
68+
```
69+
70+
## Follow below steps if you want to use SDK from source
1771

1872
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/).
1973

@@ -121,8 +175,8 @@ This API uses `Custom Header Signature`.
121175

122176
## List of APIs
123177

124-
* [Basic AP Is](/doc/controllers/basic-api.md)
125-
* [Advanced AP Is](/doc/controllers/advanced-api.md)
178+
* [Basic APIs](/doc/controllers/basic-api.md)
179+
* [Advanced APIs](/doc/controllers/advanced-api.md)
126180

127181
## Classes Documentation
128182

index.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,61 @@ OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc
1313

1414
## Building
1515

16-
Download the FirstLanguage Python SDK from <a href="FirstLanguage_PythonSDK.zip">here</a>
16+
You can use the SDK either from source by cloning from GitHub using our [repo](https://github.com/FirstLanguage/firstlanguage_python.git)
17+
18+
Or you can use PIP to install our package directly by using the command.
19+
20+
```
21+
pip install firstlanguage-python
22+
```
23+
24+
## Follow below steps if you want to use SDK from our PIP published package
25+
26+
Once the package is installed you can directly use our package in your code. Below is a working example. Replace <Your_API_KEY> with your API Key from the dashboard.
27+
28+
```
29+
from firstlanguage_python.firstlanguage_client import Client
30+
from firstlanguage_python.configuration import Environment
31+
import jsonpickle
32+
33+
34+
client = Client(
35+
apikey='<Your_API_KEY>',
36+
environment=Environment.PRODUCTION,)
37+
38+
reqbody='{"input":{"text":"அவள் வேகமாக ஓடினாள்","lang":"ta"} }'
39+
40+
body = jsonpickle.decode(reqbody)
41+
basic_api_controller = client.basic_api
42+
43+
result = basic_api_controller.get_stemmer(body)
44+
45+
for res in result:
46+
print("Original Text passed: "+res.orginal_text)
47+
print("Stemmed result: "+res.stem)
48+
49+
50+
```
51+
52+
Save the above file as test.py and run it using the below command
53+
54+
```
55+
python3 test.py
56+
```
57+
58+
You will get an output like below
59+
60+
```
61+
200
62+
Original Text passed: அவள்
63+
Stemmed result: அவள்
64+
Original Text passed: வேகமாக
65+
Stemmed result: வேகம்
66+
Original Text passed: ஓடினாள்
67+
Stemmed result: ஓடி
68+
```
69+
70+
## Follow below steps if you want to use SDK from source
1771

1872
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/).
1973

0 commit comments

Comments
 (0)