dynamodb-python-0.1.3
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dynamodb-python-0.1.3 |
| نام | dynamodb-python |
| نسخه کتابخانه | 0.1.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | domas-v |
| ایمیل نویسنده | domas.vaitmonas93@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/dynamodb-python/ |
| مجوز | - |
# dynamodb-python
## Installation
```bash
pip install dynamodb-python
```
## Requirements
### Dependencies
- python = "^3.9"
- ddbcereal
- botocore
- boto3
- requests
### Credentials
You will first need to set your AWS credentials. Since this library uses `boto3` under the hood, you can use the same methods as described in the [boto3 documentation](https://boto3.readthedocs.io/en/latest/guide/configuration.html). In short, AWS looks for credentials in these places:
1. Environment variables
2. Shared credentials file (`~/.aws/credentials`)
3. AWS config file (`~/.aws/config`)
You cacn also pass a dictionary to `DynamoDB` class:
```python
from dynamodb_python import DynamoDB
dynamodb = DynamoDB(credentials={
"aws_access_key_id": ACCESS_KEY,
"aws_secret_access_key": SECRET_KEY,
"aws_session_token": SESSION_TOKEN
})
```
## How to use
Having a table called `table_name`, you can access it like this:
```python
from dynamodb_python import DynamoDB
dynamodb = DynamoDB()
table = dynamodb.table_name
```
And then you can get an item like this:
```python
table.read_item(key={"partition_key": "key", "sort_key": "sort_key" }) # NOTE that sort_key is optional
```
Or you can get a list of items with the same key like this:
```python
table.read_items(key={"partition_key": "key"}) # NOTE that you can also pass in boto3 condition key
```
Or you can write an item like this:
```python
table.write(key={"partition_key": "key", "sort_key": "sort_key"}, data={"data": "data"})
```
نیازمندی
| مقدار | نام |
|---|---|
| >=2.1.1,<3.0.0 | ddbcereal |
| >=1.29.65,<2.0.0 | botocore |
| >=1.26.65,<2.0.0 | boto3 |
| >=2.28.2,<3.0.0 | requests |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl dynamodb-python-0.1.3:
pip install dynamodb-python-0.1.3.whl
نصب پکیج tar.gz dynamodb-python-0.1.3:
pip install dynamodb-python-0.1.3.tar.gz