{"id":13937257,"url":"https://github.com/vmware-archive/py-gemfire-rest","last_synced_at":"2025-07-19T23:31:18.980Z","repository":{"id":18082724,"uuid":"21146594","full_name":"vmware-archive/py-gemfire-rest","owner":"vmware-archive","description":"Python client for Gemfire's REST service.","archived":true,"fork":false,"pushed_at":"2017-10-19T08:46:18.000Z","size":110,"stargazers_count":38,"open_issues_count":3,"forks_count":12,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-05-14T02:48:05.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/vmware-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-24T00:09:21.000Z","updated_at":"2024-11-28T16:29:33.000Z","dependencies_parsed_at":"2022-09-26T21:40:57.177Z","dependency_job_id":null,"html_url":"https://github.com/vmware-archive/py-gemfire-rest","commit_stats":null,"previous_names":["gemfire/py-gemfire-rest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vmware-archive/py-gemfire-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fpy-gemfire-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fpy-gemfire-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fpy-gemfire-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fpy-gemfire-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware-archive","download_url":"https://codeload.github.com/vmware-archive/py-gemfire-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fpy-gemfire-rest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266041690,"owners_count":23867944,"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":"2024-08-07T23:03:26.320Z","updated_at":"2025-07-19T23:31:18.764Z","avatar_url":"https://github.com/vmware-archive.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# py-gemfire-rest\n=================\n\nThis library enables your python applications to use GemFire as a datastore. (GemFire is a distributed key-value store. A short tutorial can be found at http://goo.gl/rF93fn). This library exposes Spring's CrudRepository like methods in an effort to simplify GemFire's APIs while still giving access to advanced GemFire features (details below). \n\n## Installation\n---------------\n\nUsing pip installation is simple\n```\n    $ sudo pip install gemfire-rest\n```\nor from source:\n```\n    $ sudo python setup.py install\n```\n## Quick Start\n--------------\n\n1. Start the GemFire REST service by [following the instructions](http://gemfire.docs.pivotal.io/docs-gemfire/latest/rest_apps/setup_config.html)\n2. Create a Region on the server (Region is a distributed ConcurrentMap in which GemFire stores the data). \n```\n    gfsh\u003ecreate region --name=orders --type=PARTITION\n```\n3. \n```python\n    \u003e\u003e\u003e from gemfire import *\n    \u003e\u003e\u003e client = GemfireClient.GemfireClient(hostname=\"localhost\", port=8080)\n    \u003e\u003e\u003e myRepo = client.create_repository(\"orders\")\n    \u003e\u003e\u003e myRepo.save(order)\n```\n\nwhere the order object has an \"id\" instance variable. The library handles converting the object to/from json. \n\n## API Reference\n----------------\n\nThis library exercises [GemFire's REST APIs](http://gemfire.docs.pivotal.io/docs-gemfire/latest/rest_apps/book_intro.html) for enabling your python application to use GemFire as its datastore. To get started, we create a client by providing a hostname and port for an already running endpoint. \n```python\n    client = GemfireClient(hostname=\"localhost\", port=8080, user=\"gfadmin\", password=\"password\")\n```\n\nFor each type of Object that we want to store in GemFire, we create a repository (Please not that you will have to create a Region on the server with the same name as the repository).\n```python\n    orders = client.create_repository(\"orders\")\n```\nThe client provides a method to look up all the Regions that have been created on the server already:\n```python\n    client.list_all_regions()\n```\n\nGemfireClient also has methods for querying and function execution which we will see later.\n\n### Repository\n--------------\n\nJust like Spring's CrudRepository interface, the following methods are available on the Repository\n```python\n    save(entities)   #saves one or more entities in GemFire\n    find(ids)        #finds entities with the given ids\n    find_all()       #returns all data in region\n    exists(id)       #checks to see if an entity with the given id exists\n    delete(entities) #deletes the given entities from GemFire\n    delete_all()     #deletes all data in the GemFire region\n```\n\nAs the naming suggests, intention of these methods is pretty clear. One thing that needs to be highlighted here is that all entities need an identity; this library uses \"id\" instance variable as identity. So all entities that are stored in GemFire need to have an instance variable named \"id\".\n\n### Region\n----------\n\nFor advanced operations, we also provide access to Region, which defines the following methods:\n```python\n    create(key, value)  #will insert only if key does not exists\n    update(key, value)  #will update only if the key exists\n    keys()              # returns all keys in the region\n    compare_and_set(key, oldvalue, newvalue) #sets the key to newvalue only if current value is equal ot oldvalue\n```\n\n### Querying\n------------\nGemfireClient provides API for running ad-hoc [OQL queries](http://gemfire.docs.pivotal.io/docs-gemfire/latest/developing/querying_basics/chapter_overview.html) on the server.\n```python\n    adhoc_query(query_string)  #OQL query string\n```\n\nFor faster performance, you will want to run prepared OQL queries. GemfireClient provides the following APIs for this:\n```python\n    new_query(query_id, query_string) #registers and prepares the OQL query on the server\n    run_query(query_id, query_args)   #runs the query with specified parameters \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fpy-gemfire-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware-archive%2Fpy-gemfire-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fpy-gemfire-rest/lists"}