coherence-client


Namecoherence-client JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/oracle/coherence-py-client
SummaryThe Coherence Python Client allows Python applications to act as cache clients to a Coherence Cluster using Google's gRPC framework as the network transport.
upload_time2024-06-01 00:10:23
maintainerNone
docs_urlNone
authorOracle
requires_python<4.0,>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Coherence Python Client

![CI/CD](https://github.com/oracle/coherence-py-client/actions/workflows/validate.yml/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=oracle_coherence-py-client&metric=alert_status)](https://sonarcloud.io/project/overview?id=oracle_coherence-py-client)
[![License](http://img.shields.io/badge/license-UPL%201.0-blue.svg)](https://oss.oracle.com/licenses/upl/)

<img src=https://oracle.github.io/coherence/assets/images/logo-red.png width="30%"><img>

The Coherence Python Client allows Python applications to act as cache clients to an Oracle Coherence cluster using gRPC as the network transport.

#### Features
* Familiar Map-like interface for manipulating cache entries including but not limited to:
    * `put`, `put_if_absent`, `put_all`, `get`, `get_all`, `remove`, `clear`, `get_or_default`, `replace`, `replace_mapping`, `size`, `is_empty`, `contains_key`, `contains_value`
* Cluster-side querying, aggregation and filtering of map entries
* Cluster-side manipulation of map entries using EntryProcessors
* Registration of listeners to be notified of:
    * mutations such as insert, update and delete on Maps
    * map lifecycle events such as truncated, released or destroyed
    * session lifecycle events such as connected, disconnected, reconnected and closed
* Support for storing Python objects as JSON as well as the ability to serialize to Java objects on the server for access from other Coherence language API's

#### Requirements
* [Coherence CE](https://github.com/oracle/coherence) 22.06.4+ or Coherence 14.1.1.2206.4+ Commercial edition with a configured [gRPCProxy](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.2206/develop-remote-clients/using-coherence-grpc-server.html).
* Python 3.8.x


#### Starting a Coherence Cluster

Before testing the Python client, you must ensure a Coherence cluster is available.
For local development, we recommend using the Coherence CE Docker image; it contains
everything necessary for the client to operate correctly.

```bash
docker run -d -p 1408:1408 ghcr.io/oracle/coherence-ce:24.03
```

## Installation

```bash
python3 -m pip install coherence-client
```

## Documentation

[https://oracle.github.io/coherence-py-client/](https://oracle.github.io/coherence-py-client/)

## Examples

The following example connects to a Coherence cluster running gRPC Proxy on default
port of 1408, creates a new `NamedCache` with key `str` and value of a `str|int` and
issues `put()`, `get()`, `size()` and `remove` operations.

```python
from coherence import NamedCache, Session
import asyncio
from typing import Union


async def run_test():

    # create a new Session to the Coherence server
    session: Session = await Session.create()

    # create a new NamedCache with key of string|int and value of string|int
    cache: NamedCache[str, Union[str,int]] = await session.get_cache("test")

    # put a new key/value
    k: str = "one"
    v: str = "only-one"
    await cache.put(k, v)

    # get the value for a key in the cache
    r = await cache.get(k)

    # print the value got for a key in the cache
    print("The value of key \"one\" is " + r)

    k1: str = "two"
    v1: int = 2
    await cache.put(k1, v1)
    r = await cache.get(k1)
    print("The value of key \"two\" is " + str(r))

    # print the size of the cache
    print("Size of the cache test is " + str(await cache.size()))

    # remove an entry from the cache
    await cache.remove(k1)


# run the test
asyncio.run(run_test())
```
## Help

We have a **public Slack channel** where you can get in touch with us to ask questions about using the Coherence Python Client
or give us feedback or suggestions about what features and improvements you would like to see. We would love
to hear from you. To join our channel,
please [visit this site to get an invitation](https://join.slack.com/t/oraclecoherence/shared_invite/enQtNzcxNTQwMTAzNjE4LTJkZWI5ZDkzNGEzOTllZDgwZDU3NGM2YjY5YWYwMzM3ODdkNTU2NmNmNDFhOWIxMDZlNjg2MzE3NmMxZWMxMWE).
The invitation email will include details of how to access our Slack
workspace.  After you are logged in, please come to `#coherence` and say, "hello!"

If you would like to raise an issue please see [here](https://github.com/oracle/coherence-py-client/issues/new/choose).

## Contributing

This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)

## Security

Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process

## License

Copyright (c) 2023, 2024, Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at
<https://oss.oracle.com/licenses/upl/>.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oracle/coherence-py-client",
    "name": "coherence-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Oracle",
    "author_email": "dhiru.pandey@oracle.com",
    "download_url": "https://files.pythonhosted.org/packages/a4/ca/6816491f560af11fe412ca1a143ba6acecbe455fbfff06b7f094a24afce2/coherence_client-1.1.1.tar.gz",
    "platform": null,
    "description": "# Coherence Python Client\n\n![CI/CD](https://github.com/oracle/coherence-py-client/actions/workflows/validate.yml/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=oracle_coherence-py-client&metric=alert_status)](https://sonarcloud.io/project/overview?id=oracle_coherence-py-client)\n[![License](http://img.shields.io/badge/license-UPL%201.0-blue.svg)](https://oss.oracle.com/licenses/upl/)\n\n<img src=https://oracle.github.io/coherence/assets/images/logo-red.png width=\"30%\"><img>\n\nThe Coherence Python Client allows Python applications to act as cache clients to an Oracle Coherence cluster using gRPC as the network transport.\n\n#### Features\n* Familiar Map-like interface for manipulating cache entries including but not limited to:\n    * `put`, `put_if_absent`, `put_all`, `get`, `get_all`, `remove`, `clear`, `get_or_default`, `replace`, `replace_mapping`, `size`, `is_empty`, `contains_key`, `contains_value`\n* Cluster-side querying, aggregation and filtering of map entries\n* Cluster-side manipulation of map entries using EntryProcessors\n* Registration of listeners to be notified of:\n    * mutations such as insert, update and delete on Maps\n    * map lifecycle events such as truncated, released or destroyed\n    * session lifecycle events such as connected, disconnected, reconnected and closed\n* Support for storing Python objects as JSON as well as the ability to serialize to Java objects on the server for access from other Coherence language API's\n\n#### Requirements\n* [Coherence CE](https://github.com/oracle/coherence) 22.06.4+ or Coherence 14.1.1.2206.4+ Commercial edition with a configured [gRPCProxy](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.2206/develop-remote-clients/using-coherence-grpc-server.html).\n* Python 3.8.x\n\n\n#### Starting a Coherence Cluster\n\nBefore testing the Python client, you must ensure a Coherence cluster is available.\nFor local development, we recommend using the Coherence CE Docker image; it contains\neverything necessary for the client to operate correctly.\n\n```bash\ndocker run -d -p 1408:1408 ghcr.io/oracle/coherence-ce:24.03\n```\n\n## Installation\n\n```bash\npython3 -m pip install coherence-client\n```\n\n## Documentation\n\n[https://oracle.github.io/coherence-py-client/](https://oracle.github.io/coherence-py-client/)\n\n## Examples\n\nThe following example connects to a Coherence cluster running gRPC Proxy on default\nport of 1408, creates a new `NamedCache` with key `str` and value of a `str|int` and\nissues `put()`, `get()`, `size()` and `remove` operations.\n\n```python\nfrom coherence import NamedCache, Session\nimport asyncio\nfrom typing import Union\n\n\nasync def run_test():\n\n    # create a new Session to the Coherence server\n    session: Session = await Session.create()\n\n    # create a new NamedCache with key of string|int and value of string|int\n    cache: NamedCache[str, Union[str,int]] = await session.get_cache(\"test\")\n\n    # put a new key/value\n    k: str = \"one\"\n    v: str = \"only-one\"\n    await cache.put(k, v)\n\n    # get the value for a key in the cache\n    r = await cache.get(k)\n\n    # print the value got for a key in the cache\n    print(\"The value of key \\\"one\\\" is \" + r)\n\n    k1: str = \"two\"\n    v1: int = 2\n    await cache.put(k1, v1)\n    r = await cache.get(k1)\n    print(\"The value of key \\\"two\\\" is \" + str(r))\n\n    # print the size of the cache\n    print(\"Size of the cache test is \" + str(await cache.size()))\n\n    # remove an entry from the cache\n    await cache.remove(k1)\n\n\n# run the test\nasyncio.run(run_test())\n```\n## Help\n\nWe have a **public Slack channel** where you can get in touch with us to ask questions about using the Coherence Python Client\nor give us feedback or suggestions about what features and improvements you would like to see. We would love\nto hear from you. To join our channel,\nplease [visit this site to get an invitation](https://join.slack.com/t/oraclecoherence/shared_invite/enQtNzcxNTQwMTAzNjE4LTJkZWI5ZDkzNGEzOTllZDgwZDU3NGM2YjY5YWYwMzM3ODdkNTU2NmNmNDFhOWIxMDZlNjg2MzE3NmMxZWMxMWE).\nThe invitation email will include details of how to access our Slack\nworkspace.  After you are logged in, please come to `#coherence` and say, \"hello!\"\n\nIf you would like to raise an issue please see [here](https://github.com/oracle/coherence-py-client/issues/new/choose).\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process\n\n## License\n\nCopyright (c) 2023, 2024, Oracle and/or its affiliates.\n\nReleased under the Universal Permissive License v1.0 as shown at\n<https://oss.oracle.com/licenses/upl/>.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Coherence Python Client allows Python applications to act as cache clients to a Coherence Cluster using Google's gRPC framework as the network transport.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/oracle/coherence-py-client",
        "Repository": "https://github.com/oracle/coherence-py-client"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d828111ccb7e0919d9652964580f0587c0e2860dfd7a74cc2ed9183d3ed2a77",
                "md5": "6b3fed2931ca1c9392d68cffe4d3396d",
                "sha256": "5e0cc7b4fc8598675ad0d2a17c3d005e4ef5fe2bc3b3a94c7daea17a9feb1f6e"
            },
            "downloads": -1,
            "filename": "coherence_client-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b3fed2931ca1c9392d68cffe4d3396d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 60031,
            "upload_time": "2024-06-01T00:10:22",
            "upload_time_iso_8601": "2024-06-01T00:10:22.042981Z",
            "url": "https://files.pythonhosted.org/packages/6d/82/8111ccb7e0919d9652964580f0587c0e2860dfd7a74cc2ed9183d3ed2a77/coherence_client-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4ca6816491f560af11fe412ca1a143ba6acecbe455fbfff06b7f094a24afce2",
                "md5": "7edb2c178298e233133e168c4c23697f",
                "sha256": "5224cca1f5dccc805c7d448504063d8ff19d60bacbeb659927dc23f82195f8f1"
            },
            "downloads": -1,
            "filename": "coherence_client-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7edb2c178298e233133e168c4c23697f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 57560,
            "upload_time": "2024-06-01T00:10:23",
            "upload_time_iso_8601": "2024-06-01T00:10:23.930445Z",
            "url": "https://files.pythonhosted.org/packages/a4/ca/6816491f560af11fe412ca1a143ba6acecbe455fbfff06b7f094a24afce2/coherence_client-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-01 00:10:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oracle",
    "github_project": "coherence-py-client",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "coherence-client"
}
        
Elapsed time: 0.53128s