sharingiscaring


Namesharingiscaring JSON
Version 0.4.39 PyPI version JSON
download
home_pagehttps://github.com/sderuiter/sharingiscaring
SummaryShared code for Concordium Explorer (Bot)
upload_time2024-03-12 18:43:14
maintainer
docs_urlNone
authorSander de Ruiter
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sharing is Caring

This repository hosts the shared code used by many of the other repositories in the Concordium Explorer Universe. The only way I knew how to make this work (locally and in Docker containers), is by publishing this repo as a Python package. 

Most important modules in the repo are:
* GRPCClient: this is the partial Python SDK that contains all relevant GRPC types and methods to request information from the GRPC endpoint from a node.
* MongoDB: this module contains the connection to the MongoDB instance (or replicaset).
* Tooter: this module is a light wrapper around [Apprise](https://github.com/caronc/apprise), used to send notifications.
* CIS: this module contains logic to decode CIS-2 events according to the [CIS-2 Specifications](http://proposals.concordium.software/CIS/cis-2.html#cis-2-functions-tokenmetadata). This module is used in token accounting.


## Modules
### GRPCClient
This module is implemented as a partial Python SDK for the GRPC endpoint for a node. As such, it needs to be updated regularly whenever new types and methods are added to the [GRPC Protocol Documentation](http://developer.concordium.software/concordium-grpc-api/). It relies heavily on [BetterProto](https://github.com/danielgtaylor/python-betterproto), however only version 2.0.0b6 seems to work. Hence, run
```
pip install "betterproto[compiler]"==2.0.0b6
```
to install this version.

BetterProto takes the `.proto` files from the [Concordium GRPC Api Repo](https://github.com/Concordium/concordium-grpc-api/tree/main/v2/concordium) and converts this into the neccesary classes. When an update is performed on the Concordium GRPC Api Repo, copy the new files to the same location and run the following command:

```
python -m grpc_tools.protoc -I. --python_out=. --pyi_out=. --grpc_python_out=. --python_betterproto_out=. service.proto
```

This will generate the new `_pb2.py(i)` files.

#### CCD_Types
When I started with this project, I didn't know the first thing about Protobuf. To be honest, I still don't, but I *have* found a way to manage this by creating my own classes, mirroring the classes as generated by the `types.proto` file . These classes are stored in a submodule called `CCD_Types`. This contains 165 classes and 55 type aliases.

#### Queries
The services in the `service.proto` file are mirrored in the `queries` submodule, where all relevant GRPC calls are built. These are the methods that other services call to retrieve specific information from the node. 

For every call to the node, it calls `grpc.channel_ready_future` to check if the service is ready (the node is able to respond to queries). Is this somehow fails, the module tries to connect to a different node (as supplied in the `ENV` variables).


## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

What things you need to install the software and how to install them

```
Give examples
```

### Installing

A step by step series of examples that tell you how to get a development env running

Say what the step will be

```
Give the example
```

And repeat

```
until finished
```

End with an example of getting some data out of the system or using it for a little demo

## Running the tests

Explain how to run the automated tests for this system

### Break down into end to end tests

Explain what these tests test and why

```
Give an example
```

### And coding style tests

Explain what these tests test and why

```
Give an example
```

## Deployment

Add additional notes about how to deploy this on a live system

## Built With

* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
* [Maven](https://maven.apache.org/) - Dependency Management
* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). 

## Authors

* **explorer.ccd** - *Everything* 

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sderuiter/sharingiscaring",
    "name": "sharingiscaring",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sander de Ruiter",
    "author_email": "sdr@concordium-explorer.nl",
    "download_url": "https://files.pythonhosted.org/packages/42/1e/05556f9d80271c895a7f919a0f0fa7de967c986df2b9fc5ed8663084ca3e/sharingiscaring-0.4.39.tar.gz",
    "platform": null,
    "description": "# Sharing is Caring\n\nThis repository hosts the shared code used by many of the other repositories in the Concordium Explorer Universe. The only way I knew how to make this work (locally and in Docker containers), is by publishing this repo as a Python package. \n\nMost important modules in the repo are:\n* GRPCClient: this is the partial Python SDK that contains all relevant GRPC types and methods to request information from the GRPC endpoint from a node.\n* MongoDB: this module contains the connection to the MongoDB instance (or replicaset).\n* Tooter: this module is a light wrapper around [Apprise](https://github.com/caronc/apprise), used to send notifications.\n* CIS: this module contains logic to decode CIS-2 events according to the [CIS-2 Specifications](http://proposals.concordium.software/CIS/cis-2.html#cis-2-functions-tokenmetadata). This module is used in token accounting.\n\n\n## Modules\n### GRPCClient\nThis module is implemented as a partial Python SDK for the GRPC endpoint for a node. As such, it needs to be updated regularly whenever new types and methods are added to the [GRPC Protocol Documentation](http://developer.concordium.software/concordium-grpc-api/). It relies heavily on [BetterProto](https://github.com/danielgtaylor/python-betterproto), however only version 2.0.0b6 seems to work. Hence, run\n```\npip install \"betterproto[compiler]\"==2.0.0b6\n```\nto install this version.\n\nBetterProto takes the `.proto` files from the [Concordium GRPC Api Repo](https://github.com/Concordium/concordium-grpc-api/tree/main/v2/concordium) and converts this into the neccesary classes. When an update is performed on the Concordium GRPC Api Repo, copy the new files to the same location and run the following command:\n\n```\npython -m grpc_tools.protoc -I. --python_out=. --pyi_out=. --grpc_python_out=. --python_betterproto_out=. service.proto\n```\n\nThis will generate the new `_pb2.py(i)` files.\n\n#### CCD_Types\nWhen I started with this project, I didn't know the first thing about Protobuf. To be honest, I still don't, but I *have* found a way to manage this by creating my own classes, mirroring the classes as generated by the `types.proto` file . These classes are stored in a submodule called `CCD_Types`. This contains 165 classes and 55 type aliases.\n\n#### Queries\nThe services in the `service.proto` file are mirrored in the `queries` submodule, where all relevant GRPC calls are built. These are the methods that other services call to retrieve specific information from the node. \n\nFor every call to the node, it calls `grpc.channel_ready_future` to check if the service is ready (the node is able to respond to queries). Is this somehow fails, the module tries to connect to a different node (as supplied in the `ENV` variables).\n\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.\n\n### Prerequisites\n\nWhat things you need to install the software and how to install them\n\n```\nGive examples\n```\n\n### Installing\n\nA step by step series of examples that tell you how to get a development env running\n\nSay what the step will be\n\n```\nGive the example\n```\n\nAnd repeat\n\n```\nuntil finished\n```\n\nEnd with an example of getting some data out of the system or using it for a little demo\n\n## Running the tests\n\nExplain how to run the automated tests for this system\n\n### Break down into end to end tests\n\nExplain what these tests test and why\n\n```\nGive an example\n```\n\n### And coding style tests\n\nExplain what these tests test and why\n\n```\nGive an example\n```\n\n## Deployment\n\nAdd additional notes about how to deploy this on a live system\n\n## Built With\n\n* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used\n* [Maven](https://maven.apache.org/) - Dependency Management\n* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). \n\n## Authors\n\n* **explorer.ccd** - *Everything* \n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Shared code for Concordium Explorer (Bot)",
    "version": "0.4.39",
    "project_urls": {
        "Homepage": "https://github.com/sderuiter/sharingiscaring"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6c81fae24968ec9438c8f27fde42bf81f38dfa68b815b326dd69c09a472ce4c",
                "md5": "245db61bf5f2b30ff3b1fff3d167f107",
                "sha256": "6680b1e3773a82ee79964d7d3ee806188cd3502493b9795cc3035ac00091370e"
            },
            "downloads": -1,
            "filename": "sharingiscaring-0.4.39-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "245db61bf5f2b30ff3b1fff3d167f107",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 329257,
            "upload_time": "2024-03-12T18:43:11",
            "upload_time_iso_8601": "2024-03-12T18:43:11.213614Z",
            "url": "https://files.pythonhosted.org/packages/d6/c8/1fae24968ec9438c8f27fde42bf81f38dfa68b815b326dd69c09a472ce4c/sharingiscaring-0.4.39-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "421e05556f9d80271c895a7f919a0f0fa7de967c986df2b9fc5ed8663084ca3e",
                "md5": "40d95a60c6217b00baf9e1576e872e45",
                "sha256": "c92ccebd317deb71304805b7dcdd3a8d32693afa8f0aa98ca401ad168f857860"
            },
            "downloads": -1,
            "filename": "sharingiscaring-0.4.39.tar.gz",
            "has_sig": false,
            "md5_digest": "40d95a60c6217b00baf9e1576e872e45",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 276410,
            "upload_time": "2024-03-12T18:43:14",
            "upload_time_iso_8601": "2024-03-12T18:43:14.405418Z",
            "url": "https://files.pythonhosted.org/packages/42/1e/05556f9d80271c895a7f919a0f0fa7de967c986df2b9fc5ed8663084ca3e/sharingiscaring-0.4.39.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 18:43:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sderuiter",
    "github_project": "sharingiscaring",
    "github_not_found": true,
    "lcname": "sharingiscaring"
}
        
Elapsed time: 0.17880s