|
1 |
| -## My Project |
| 1 | +# AmazonQLDB Python Driver |
2 | 2 |
|
3 |
| -TODO: Fill this README out! |
| 3 | +This is the Python driver for Amazon Quantum Ledger Database (QLDB), which allows Python developers |
| 4 | +to write software that makes use of AmazonQLDB. |
4 | 5 |
|
5 |
| -Be sure to: |
| 6 | +## Requirements |
6 | 7 |
|
7 |
| -* Change the title in this README |
8 |
| -* Edit your repository description on GitHub |
| 8 | +### Basic Configuration |
9 | 9 |
|
10 |
| -## License |
| 10 | +You need to set up your AWS security credentials and config before the driver is able to connect to AWS. |
| 11 | + |
| 12 | +Set up credentials (in e.g. `~/.aws/credentials`): |
| 13 | + |
| 14 | +``` |
| 15 | +[default] |
| 16 | +aws_access_key_id = <your access key id> |
| 17 | +aws_secret_access_key = <your secret key> |
| 18 | +``` |
| 19 | + |
| 20 | +Set up a default region (in e.g. `~/.aws/config`): |
| 21 | + |
| 22 | +``` |
| 23 | +[default] |
| 24 | +region = us-east-1 <or other region> |
| 25 | +``` |
| 26 | + |
| 27 | +See [Accessing Amazon QLDB](https://docs.aws.amazon.com/qldb/latest/developerguide/accessing.html#SettingUp.Q.GetCredentials) page for more information. |
| 28 | + |
| 29 | +### Python 3.x |
| 30 | + |
| 31 | +The driver requires Python 3.x. Please see the link below for more detail to install Python 3.x: |
| 32 | + |
| 33 | +* [Python 3.x Installation](https://www.python.org/downloads/) |
| 34 | + |
| 35 | +## Installing the driver and running the driver |
| 36 | + |
| 37 | +First, install the driver using pip: |
| 38 | + |
| 39 | +```pip install pyqldb``` |
| 40 | + |
| 41 | + |
| 42 | +Then from a Python interpreter, call the driver and specify the ledger name: |
| 43 | + |
| 44 | +```python |
| 45 | +from pyqldb.driver.pooled_qldb_driver import PooledQldbDriver |
| 46 | + |
| 47 | +qldb_driver = PooledQldbDriver(ledger_name='test_ledger') |
| 48 | +qldb_session = qldb_driver.get_session() |
11 | 49 |
|
12 |
| -This project is licensed under the Apache-2.0 License. |
| 50 | +for table in qldb_session.list_tables(): |
| 51 | + print(table) |
| 52 | +``` |
| 53 | + |
| 54 | +## Development |
| 55 | + |
| 56 | +### Getting Started |
| 57 | + |
| 58 | +Assuming that you have Python and `virtualenv` installed, set up your environment and installed the dependencies |
| 59 | +like this instead of the `pip install pyqldb` defined above: |
| 60 | + |
| 61 | +``` |
| 62 | +$ git clone https://github.com/awslabs/amazon-qldb-driver-python |
| 63 | +$ cd driver |
| 64 | +$ virtualenv venv |
| 65 | +... |
| 66 | +$ . venv/bin/activate |
| 67 | +$ pip install -r requirements.txt |
| 68 | +$ pip install -e . |
| 69 | +``` |
| 70 | + |
| 71 | +### Running Tests |
| 72 | + |
| 73 | +You can run the unit tests with this command: |
| 74 | + |
| 75 | +``` |
| 76 | +$ pytest --cov-report term-missing --cov=pyqldb |
| 77 | +``` |
| 78 | + |
| 79 | +The performance tests have a separate README.md within the performance folder. |
| 80 | + |
| 81 | +### Documentation |
| 82 | + |
| 83 | +Sphinx is used for documentation. You can generate HTML locally with the following: |
| 84 | + |
| 85 | +``` |
| 86 | +$ pip install -r requirements-docs.txt |
| 87 | +$ pip install -e . |
| 88 | +$ cd docs |
| 89 | +$ make html |
| 90 | +``` |
| 91 | + |
| 92 | +## Release Notes |
| 93 | + |
| 94 | +### Release 1.0.0-rc.1 (October 28, 2019) |
| 95 | + |
| 96 | +* Initial preview release of the Amazon QLDB Driver for Python. |
| 97 | + |
| 98 | +## License |
13 | 99 |
|
| 100 | +This library is licensed under the Apache 2.0 License. |
0 commit comments