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.22.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claws-0.0.22-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file claws-0.0.22.tar.gz.

File metadata

  • Download URL: claws-0.0.22.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for claws-0.0.22.tar.gz
Algorithm Hash digest
SHA256 5d8088a2143f914405fdeab8b77c953f039d3f565bb4827b5371b5404b3cf520
MD5 6bd66c404a165959dfcb8469ccb67e8f
BLAKE2b-256 68538e2d7b7c7aa0ef3625af591406e2503486ffcebf8b401be3cf74372e83cd

See more details on using hashes here.

File details

Details for the file claws-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: claws-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for claws-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 f594a44fedd076737838e34169eeeb5370598f8e7059fc34efad3c0ab0ebb223
MD5 82ead8a9e56235ae27edaf0c1c191804
BLAKE2b-256 5daa62364e70b5c3874e857189840f90378ddfc3add5b14f1b3707d1655f7d52

See more details on using hashes here.

Supported by

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