Skip to main content

The Crossref Labs AWS tooling system.

Project description

Claws: Crossref Labs AWS Tools

Claws is a Python module that provides a simple and convenient way to interact with AWS services, such as S3 and CloudWatch. It utilizes the boto3 library and aiohttp for asynchronous operations, making it ideal for applications that require high-performance and efficient resource utilization.

license activity

AWS Linux Python

This is a prototype Crossref Labs system. It is not guaranteed to be stable and the metadata schema and behaviour may be subject to change at any time.

Features

  • S3 client and resource management with automatic deferred initialization
  • Presigned URL generation for S3 objects
  • Asynchronous downloading of multiple S3 objects
  • Retrieval of S3 objects as strings
  • Custom exception handling for S3 object retrieval errors
  • Easy integration with monitoring and instrumentation tools
  • Streaming upload to S3 to handle large JSON files

Requirements

  • Python 3.6 or higher
  • boto3
  • aiohttp
  • smart-open

Installation

To install the Claws module, simply use the following pip command:

pip install claws

Usage

Here is a basic example of how to use the Claws module to interact with AWS S3:

from claws.aws_utils import AWSConnector


# Initialize the AWSConnector with a specific S3 bucket
connector = AWSConnector(bucket="my-bucket", unsigned=False)

# Download an S3 object as a string
result = connector.s3_obj_to_str(bucket="my-bucket", s3_path="path/to/object.txt")

# Download multiple S3 objects asynchronously in parallel
s3_objects = ["path/to/object1.txt", "path/to/object2.txt", "path/to/object3.txt"]
results = connector.get_multiple_s3_objs(bucket="my-bucket", s3_objs=s3_objects)

for result in results:
    print(result)

Contributing

Contributions to the Claws module are welcome. Please feel free to submit pull requests or report issues on the GitHub repository.

License

Claws is released under the MIT License.

Credits

© Crossref 2023

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

claws-0.0.21.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

claws-0.0.21-py3-none-any.whl (7.3 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