Supported Dependent Libraries
FunctionGraph supports both standard and third-party libraries.
When using standard libraries, you can import them to your inline code or package and upload them to FunctionGraph.
FunctionGraph provides built-in third-party components listed in Table 1 and Table 2. You can import these libraries to your inline code in the same way as you import standard libraries.
Name |
Usage |
Version |
---|---|---|
q |
Asynchronous method encapsulation |
1.5.1 |
co |
Asynchronous process control |
4.6.0 |
lodash |
Common tool and method library |
4.17.10 |
esdk-obs-nodejs |
OBS sdk |
2.1.5 |
express |
Simplified web-based application development framework |
4.16.4 |
fgs-express |
Provides a Node.js application framework for FunctionGraph and APIG to run serverless applications and REST APIs. This component provides an example of using the Express framework to build serverless web applications or services and RESTful APIs. |
1.0.1 |
request |
Simplifies HTTP invocation and supports HTTPS and redirection. |
2.88.0 |
Module |
Usage |
Version |
---|---|---|
dateutil |
Date and time processing |
2.6.0 |
requests |
HTTP library |
2.7.0 |
httplib2 |
httpclient |
0.10.3 |
numpy |
Mathematical computing |
For pip 2.7, numpy==1.16.6. For pip 3.10, numpy==1.24.2. For pip 3.9, numpy==1.18.5. For pip 3.6, numpy==1.18.5. |
redis |
Redis client |
2.10.5 |
obsclient |
OBS client |
- |
smnsdk |
SMN access |
1.0.1 |
Package the dependency third-party libraries and upload them to an OBS bucket or on the function details page. These libraries will then be used in your function code.
Importing Dependent Libraries
from com.obs.client.obs_client import ObsClient
const ObsClient = require('esdk-obs-nodejs');
For standard libraries and supported non-standard libraries, you can directly use them in your function.
For non-standard third-party libraries that are not provided by FunctionGraph, you can use them by performing the following steps:
Each dependency package cannot contain a file with the same name as a code file. Otherwise, the two files may be incorrectly merged or overwritten. For example, if dependency package depends.zip contains a file named index.py, the handler of a function cannot be set to index.handler. Otherwise, a code file also named index.py will be generated.