Skip to main content

An AcrCloud Client for Python

Project description

acrcloud

ACR Cloud Python Client

API ACRCloud Doc

https://docs.acrcloud.com/reference/console-api

ACRClient Examples Usage

List and remove audios that are created on 2021

from acrcloud import ACRCloudClient
import os
ACR_TOKEN=os.getenv("ACR_TOKEN")

def log(bucket, msg):
    """Local log function"""
    print(f"B:{bucket.name} - {msg}")

acr = ACRCloudClient(ACR_TOKEN)
for bucket in acr.list_buckets(search="my-bucket-"):
    print("Processing bucket:", bucket.name)
    audios = bucket.list_audios(order="asc")
    for a in audios:
        if "2021" in a.created_at:
            a.delete()
            log(bucket, f"Delete audio: {a.id} - {a.created_at}")
        else:
            log(bucket, "Not found any audio from 2021")
            break

Environment Variables

ACR_CLOUD_TOKEN =

Roadmap plan

  • Handle date fields with datetime object
  • Handle TOKEN through default environment variables
  • Publish to pip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acrcloudclient-0.0.4.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

acrcloudclient-0.0.4-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page