Metadata-Version: 2.1
Name: detacache
Version: 0.1.0
Summary: Async and Sync Function Decorator to cache function call's to Deta base
Home-page: https://github.com/vidyasagar1432/detacache
Author: vidya sagar
Author-email: svidya051@gmail.com
License: MIT
Description: # [DetaCache](https://github.com/vidyasagar1432/detacache)
        
        #### Async and Sync Function Decorator to cache function call's to Deta base.
        
        ## Installing
        
        ```bash
        pip3 install detacache
        ```
        
        ## Async and Sync Decorator to cache function
        ```python
        import asyncio
        import aiohttp
        import requests
        
        from DetaCache import detaCache
        
        app = detaCache('projectKey')
        
        
        @app.cache(expire=30)
        async def asyncgetjSON(url:str):
            async with aiohttp.ClientSession() as session:
                async with session.get(url) as response:
                    return await response.json()
        
        @app.cache(expire=30)
        def syncgetjSON(url:str):
            return requests.get(url).json()
        
        async def main():
            asyncdata = await asyncgetjSON('https://httpbin.org/json')
            print(asyncdata)
            syncdata = syncgetjSON('https://httpbin.org/json')
            print(syncdata)
        
        loop = asyncio.get_event_loop()
        loop.run_until_complete(main())
        ```
        
        ## License
        
        MIT License
        
        Copyright (c) 2021 [Vidya Sagar](https://github.com/vidyasagar1432)
Keywords: deta,cache,asyncio,deta base cache,cache api call,cache functions,cache requests
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
