{"id":27370145,"url":"https://github.com/datastaxdevs/astrapy","last_synced_at":"2025-04-13T08:48:07.389Z","repository":{"id":198337554,"uuid":"700615840","full_name":"datastaxdevs/astrapy","owner":"datastaxdevs","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-12T21:33:47.000Z","size":273,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-11-08T05:57:42.336Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datastaxdevs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-05T00:12:28.000Z","updated_at":"2023-10-13T21:15:10.000Z","dependencies_parsed_at":"2023-10-13T15:24:25.241Z","dependency_job_id":"4b50d6ff-bb32-437e-b9cb-bdbf23537fe9","html_url":"https://github.com/datastaxdevs/astrapy","commit_stats":null,"previous_names":["synedra/astrapy"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fastrapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fastrapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fastrapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fastrapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datastaxdevs","download_url":"https://codeload.github.com/datastaxdevs/astrapy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688190,"owners_count":21145762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-13T08:48:06.870Z","updated_at":"2025-04-13T08:48:07.377Z","avatar_url":"https://github.com/datastaxdevs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## AstraPy\n\n[![Actions Status](https://github.com/datastax/astrapy/workflows/Tests/badge.svg)](https://github.com/datastax/astrapy/actions)\n\nAstraPy is a Pythonic SDK for [DataStax Astra](https://astra.datastax.com) and [Stargate](https://stargate.io/)\n\n### Resources\n\n- [DataStax Astra](https://astra.datastax.com)\n- [Stargate](https://stargate.io/)\n\n### Getting Started\n\nInstall AstraPy\n\n```shell\npip install astrapy\n```\n\nSetup your Astra client\n\nCreate a .env file with the appropriate values, or use the 'astra' cli to do the same.\n\n```bash\nASTRA_DB_KEYSPACE=\"\u003ckeyspace\u003e\"\nASTRA_DB_APPLICATION_TOKEN=\"\u003cAstraCS:...\u003e\"\nASTRA_DB_REGION=\"\u003cregion\u003e\"\nASTRA_DB_ID=\u003cdb_id\u003e\n```\n\nLoad the variables in and then create the client. This collections client can make non-vector and vector calls, depending on the call configuration.\n\n```python\nfrom astrapy.collections import AstraCollectionClient\nfrom astrapy.base import AstraClient\n\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nASTRA_DB_ID = os.environ.get(\"ASTRA_DB_ID\")\nASTRA_DB_REGION = os.environ.get(\"ASTRA_DB_REGION\")\nASTRA_DB_APPLICATION_TOKEN = os.environ.get(\"ASTRA_DB_APPLICATION_TOKEN\")\nASTRA_DB_KEYSPACE = os.environ.get(\"ASTRA_DB_KEYSPACE\")\nTEST_COLLECTION_NAME = \"test_collection\"\n\nastra_client = AstraClient(\n        astra_database_id=ASTRA_DB_ID,\n        astra_database_region=ASTRA_DB_REGION,\n        astra_application_token=ASTRA_DB_APPLICATION_TOKEN,\n    )\n\nvector_client = AstraVectorClient(astra_client=astra_client)\ntest_namespace = vector_client.namespace(ASTRA_DB_KEYSPACE)\ntest_collection = vector_client.namespace(ASTRA_DB_KEYSPACE).collection(TEST_COLLECTION_NAME)\n```\n\n####Getting started\nCheck out the [notebook](https://colab.research.google.com/github/synedra/astra_vector_examples/blob/main/notebook/vector.ipynb#scrollTo=f04a1806) which has examples for finding and inserting information into the database, including vector commands.\n\nTake a look at the [vector tests](https://github.com/datastax/astrapy/blob/master/tests/astrapy/test_collections.py) and the [collection tests](https://github.com/datastax/astrapy/blob/master/tests/astrapy/test_collections.py) for specific endpoint examples.\n\n#### Using the Ops Client\n\nYou can use the Ops client to work the with Astra DevOps API. Check the [devops tests](https://github.com/datastax/astrapy/blob/master/tests/astrapy/test_devops.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastaxdevs%2Fastrapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatastaxdevs%2Fastrapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastaxdevs%2Fastrapy/lists"}