{"id":19146425,"url":"https://github.com/kushagraindurkhya/dynacache","last_synced_at":"2026-05-14T21:32:53.873Z","repository":{"id":203970489,"uuid":"695427901","full_name":"KushagraIndurkhya/DynaCache","owner":"KushagraIndurkhya","description":" Effortlessly cache function responses in DynamoDB for lightning-fast, efficient data retrieval","archived":false,"fork":false,"pushed_at":"2023-10-16T14:41:22.000Z","size":11,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T17:37:25.388Z","etag":null,"topics":["aws","cache","cache-library","cloud","dynamodb","lambda","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/DynaCache/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KushagraIndurkhya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-23T06:33:51.000Z","updated_at":"2023-10-27T20:04:46.000Z","dependencies_parsed_at":"2023-12-31T11:50:55.074Z","dependency_job_id":null,"html_url":"https://github.com/KushagraIndurkhya/DynaCache","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"a8ae3fb00e67db162fdf895be7395a17fe29daa0"},"previous_names":["kushagraindurkhya/dynacache"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KushagraIndurkhya/DynaCache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KushagraIndurkhya%2FDynaCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KushagraIndurkhya%2FDynaCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KushagraIndurkhya%2FDynaCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KushagraIndurkhya%2FDynaCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KushagraIndurkhya","download_url":"https://codeload.github.com/KushagraIndurkhya/DynaCache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KushagraIndurkhya%2FDynaCache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cache","cache-library","cloud","dynamodb","lambda","python"],"created_at":"2024-11-09T07:44:06.046Z","updated_at":"2026-05-14T21:32:53.854Z","avatar_url":"https://github.com/KushagraIndurkhya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DynaCache\n\nDynaCache is a Python library that simplifies caching data in Amazon DynamoDB, a managed NoSQL database service provided by AWS.\n\nWith DynaCache, you can easily store and retrieve function results as a way to optimize your applications and reduce latency by caching frequently requested data. This library is particularly useful for scenarios where you want to speed up repetitive or computationally expensive operations by storing their results in DynamoDB for quick retrieval.\n\n## Features\n\n- **DynamoDB Integration**: DynaCache seamlessly integrates with AWS DynamoDB, a highly available and scalable NoSQL database service.\n- **Automatic TTL Management**: It manages Time-To-Live (TTL) for cached data, ensuring that stale data is automatically removed from the cache.\n- **Customizable**: You can specify your own Time-To-Live (TTL) for cached items, or use the default value of 1 hour.\n- **Class Function Support**: You can cache the results of class functions, including static and class methods.\n- **Serialization**: The library uses serialization to cache function results and deserialize them when retrieving cached data.\n- **Easy Configuration**: You can configure DynaCache through a YAML configuration file or directly provide AWS credentials and region.\n\n## Installation\n\nYou can install DynaCache using `pip`:\n\n```bash\npip install dynacache\n```\n\n## Usage\nBelow is some sample code using DynaCache:\n\n```python\nfrom dynacache import DynamoDBCache\n\n# Initialize DynamoDBCache\ncache = DynamoDBCache(\n    cache_table_name=\"MyCacheTable\",\n    aws_region=\"us-east-1\",\n    aws_access_key_id=\"your-access-key\",\n    aws_secret_access_key=\"your-secret-key\"\n)\n\n# Define a function you want to cache\n@cache.cache_response(ttl_seconds=3600)  # Cache results for 1 hour\ndef expensive_function(x, y):\n    # Your expensive computation here\n    return x + y\n\n# Call the cached function\nresult = expensive_function(3, 4)  # The result is cached for subsequent calls\n\n```\n\n### Configuration\nYou can configure DynaCache by providing AWS credentials and region directly, or by using a configuration file. Here's how to set up the configuration file:\n\n```yaml\n# config.yaml\naws_region: us-east-1\naws_access_key_id: your-access-key\naws_secret_access_key: your-secret-key\n```\nThen, you can initialize DynamoDBCache using this configuration file:\n\n```python\ncache = DynamoDBCache(cache_table_name=\"MyCacheTable\", config_file=\"config.yaml\")\n\n```\n\n### Default boto setup\n\nIf no AWS credentials are provided, DynaCache will try to use the default credential chain provided by boto3. This means it will look for credentials in the environment variables, shared credentials file, EC2 IAM role etc. For more information, see [Boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#credentials).\n\n## License\nDynaCache is released under the MIT license.\nSee LICENSE for more details.\n\n## Contributing\nThis project is a basic implementation of a caching library for DynamoDB, and is open source. Feel free to submit issues or pull requests to improve it.\n\nContributions are welcome! Please submit a pull request with your changes. When doing so, please follow the existing code style and conventions. And add/update tests for any new functionality.\n\nTo contribute:\n1. Fork the repository\n2. Create a new branch for your changes:\n```bash\ngit checkout -b your-branch-name\n```\n3. Make and test your changes\n4. Add new features and tests\n\nDisclaimer: DynaCache is not an official product or library provided by AWS. It is a third-party library developed to simplify the process of caching data in AWS DynamoDB.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkushagraindurkhya%2Fdynacache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkushagraindurkhya%2Fdynacache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkushagraindurkhya%2Fdynacache/lists"}