diff --git a/README.md b/README.md index 3935a4b..c6f77bd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# makpar-innolab +# makpar-innovation-laboratory -## qldb-orm +## innoldb A simple [Object-Relation-Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) for a serverless [AWS Quantum Ledger Database](https://docs.aws.amazon.com/qldb/latest/developerguide/what-is.html) backend, and a command line utility for querying tables on those ledgers. @@ -14,7 +14,7 @@ The idea behind the *ORM* is to map document fields to native Python object attr **CRUD OPERATIONS** ```python -from qldb-orm.qldb import Document +from innoldb.qldb import Document # Create a document on `my_table` table. document = Document('my_table') @@ -27,7 +27,7 @@ document.save() ``` ```python -from qldb-orm.qldb import Document +from innoldb.qldb import Document # Load a document from `my_table` table. document = Document('my_table', id="123456") @@ -37,7 +37,7 @@ for val in document.field.nested_data.array: **Queries** ```python -from qldb-orm.qldb import Query +from innoldb.qldb import Query query = Query('my-table').find_by(field_name='field value') for document in query: @@ -48,18 +48,18 @@ for document in query: **CRUD Operations** ```shell -qldb-orm --table your-table --insert col1=val1 col2=val2 ... -qldb-orm --table your-table --id 123 --update col1=newval1 col2=newval2 +innoldb --table your-table --insert col1=val1 col2=val2 ... +innoldb --table your-table --id 123 --update col1=newval1 col2=newval2 ``` **Queries** ```shell -qldb-orm --table your-table --find column=this +innoldb --table your-table --find column=this ``` ### Read The Docs -- [innolqb documentation](https://makpar-innovation-laboratory.github.io/qldb-orm/) +- [innoldb documentation](https://makpar-innovation-laboratory.github.io/innoldb/) ### Code Quality diff --git a/scripts/distribute b/scripts/distribute old mode 100644 new mode 100755 diff --git a/scripts/install b/scripts/install old mode 100644 new mode 100755 diff --git a/scripts/test b/scripts/test old mode 100644 new mode 100755 diff --git a/setup.cfg b/setup.cfg index 75c5f93..22ff5db 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ include_package_data = True [options.entry_points] console_scripts = - qldb-orm = qldb-orm.main:entrypoint + innoldb = innoldb.main:entrypoint [options.packages.find] -where=src \ No newline at end of file +where=src diff --git a/src/qldb_orm.egg-info/PKG-INFO b/src/qldb_orm.egg-info/PKG-INFO new file mode 100644 index 0000000..4310b00 --- /dev/null +++ b/src/qldb_orm.egg-info/PKG-INFO @@ -0,0 +1,85 @@ +Metadata-Version: 2.1 +Name: qldb-orm +Version: 1.0.14 +Summary: a ORM model for AWS QLDB +Home-page: https://innolab-coverage.makpar-innovation.net +Author: Makpar Innovation Lab +Author-email: gmoore@makpar.com +License: GNU GPL v3 +Project-URL: Documentation, https://makpar-innovation-laboratory.github.io/qldb-orm/ +Project-URL: Source, https://github.com/Makpar-Innovation-Laboratory/qldb-orm +Keywords: aws,qldb,quantum-ledger-database,orm +Platform: any +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE + +# makpar-innolab + +## qldb-orm + +A simple [Object-Relation-Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) for a serverless [AWS Quantum Ledger Database](https://docs.aws.amazon.com/qldb/latest/developerguide/what-is.html) backend, and a command line utility for querying tables on those ledgers. + +**NOTE**: The user or process using this library must have an [IAM policy that allows access to QLDB](https://docs.aws.amazon.com/qldb/latest/developerguide/security-iam.html). + + +### ORM + +The idea behind the *ORM* is to map document fields to native Python object attributes, so that document values can be accessed by traversing the object property tree. + +**CRUD OPERATIONS** + +```python +from qldb-orm.qldb import Document + +# Create a document on `my_table` table. +document = Document('my_table') +document.field = { + 'nested_data': { + 'array': ['colllection', 'of', 'things'] + } +} +document.save() +``` + +```python +from qldb-orm.qldb import Document + +# Load a document from `my_table` table. +document = Document('my_table', id="123456") +for val in document.field.nested_data.array: + print(val) +``` + +**Queries** +```python +from qldb-orm.qldb import Query + +query = Query('my-table').find_by(field_name='field value') +for document in query: + print(f'Document({document.id}).field_name = {document.field_name}') +``` + +### CLI + +**CRUD Operations** +```shell +qldb-orm --table your-table --insert col1=val1 col2=val2 ... +qldb-orm --table your-table --id 123 --update col1=newval1 col2=newval2 +``` + +**Queries** +```shell +qldb-orm --table your-table --find column=this +``` + +### Read The Docs + +- [innolqb documentation](https://makpar-innovation-laboratory.github.io/qldb-orm/) + +### Code Quality + +[![DeepSource](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm.svg/?label=active+issues&show_trend=true&token=0yUpU0SKBmqEg7qNHU2C65C6)](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm/?ref=repository-badge) +[![DeepSource](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm.svg/?label=resolved+issues&show_trend=true&token=0yUpU0SKBmqEg7qNHU2C65C6)](https://deepsource.io/gh/Makpar-Innovation-Laboratory/qldb-orm/?ref=repository-badge) + + diff --git a/src/qldb_orm.egg-info/dependency_links.txt b/src/qldb_orm.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/qldb_orm.egg-info/dependency_links.txt @@ -0,0 +1 @@ +