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
- Host: GitHub
- URL: https://github.com/azure-samples/cosmos-db-apache-cassandra-python-samples
- Owner: Azure-Samples
- License: mit
- Created: 2023-09-14T18:00:30.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T19:35:41.000Z (almost 3 years ago)
- Last Synced: 2025-03-14T07:45:54.942Z (over 1 year ago)
- Topics: apache-cassandra, azure, cosmos-db, python
- Language: Python
- Homepage: https://learn.microsoft.com/azure/cosmos-db/cassandra/manage-data-python
- Size: 14.6 KB
- Stars: 0
- Watchers: 22
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Azure Cosmos DB for Apache Cassandra client library samples for Python
[](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.
[](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
```