Skip to main content
https://badge.fury.io/py/aliyun-fc2.svg https://travis-ci.org/aliyun/fc-python-sdk.svg?branch=master https://coveralls.io/repos/github/aliyun/fc-python-sdk/badge.svg?branch=master

Overview

The SDK of this version is dependent on the third-party HTTP library requests.

Running environment

Python 3.6+

Installation

Install the official release version through PIP (taking Linux as an example):

$ pip install xl-aliyun-fc2

You can also install the unzipped installer package directly:

$ sudo python setup.py install

Getting started

# -*- coding: utf-8 -*-
import fc2
import zipfile
import base64

# To know the endpoint and access key id/secret info, please refer to:
# https://help.aliyun.com/document_detail/52984.html
client = fc2.Client(
    endpoint='<Your Endpoint>',
    accessKeyID='<Your AccessKeyID>',
    accessKeySecret='<Your AccessKeySecret>')

# Create service.
client.create_service('demo')

zipFileBase64 = ''
with open('file.zip', 'rb') as f:
    content = f.read()
    zipFileBase64 = base64.b64encode(content).decode()

# Create function.
client.create_function('demo',
    {
        'functionName':'test_func',
        'runtime': 'python3',
        'handler': 'index.handler',
        'code': {
            'zipFile': zipFileBase64
        },
        'environmentVariables': {'testKey': 'testValue'}
    }
)

# Invoke function synchronously.
client.invoke_function('demo', 'test_func')

More resources

Contacting us

License

Release files for xl-aliyun-fc2 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xl-aliyun-fc2 0.0.2
File Size Uploaded
xl-aliyun-fc2-0.0.2.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xl-aliyun-fc2 0.0.2
File Interpreter ABI Platform
xl_aliyun_fc2-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size:28.5 kB

Release files / xl-aliyun-fc2-0.0.2.tar.gz

Download URL xl-aliyun-fc2-0.0.2.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a1d94374dce435677f4f5cbe6de87d83a36232f157dec60a5f19f2b86e6f05bd
BLAKE2b-256 checksum
How to use checksums
27dda1170478e35314e6f6f5bce5b2c8e946357123725857066586cd84ebe529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / xl_aliyun_fc2-0.0.2-py3-none-any.whl

Download URL xl_aliyun_fc2-0.0.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bf5b3fbdb7c3c2d2b19fb5817ba83b014a0621a0c1d1af29795600eff2cf75f
BLAKE2b-256 checksum
How to use checksums
1534f7d1376add4d41a516b10993e6d991d518a2617da216e5eb6be7ac4628f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page