# Py aws Lambda Toolkit
This is a lightweight Python toolkit for easily and quickly creating AWS Lambda functions with the Serverless Framework. It includes the following features:
- DynamoDB shortcuts: Avoid boilerplate code for DynamoDB operations.
- HTTP event processing: Get the event of the HTTP request and parse it, splitting it into the path, query string, body, headers, etc.
- HTTP response shortcuts: Create HTTP responses with the correct format and status code.
- JWT authentication: Create and verify JWT tokens as easily as possible.
- Logger: Log messages with a format that is easy to read.
- Mappers: Remove specified fields from a dictionary or list of dictionaries.
- Parser: Convert dictionary keys to snake case or camel case.
- Password hashing: Hash passwords with salt and verify them.
- DynamoDB scan builder: Build a scan query with specified filters.
- Validator: Validate a dictionary with specified rules.
## Installation
Install the package with pip:
```bash
pip install py-aws-lambda-toolkit
```
## Usage
Use the package in your code:
```python
import logging
from py_aws_lambda_toolkit.http_event import process_event
from py_aws_lambda_toolkit.http_response import create_response
from py_aws_lambda_toolkit.status import StatusCode
from py_aws_lambda_toolkit.logger import logging
status = StatusCode()
def handler(event, context):
# Process the event
event_data = process_event(event)
event_body = event_data.get("body", {})
logging.info("Event body: %s", event_body)
# Create a response
response = create_response(
{ "ok": True, "message": "Processed event successfully" },
status=status.code_200_success,
)
return response
```
## Contributing
Contributions are welcome! For bug reports or requests please [submit an issue](https://github.com/0riion/py-aws-lambda-toolkit/issues). For code contributions please create a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Further Reading
This project is in an starting phase. More documentation will be added soon and the project will be improved with more features.
Raw data
{
"_id": null,
"home_page": "https://github.com/0riion/py-aws-lambda-toolkit",
"name": "py-aws-lambda-toolkit",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "aws,serverless,lambda,dynamodb,toolkit,python,aws",
"author": "Julio Flores",
"author_email": "juliocesarflores12@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/47/d1/97462ceeb284d19619aca12f44a040f525bff1cb8db06e7137784ad1de31/py-aws-lambda-toolkit-0.0.6.tar.gz",
"platform": null,
"description": "# Py aws Lambda Toolkit\n\nThis is a lightweight Python toolkit for easily and quickly creating AWS Lambda functions with the Serverless Framework. It includes the following features:\n\n- DynamoDB shortcuts: Avoid boilerplate code for DynamoDB operations.\n- HTTP event processing: Get the event of the HTTP request and parse it, splitting it into the path, query string, body, headers, etc.\n- HTTP response shortcuts: Create HTTP responses with the correct format and status code.\n- JWT authentication: Create and verify JWT tokens as easily as possible.\n- Logger: Log messages with a format that is easy to read.\n- Mappers: Remove specified fields from a dictionary or list of dictionaries.\n- Parser: Convert dictionary keys to snake case or camel case.\n- Password hashing: Hash passwords with salt and verify them.\n- DynamoDB scan builder: Build a scan query with specified filters.\n- Validator: Validate a dictionary with specified rules.\n\n## Installation\n\nInstall the package with pip:\n\n```bash\npip install py-aws-lambda-toolkit\n```\n\n## Usage\n\nUse the package in your code:\n\n```python\nimport logging\nfrom py_aws_lambda_toolkit.http_event import process_event\nfrom py_aws_lambda_toolkit.http_response import create_response\nfrom py_aws_lambda_toolkit.status import StatusCode\nfrom py_aws_lambda_toolkit.logger import logging\n\nstatus = StatusCode()\n\ndef handler(event, context):\n # Process the event\n event_data = process_event(event)\n event_body = event_data.get(\"body\", {})\n\n logging.info(\"Event body: %s\", event_body)\n\n # Create a response\n response = create_response(\n { \"ok\": True, \"message\": \"Processed event successfully\" },\n status=status.code_200_success,\n )\n\n return response\n\n```\n\n## Contributing\n\nContributions are welcome! For bug reports or requests please [submit an issue](https://github.com/0riion/py-aws-lambda-toolkit/issues). For code contributions please create a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Further Reading\n\nThis project is in an starting phase. More documentation will be added soon and the project will be improved with more features.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A toolkit for serverless and AWS, with a focus on AWS Lambda and dynamodb.",
"version": "0.0.6",
"project_urls": {
"Homepage": "https://github.com/0riion/py-aws-lambda-toolkit"
},
"split_keywords": [
"aws",
"serverless",
"lambda",
"dynamodb",
"toolkit",
"python",
"aws"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a427d52aae84ae917d40ccf00377b43cfd0a62b39a4107c63f4eaa2455b1dcb5",
"md5": "820936394000d5fbb48917dca84e96c3",
"sha256": "e2ddebea24d3e9afd333e329f84dc24247a40d21efc30d22ad87e1369bdd1add"
},
"downloads": -1,
"filename": "py_aws_lambda_toolkit-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "820936394000d5fbb48917dca84e96c3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15569,
"upload_time": "2023-07-25T21:55:47",
"upload_time_iso_8601": "2023-07-25T21:55:47.140631Z",
"url": "https://files.pythonhosted.org/packages/a4/27/d52aae84ae917d40ccf00377b43cfd0a62b39a4107c63f4eaa2455b1dcb5/py_aws_lambda_toolkit-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "47d197462ceeb284d19619aca12f44a040f525bff1cb8db06e7137784ad1de31",
"md5": "f53a4b28f2717000c85e042fa4bd2350",
"sha256": "2e315621632867097ed0a139da07f6106919f86dcded6e8a402cdf627f281248"
},
"downloads": -1,
"filename": "py-aws-lambda-toolkit-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "f53a4b28f2717000c85e042fa4bd2350",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11868,
"upload_time": "2023-07-25T21:55:48",
"upload_time_iso_8601": "2023-07-25T21:55:48.046284Z",
"url": "https://files.pythonhosted.org/packages/47/d1/97462ceeb284d19619aca12f44a040f525bff1cb8db06e7137784ad1de31/py-aws-lambda-toolkit-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-25 21:55:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "0riion",
"github_project": "py-aws-lambda-toolkit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "py-aws-lambda-toolkit"
}