gwf-wrangler


Namegwf-wrangler JSON
Version 0.0.7 PyPI version JSON
download
home_page
SummaryA python package to convert yaml files to lua scripts for the Global Workflow Project.
upload_time2023-07-12 19:39:18
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright 2023 NOAA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords globalworkflow global workflow esmf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Wrangler (0.0.7)

## Logging

### Use the Correct Levels When Logging

It might be difficult to decide which level to assign each event. Fortunately, the Python logging module presents fewer levels than other logging libraries. This makes things easier by eliminating some potential ambiguity. When it comes to Python levels, here are the general guidelines:

- DEBUG: You should use this level for debugging purposes in development.
- INFO: You should use this level when something interesting—but expected—happens (e.g., a user starts a new project in a project management application).
- WARNING: You should use this level when something unexpected or unusual happens. It’s not an error, but you should pay attention to it.
- ERROR: This level is for things that go wrong but are usually recoverable (e.g., internal exceptions you can handle or APIs returning error results).
- CRITICAL: You should use this level in a doomsday scenario. The application is unusable. At this level, someone should be woken up at 2 a.m.
        
### Include a Timestamp for Each Log Entry

Knowing something happened without knowing when it happened is only marginally better than not knowing about the event at all. Make sure to add a timestamp to your log entries to make the lives of the people who use logs for troubleshooting easier. Doing so also allows developers to analyze the log entries to obtain insights/analytics about user behavior.

### Adopt the ISO-8601 Format for Timestamps

Timestamps are essential in log entries. Unfortunately, people can’t agree on the best way to express instants in time, so we came up with several conflicting formats.

Using the format widely used in your country might look like it’s the right choice, especially if you don’t plan to offer your application overseas.

But this couldn’t be further from the truth. By simply adopting a standard format for your timestamps, you can prevent problems, as third-party libraries and tools will expect the standard format in the first place.

This standard format exists, and it’s called ISO-8601. It’s an international standard for the exchange of date- and time-related data. Here’s an example of a timestamp expressed in ISO-8601 format:

`2020-03-14T15:00-03:00`

This is a basic example of how to configure the formatting to allow ISO-8601 timestamps:

```
import logging
logging.basicConfig(format='%(asctime)s %(message)s')
logging.info('Example of logging with ISO-8601 timestamp')
```

### Use the RotatingFileHandler Class

A general logging best practice—in any language—is to use log rotation. This is a mechanism designed to automatically archive, compress, or delete old log files to prevent full disks.

Fortunately, you don’t have to implement this by hand in Python. Instead, use the RotatingFileHandler class instead of the regular FileHandler one.

[Source](https://www.loggly.com/use-cases/6-python-logging-best-practices-you-should-be-aware-of/)

### Builds

`apt install python3.10-venv`
`python -m build`


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gwf-wrangler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "globalworkflow,global workflow,esmf",
    "author": "",
    "author_email": "Ryan Long <ryan.long@noaa.gov>",
    "download_url": "https://files.pythonhosted.org/packages/27/04/b5826e7d0571e6ce5e75bebab1e31349f799fb2a7fd0c94131e78bb6bf7d/gwf_wrangler-0.0.7.tar.gz",
    "platform": null,
    "description": "\n# Wrangler (0.0.7)\n\n## Logging\n\n### Use the Correct Levels When Logging\n\nIt might be difficult to decide which level to assign each event. Fortunately, the Python logging module presents fewer levels than other logging libraries. This makes things easier by eliminating some potential ambiguity. When it comes to Python levels, here are the general guidelines:\n\n- DEBUG: You should use this level for debugging purposes in development.\n- INFO: You should use this level when something interesting\u2014but expected\u2014happens (e.g., a user starts a new project in a project management application).\n- WARNING: You should use this level when something unexpected or unusual happens. It\u2019s not an error, but you should pay attention to it.\n- ERROR: This level is for things that go wrong but are usually recoverable (e.g., internal exceptions you can handle or APIs returning error results).\n- CRITICAL: You should use this level in a doomsday scenario. The application is unusable. At this level, someone should be woken up at 2 a.m.\n        \n### Include a Timestamp for Each Log Entry\n\nKnowing something happened without knowing when it happened is only marginally better than not knowing about the event at all. Make sure to add a timestamp to your log entries to make the lives of the people who use logs for troubleshooting easier. Doing so also allows developers to analyze the log entries to obtain insights/analytics about user behavior.\n\n### Adopt the ISO-8601 Format for Timestamps\n\nTimestamps are essential in log entries. Unfortunately, people can\u2019t agree on the best way to express instants in time, so we came up with several conflicting formats.\n\nUsing the format widely used in your country might look like it\u2019s the right choice, especially if you don\u2019t plan to offer your application overseas.\n\nBut this couldn\u2019t be further from the truth. By simply adopting a standard format for your timestamps, you can prevent problems, as third-party libraries and tools will expect the standard format in the first place.\n\nThis standard format exists, and it\u2019s called ISO-8601. It\u2019s an international standard for the exchange of date- and time-related data. Here\u2019s an example of a timestamp expressed in ISO-8601 format:\n\n`2020-03-14T15:00-03:00`\n\nThis is a basic example of how to configure the formatting to allow ISO-8601 timestamps:\n\n```\nimport logging\nlogging.basicConfig(format='%(asctime)s %(message)s')\nlogging.info('Example of logging with ISO-8601 timestamp')\n```\n\n### Use the RotatingFileHandler Class\n\nA general logging best practice\u2014in any language\u2014is to use log rotation. This is a mechanism designed to automatically archive, compress, or delete old log files to prevent full disks.\n\nFortunately, you don\u2019t have to implement this by hand in Python. Instead, use the RotatingFileHandler class instead of the regular FileHandler one.\n\n[Source](https://www.loggly.com/use-cases/6-python-logging-best-practices-you-should-be-aware-of/)\n\n### Builds\n\n`apt install python3.10-venv`\n`python -m build`\n\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 NOAA  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A python package to convert yaml files to lua scripts for the Global Workflow Project.",
    "version": "0.0.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/pypa/gwf-wrangler/issues",
        "Homepage": "https://github.com/pypa/gwf-wrangler"
    },
    "split_keywords": [
        "globalworkflow",
        "global workflow",
        "esmf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4730e0d051e697c40f2a2212f203800a25530ab893c7d1bf0a7997efbc942aa",
                "md5": "d586346ed23122e1dad2d7726bbd7b30",
                "sha256": "e90955981f2b10f281412f207268a08325453c84ea8fcd2377d46a834bc3d1e1"
            },
            "downloads": -1,
            "filename": "gwf_wrangler-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d586346ed23122e1dad2d7726bbd7b30",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 17244,
            "upload_time": "2023-07-12T19:39:16",
            "upload_time_iso_8601": "2023-07-12T19:39:16.388017Z",
            "url": "https://files.pythonhosted.org/packages/f4/73/0e0d051e697c40f2a2212f203800a25530ab893c7d1bf0a7997efbc942aa/gwf_wrangler-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2704b5826e7d0571e6ce5e75bebab1e31349f799fb2a7fd0c94131e78bb6bf7d",
                "md5": "484d693f242d93cddf33fbe68dd2d96b",
                "sha256": "a6516af9b1c1e03b5b02af264526ebaa68289e26b5a6136494358cf2b2e3b06e"
            },
            "downloads": -1,
            "filename": "gwf_wrangler-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "484d693f242d93cddf33fbe68dd2d96b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10316,
            "upload_time": "2023-07-12T19:39:18",
            "upload_time_iso_8601": "2023-07-12T19:39:18.017475Z",
            "url": "https://files.pythonhosted.org/packages/27/04/b5826e7d0571e6ce5e75bebab1e31349f799fb2a7fd0c94131e78bb6bf7d/gwf_wrangler-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-12 19:39:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pypa",
    "github_project": "gwf-wrangler",
    "github_not_found": true,
    "lcname": "gwf-wrangler"
}
        
Elapsed time: 0.08742s