This looks like it contains a secret.
Your code is sent to an AI service for conversion. Replace real keys and tokens with placeholders before converting.
How to convert AWS SDK JavaScript code to boto3
To convert AWS SDK JavaScript code to Python, paste it above and press Convert to Python. SDK calls become boto3 client methods in snake_case, such as s3.list_objects_v2(Bucket=...), await becomes a normal call, and paginators become get_paginator(). Then pip install boto3 and run it against test data.
Add your JavaScript or TypeScriptPaste it into the AWS SDK (JS/TS) editor, use Paste or Open file (.js, .mjs, .cjs, .jsx, .ts, .tsx or .txt, up to 500 KB), or drop a file onto the editor. v2 .promise() code and v3 commands both work. Sample loads an S3-to-DynamoDB indexing job.
Let the secret check runBefore the code leaves your browser, the page scans it for AWS access keys, secret keys, private keys and common API tokens. If it finds one, it highlights the match so you can replace it with a placeholder.
Convert to PythonClick Convert to Python or press Ctrl + Enter. The boto3 code streams in as it's written, and Stop cancels it. One conversion takes up to 60,000 characters.
Review the PythonCheck error handling, number and date types, and anything that ran in parallel with Promise.all. Search for TODO: comments, then copy the code or download it as converted.py.
Install boto3 and run itRun pip install boto3, make sure your AWS credentials are available, and try the script against a test bucket or table before production.
From Node.js AWS code to a Python script you can run.
Why port AWS SDK JavaScript code to Python
Teams move AWS logic from Node.js to Python for practical reasons: a data or ML team that works in Python needs the same S3 or DynamoDB logic, an ops script should run next to other boto3 tooling, or a Lambda function is being consolidated into a Python codebase. The AWS calls stay the same, but rewriting every call, parameter object and error check by hand takes time.
Because the AWS SDK for JavaScript and boto3 both call the same API operations with the same request and response keys, most of the conversion is mechanical: method names, keyword arguments, async code and error handling. The converter handles that rewrite, keeping your function names and comments, so you can focus on behavior that differs, such as concurrency and number types.
Both SDKs call the same AWS operations, so request and response keys stay the same.
How JavaScript AWS SDK calls map to boto3
A v3 client.send(new ListObjectsV2Command(params)) or a v2 s3.listObjectsV2(params).promise() becomes s3.list_objects_v2(**params) in boto3. Method names switch to snake_case, but request and response keys such as Bucket, Contents and NextContinuationToken keep their PascalCase names, because they come from the AWS API rather than the language.
boto3 calls block until they return, so await disappears. Pagination helpers become boto3 paginators, and JavaScript checks on err.name or err.code become except botocore.exceptions.ClientError blocks that read err.response["Error"]["Code"], as the boto3 error handling guide describes.
What changes when AWS code moves from JavaScript to Python.
AWS SDK for JavaScript vs boto3: quick reference
Common JavaScript AWS SDK patterns and their boto3 equivalents. The converter applies these, and the last few rows are where hand-checking pays off.
AWS SDK for JavaScript patterns compared with Python boto3
boto3.resource("dynamodb").Table(name), with numbers as Decimal
Errors
err.name
err.response["Error"]["Code"] on ClientError
Parallel calls
await Promise.all(tasks)
concurrent.futures.ThreadPoolExecutor, or run sequentially
Timestamps
JavaScript Date
Timezone-aware datetime
Key features
Works with SDK v2 and v3 inputThe converter reads v2 .promise() calls and v3 commands, including lib-dynamodb, and produces the same boto3 code for either.
Pythonic calls, same AWS keysMethods become snake_case boto3 calls with keyword arguments, while API keys like Bucket and Items stay exactly as AWS expects.
Paginators and waiters mappedpaginate* helpers and waitUntil* functions become boto3 get_paginator() and get_waiter() calls.
Error handling rewrittenJavaScript error checks become try/except ClientError blocks that compare the AWS error code.
Flags what needs a personWhere JavaScript behavior has no clean Python equivalent, the output includes a TODO: comment.
Checked for secrets firstThe page looks for access keys, secret keys, private keys and tokens in your browser before sending anything.
Copy or download as converted.pyCopy the result, wrap long lines, or download it ready to drop into a project.
Examples: JavaScript AWS SDK code converted to boto3
Three realistic conversions, from both SDK versions. Choose Try this example to load the JavaScript into the converter. Your output may be formatted differently.
Query a DynamoDB table (SDK v3 DocumentClient)
The DocumentClient maps most naturally to the boto3 resource API, which also takes plain values. The same expression strings work unchanged. Numbers in the returned items are Decimal values.
v2 .promise() calls become plain boto3 calls. Optional response keys like Messages are read with .get(), the Python version of the JavaScript default value.
import json
import boto3
sqs = boto3.client("sqs")
def drain_queue(queue_url, handle):
res = sqs.receive_message(QueueUrl=queue_url, MaxNumberOfMessages=10, WaitTimeSeconds=20)
messages = res.get("Messages", [])
for msg in messages:
handle(json.loads(msg["Body"]))
sqs.delete_message(QueueUrl=queue_url, ReceiptHandle=msg["ReceiptHandle"])
return len(messages)
Check whether an S3 object exists
A subtle one. In v3 a missing object throws an error named NotFound, but boto3 reports a HEAD request on a missing key with the error code "404". Check that the converted comparison uses the right value.
import boto3
from botocore.exceptions import ClientError
s3 = boto3.client("s3")
def object_exists(bucket, key):
try:
s3.head_object(Bucket=bucket, Key=key)
return True
except ClientError as err:
if err.response["Error"]["Code"] == "404":
return False
raise
Tips for better results
Paste whole functions with their imports. The imports tell the converter which SDK version and clients you use, including whether DynamoDB goes through the DocumentClient.
Say whether you want clients or resources. Add a comment like // use boto3 clients only at the top if your team avoids the resource API.
Keep the Python synchronous unless you need speed. For parallel work, use concurrent.futures with one boto3 client per thread rather than sharing a session across threads.
Let boto3 find credentials. Like the JavaScript SDK, it reads environment variables, ~/.aws profiles and IAM roles, so don't hard-code keys into the converted script.
Test with real response shapes. Run the script against a test bucket or table to catch Decimal, datetime and missing-key differences early.
Common mistakes when porting to boto3
Treating DynamoDB numbers as floats. The resource API returns Decimal, which json.dumps can't serialize without a custom encoder.
Reading an S3 body twice.res["Body"] is a StreamingBody. Call .read() once and keep the bytes.
Indexing optional keys directly.res["Contents"] raises KeyError on an empty bucket. Use res.get("Contents", []).
Leaving await in Python code. boto3 isn't async. An await left in a regular function is a syntax error.
Comparing error codes blindly. Codes can differ from JavaScript error names, as with HeadObject, which reports "404" in boto3.
Frequently asked questions
How do I convert AWS SDK JavaScript code to Python boto3?
Paste the JavaScript or TypeScript into the converter at the top of this page and press Convert to Python. It rewrites each SDK call as a boto3 client method, turns async code into regular calls and maps paginators and error handling. Then run pip install boto3 and test the script.
Does it matter whether my code uses AWS SDK v2 or v3?
No. The converter reads v2 .promise() calls and v3 commands alike, and both become the same boto3 code.
Will the Python code be async?
Usually not. boto3 is synchronous, so the output uses plain function calls. If you need async Python, the community aioboto3 library exists, but check its API before adapting the result.
Should the output use boto3 clients or resources?
Clients map most directly to JavaScript SDK calls and cover every service. The resource interface is convenient for DynamoDB and S3, but AWS isn't adding new features to it, so clients are the safer default.
Can I convert TypeScript?
Yes. Paste or open .ts and .tsx files. Type annotations don't carry over to boto3 directly, so add Python type hints afterwards if your project uses them.
No. The code is sent to an AI model hosted on NVIDIA's API only to produce the conversion, and ChatWithCloud doesn't store or log it. Your latest draft stays in your browser. Swap real keys and passwords for placeholders before converting. For the full picture, see whether it's safe to paste AWS code into an AI converter.
Is the converter free?
Yes, it's free. Each conversion takes up to 60,000 characters, and files up to 500 KB. Without an account you can run 6 conversions a minute and 60 a day. A free account raises that to 12 a minute and 200 a day and lists your recent conversions on your dashboard. The guide to ChatWithCloud free converter limits shows how far they stretch for a real migration.