{ "info": { "author": "Sascha Just", "author_email": "sascha.just@own-hero.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# About gcshelpers\n\nThe gcshelpers library provides helper functions and utility classes for the *mozintermittent microservices* to interact with the Google Cloud.\n\n## Contents\n\n### Class: Config\n\n`Config` is a wrapper for JSON configuration files. Accessing `CONFIG` the first time leads to a\nlazy initialization of the configuration object. The name of the configuration file is derived from\nthe calling instance, i.e. the package `gcshelpers` is called from. This means using\n`gcshelpers.config.CONFIG` from `hgminer` will load the `hgminer.conf` configuration file. The\nlibrary will first look for a file in the current directory, then the user's home directory, and\nfinally `/etc`.\n\nIf no configuration file can be found, the library attempts to create one from an example file in\nthe calling project's `asset` directory. Assuming `hgminer` is executed and no configuration file is\npresent, `gcshelpers` attempts to copy `hgminer/assets/hgminer.conf.example` to the user's home\ndirectory.\n\nThe JSON file is converted into an object and can be subscribed to via properties or dictionary\naccess. This means that the following config will yield the below valid accesses:\n\n```json\n{\n \"contact\": {\n \"email\": \"sascha.just@own-hero.net\"\n }\n}\n```\n\n```python3\nCONFIG['contact']['email']\n```\n\nIf the local `assets` directory contains a grammar (ANTLR4), the configuration is checked against\nthis grammar during construction, i.e. when the config is initially read during the first access.\n\n#### Grammar example\n\nThe example below requires a configuration that consists of a contact entry having a `name` and\n`email` set, while the structure of those is defined in the terminal section.\n\n```json\ndoc {\n contact : {\n name: NAME,\n email: EMAIL\n }\n}\n\n@terminals\nNAME : [A-Za-z].*;\nEMAIL : [a-zA-Z0-9_\\-\\.\\+]+ '@' [a-zA-Z0-9_\\-\\.]+ '.' [a-zA-Z]{2,};\n```\n\n### Class: MozLogger\n\nThis class wraps the standard logger with a default configuration. This also provides means to log\nto Pub/Sub. It features eager initialization and can directly be used. If no log configuration is\npresent, one is created on the fly.\n\n```python\nLOGGER.debug('Persisting %s', taskid)\n```\n\n### Function: `pkgload`\n\nThis function lets you load assets from the package. Make sure you specify any assets in the\n`Manifest.in` to make sure they are installed together with the package.\n\n```python\nQUERY_INSERT = pkgload(__package__, 'assets/insert_job.sql')\n```\n\n### The storage module\n\nThe module contains methods to interact with Google Cloud Storage.\n\n### The telemetry module\n\nThe module contains methods to interact with Google Pub/Sub.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/mozintermittent/python-libraries/gcshelpers", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gcshelpers-SaschaJust", "package_url": "https://pypi.org/project/gcshelpers-SaschaJust/", "platform": "", "project_url": "https://pypi.org/project/gcshelpers-SaschaJust/", "project_urls": { "Homepage": "https://gitlab.com/mozintermittent/python-libraries/gcshelpers" }, "release_url": "https://pypi.org/project/gcshelpers-SaschaJust/0.1a1/", "requires_dist": [ "google-cloud-pubsub", "google-cloud-storage", "pylint ; extra == 'develop'", "autopep8 ; extra == 'develop'", "rope ; extra == 'develop'", "notebook ; extra == 'develop'", "twine ; extra == 'dist'", "sphinx ; extra == 'docs'", "recommonmark ; extra == 'docs'", "sphinx-rtd-theme ; extra == 'docs'", "doc8 ; extra == 'docs'", "m2r ; extra == 'docs'", "nose ; extra == 'test'", "coverage ; extra == 'test'" ], "requires_python": ">=3.6", "summary": "gcshelpers: a collection of helper classes and functions for the mozintermittent Google Cloud services.", "version": "0.1a1" }, "last_serial": 5371458, "releases": { "0.1a1": [ { "comment_text": "", "digests": { "md5": "fb224a5612c430cd1f0cef126a97d0f9", "sha256": "7e4356637ca2a34b3bdadcc8a3f6b0809c1b1f6937f20642fca1ae404a3a44d6" }, "downloads": -1, "filename": "gcshelpers_SaschaJust-0.1a1-py3-none-any.whl", "has_sig": false, "md5_digest": "fb224a5612c430cd1f0cef126a97d0f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12032, "upload_time": "2019-06-07T13:16:23", "url": "https://files.pythonhosted.org/packages/de/93/ea7b05b471cfc6aa5a74fbddcae7dd153a1edc7e541b2482fb717cb4d273/gcshelpers_SaschaJust-0.1a1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e99c402b8b593638746d71e13d57f82", "sha256": "de4d523ca08afbc890e60a90a5cb083ec35eae426e77e51db842042f5e79cf55" }, "downloads": -1, "filename": "gcshelpers-SaschaJust-0.1a1.tar.gz", "has_sig": false, "md5_digest": "4e99c402b8b593638746d71e13d57f82", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10133, "upload_time": "2019-06-07T13:16:25", "url": "https://files.pythonhosted.org/packages/43/fd/09945cf19aed959b67d5b39d5df60e00eee2241078cec9bb275d11e2beed/gcshelpers-SaschaJust-0.1a1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fb224a5612c430cd1f0cef126a97d0f9", "sha256": "7e4356637ca2a34b3bdadcc8a3f6b0809c1b1f6937f20642fca1ae404a3a44d6" }, "downloads": -1, "filename": "gcshelpers_SaschaJust-0.1a1-py3-none-any.whl", "has_sig": false, "md5_digest": "fb224a5612c430cd1f0cef126a97d0f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12032, "upload_time": "2019-06-07T13:16:23", "url": "https://files.pythonhosted.org/packages/de/93/ea7b05b471cfc6aa5a74fbddcae7dd153a1edc7e541b2482fb717cb4d273/gcshelpers_SaschaJust-0.1a1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e99c402b8b593638746d71e13d57f82", "sha256": "de4d523ca08afbc890e60a90a5cb083ec35eae426e77e51db842042f5e79cf55" }, "downloads": -1, "filename": "gcshelpers-SaschaJust-0.1a1.tar.gz", "has_sig": false, "md5_digest": "4e99c402b8b593638746d71e13d57f82", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10133, "upload_time": "2019-06-07T13:16:25", "url": "https://files.pythonhosted.org/packages/43/fd/09945cf19aed959b67d5b39d5df60e00eee2241078cec9bb275d11e2beed/gcshelpers-SaschaJust-0.1a1.tar.gz" } ] }