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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file acrcloudclient-0.0.4.tar.gz.

File metadata

  • Download URL: acrcloudclient-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for acrcloudclient-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2a5df071b2d97c6db3bdd05a5869ca1c8ea3d8c8af7d4eae184350036c32ec0f
MD5 da7ea9be628378d63783528b4a010e6c
BLAKE2b-256 e9ef82313d3395e6566668cf8bd1dc2f61139af3a6d95e127a64441dedc59653

See more details on using hashes here.

File details

Details for the file acrcloudclient-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for acrcloudclient-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b2da2d6058131c3ba6607d0e41ba730491766aaf0c208cc8e7f4d1e41d05e7f5
MD5 cff29245d67b1f53ea9bddcb8ccf8410
BLAKE2b-256 ac9a82d4fad16cc2f3de5554800c1c7edd6df3dff1925c467307d0aa35fe2631

See more details on using hashes here.

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