An open API service indexing awesome lists of open source software.

https://github.com/azure-samples/cosmos-db-apache-cassandra-python-samples

Sample Python applications for Azure Cosmos DB for Apache Cassandra
https://github.com/azure-samples/cosmos-db-apache-cassandra-python-samples

apache-cassandra azure cosmos-db python

Last synced: 4 months ago
JSON representation

Sample Python applications for Azure Cosmos DB for Apache Cassandra

Awesome Lists containing this project

README

          

# Azure Cosmos DB for Apache Cassandra client library samples for Python

[![Validate Python projects](https://github.com/Azure-Samples/cosmos-db-apache-cassandra-python-samples/actions/workflows/validate.yml/badge.svg)](https://github.com/Azure-Samples/cosmos-db-apache-cassandra-python-samples/actions/workflows/validate.yml)

## Getting started

This repo has a [devcontainer](https://containers.dev) environment making it easy to get started.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/cosmos-db-apache-cassandra-python-samples?quickstart=1)

### Run the app

Configure your Azure Cosmos DB credentials as environment variables.

```bash
export COSMOS_ENDPOINT=""
export COSMOS_KEY=""
```

> **💡 TIP**: If you don't have an Azure Cosmos DB account, [create a free account](https://cosmos.azure.com/try/).

Run the quickstart sample app using the [`cassandra-driver`](https://pypi.org/project/cassandra-driver/) package from PyPI.

```bash
pip install cassandra-driver
python 001-quickstart/app.py
```

### Validate any changes you make

If you change the code, run the linter and code formatter.

```bash
pip install flake8
flake8 --verbose 001-quickstart/app.py
```

```bash
pip install black
black --verbose 001-quickstart/app.py
```