Kinghorn
Python 3 library for caching AWS resources
Purpose
This library provides caching of AWS resources, which can save development time and money making API calls, as well as reduce the chances of errors taking place from running scripts against resources in flux. I use it to cache resources such as EC2 instances, volumes, and snapshots for retrieval in later scripts. I disliked having to call an API and perform an O(n^2) operation to unwrap my instance metadata every time I did something with boto3. With Kinghorn I can easily place resources in dictionaries for constant time access.
Opinions
I've chosen to discard metadata and "unwrap" entity metadata for storage. I've used clients instead of resources for Kinghorn to make it easy to alter the library to access low level API functions if needed. The library expects appropriate credentials in ~/.aws/credentials.
Installation instructions for Mac OS X
- ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
- brew install python
- curl -O http://python-distribute.org/distribute_setup.py
- python distribute_setup.py
- curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
- python get-pip.py
- pip3 install boto3
- python3 -m kinghorn
Publishing
- Bump version in
setup.pyandkinghorn/__init.py__and run ./publish.sh
Configuration
Configuration is handled with environment variables, as follows:
- KINGHORN_ENVIRONMENT - Which environment your API credentials are for, for example factory, production, etc.
- KINGHORN_LOGGING_OUT - Set to 1 to log to std out, useful for local testing and debugging
- KINGHORN_LOGGING_LEVEL
- KINGHORN_LOGGING_FILE
- KINGHORN_CACHE_LOCATION
Files
publish.sh- Helper script to publish to PyPIsetup.py- Metadata for publishing packages.gitignore- Files to ignore for gitkinghorn/__main__.py- Basic validation script for modulekinghorn/__init__.py- Exports all public functionskinghorn/kinghorn.py- The librarykinghorn/test_kinghorn.py- An example file describing some ways to use the library and testing all functions
Future feature ideas
- Additional entities for different services in AWS as I need them
- Automated configurable cache expiration
- Passthrough to the AWS API on cache miss
Metadata
Release files for kinghorn 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kinghorn-0.0.7.tar.gz | 4.7 kB | Without provenance | Details for kinghorn-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kinghorn-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for kinghorn-0.0.7-py3-none-any.whl |
Total release size: 11.0 kB
Release files / kinghorn-0.0.7.tar.gz
| Download URL | kinghorn-0.0.7.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f95d5ec2ba8729916c2205b11df0daadd82eeefd209a6ef55bbd705bd0dbdcc
|
|
BLAKE2b-256 checksum How to use checksums |
79e5251561b82d7852785263bc8899aca1eea9e91a169904c68f26dcb535843c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / kinghorn-0.0.7-py3-none-any.whl
| Download URL | kinghorn-0.0.7-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbe400dad4dab137d305eae440458ed12e5620c624b94ac9ac1e089704d9947a
|
|
BLAKE2b-256 checksum How to use checksums |
759a10d1c332631aaabff98a2408b338ed691d029c73fb0168f24ef9bcd57044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for kinghorn 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.