Skip to content

Commit 144b507

Browse files
committed
Image caption changes
1 parent 3ab83e9 commit 144b507

File tree

84 files changed

+2000
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2000
-311
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ License:
33
The MIT License (MIT)
44
http://opensource.org/licenses/MIT
55

6-
Copyright (c) 2014 - 2020 APIMATIC Limited
6+
Copyright (c) 2014 - 2022 APIMATIC Limited
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include LICENSE
2-
include README.html
2+
include README.md

README.md

Lines changed: 27 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -7,80 +7,24 @@ Collection of NLP APIs to help developers. We have grouped the APIs under Basic
77

88
### OpenAPI Specification
99

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.html).
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

1414
## Building
1515

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
71-
7216
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/).
7317

7418
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.
7519

76-
* Using command line, navigate to the directory containing the generated files (including `requirements.txt`) for the SDK.
20+
* Using command line, navigate to the directory containing the generated files (including `requirements.txt`) for the SDK.
7721
* Run the command `pip install -r requirements.txt`. This should install all the required dependencies.
7822

7923
![Building SDK - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=installDependencies)
8024

8125
## Installation
8226

83-
The following section explains how to use the firstlanguageapi library in a new project.
27+
The following section explains how to use the firstlanguage_python library in a new project.
8428

8529
### 1. Open Project in an IDE
8630

@@ -94,62 +38,61 @@ Click on `Open` in PyCharm to browse to your generated SDK directory and then cl
9438

9539
The project files will be displayed in the side bar as follows:
9640

97-
![Open project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=openProject1)
41+
![Open project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&step=openProject1)
9842

9943
### 2. Add a new Test Project
10044

10145
Create a new directory by right clicking on the solution name as shown below:
10246

103-
![Add a new project in PyCharm - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=createDirectory)
47+
![Add a new project in PyCharm - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&step=createDirectory)
10448

10549
Name the directory as "test".
10650

10751
![Add a new project in PyCharm - Step 2](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&step=nameDirectory)
10852

10953
Add a python file to this project.
11054

111-
![Add a new project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=createFile)
55+
![Add a new project in PyCharm - Step 3](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&step=createFile)
11256

11357
Name it "testSDK".
11458

115-
![Add a new project in PyCharm - Step 4](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&step=nameFile)
59+
![Add a new project in PyCharm - Step 4](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&step=nameFile)
11660

11761
In your python file you will be required to import the generated python library using the following code lines
11862

11963
```python
120-
from firstlanguageapi.firstlanguageapi_client import FirstlanguageapiClient
64+
from firstlanguage_python.firstlanguage_python_client import FirstlanguageapiClient
12165
```
12266

123-
![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)
67+
![Add a new project in PyCharm - Step 5](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&libraryName=firstlanguage_python.firstlanguage_python_client&className=FirstlanguageapiClient&step=projectFiles)
12468

12569
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.
12670

12771
### 3. Run the Test Project
12872

12973
To run the file within your test project, right click on your Python file inside your Test project and click on `Run`
13074

131-
![Run Test Project - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguageapi&libraryName=firstlanguageapi.firstlanguageapi_client&className=FirstlanguageapiClient&step=runProject)
75+
![Run Test Project - Step 1](https://apidocs.io/illustration/python?workspaceFolder=Firstlanguageapi-Python&projectName=firstlanguage_python&libraryName=firstlanguage_python.firstlanguage_python_client&className=FirstlanguageapiClient&step=runProject)
13276

13377
## Test the SDK
13478

13579
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:
13680

137-
Navigate to the root directory of the SDK and run the following commands
138-
139-
```
140-
pip install -r test-requirements.txt
141-
nosetests
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
14286
```
14387

14488
## Initialize the API Client
14589

146-
**_Note:_** Documentation for the client can be found [here.](/doc/client.html)
90+
**_Note:_** Documentation for the client can be found [here.](/doc/client.md)
14791

14892
The following parameters are configurable for the API Client:
14993

15094
| Parameter | Type | Description |
15195
| --- | --- | --- |
152-
| `apikey` | `string` | API Key can be copied from your dashboard |
15396
| `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests |
15497
| `override_http_client_configuration` | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
15598
| `timeout` | `float` | The value to use for connection timeout. <br> **Default: 60** |
@@ -161,11 +104,10 @@ The following parameters are configurable for the API Client:
161104
The API client can be initialized as follows:
162105

163106
```python
164-
from firstlanguageapi.firstlanguageapi_client import FirstlanguageapiClient
165-
from firstlanguageapi.configuration import Environment
107+
from firstlanguage_python.firstlanguage_python_client import FirstlanguageapiClient
108+
from firstlanguage_python.configuration import Environment
166109

167-
client = FirstlanguageapiClient(
168-
apikey='apikey',
110+
client = FirstlanguageapiClient(
169111
environment=Environment.PRODUCTION,)
170112
```
171113

@@ -175,12 +117,13 @@ This API uses `Custom Header Signature`.
175117

176118
## List of APIs
177119

178-
* [Basic APIs](/doc/controllers/basic-api.html)
179-
* [Advanced APIs](/doc/controllers/advanced-api.html)
120+
* [Basic AP Is](/doc/controllers/basic-ap-is.md)
121+
* [Advanced AP Is](/doc/controllers/advanced-ap-is.md)
122+
* [Enterprise Only](/doc/controllers/enterprise-only.md)
180123

181124
## Classes Documentation
182125

183-
* [Utility Classes](/doc/utility-classes.html)
184-
* [HttpResponse](/doc/http-response.html)
185-
* [HttpRequest](/doc/http-request.html)
126+
* [Utility Classes](/doc/utility-classes.md)
127+
* [HttpResponse](/doc/http-response.md)
128+
* [HttpRequest](/doc/http-request.md)
186129

dist/firstlanguage_python-2.tar.gz

40.6 KB
Binary file not shown.

doc/client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al
3535
| --- | --- |
3636
| basic_api | Gets BasicAPIsController |
3737
| advanced_api | Gets AdvancedAPIsController |
38+
| enterprise_only | Gets EnterpriseOnlyController |
3839

0 commit comments

Comments
 (0)