Easy access to globals() from inside a python module.
See: https://stackoverflow.com/questions/15959534/visibility-of-global-variables-in-imported-modules/69029612#69029612
Using superglobals
==================
.. code-block:: python
import superglobals
from superglobals import *
superglobals()[var] = value
setglobal('test', 123)
defaultglobal('test', 456)
assert(getglobal('test') == 123)
setglobal('a.b.c', 7)
> a['b']['c'] == 7
setglobal('a\.b\.c', 8)
> globals()['a.b.c'] == 8
Changelog
=========
0.0.10: initial release (2021-09-02)
0.0.13: added dotted object heirachy expansion (2021-09-13)
Raw data
{
"_id": null,
"home_page": "https://github.com/sfinktah/superglobals",
"name": "superglobals",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7",
"maintainer_email": "",
"keywords": "",
"author": "Christopher Anderson",
"author_email": "sfinktah@github.spamtrak.org",
"download_url": "https://files.pythonhosted.org/packages/ea/8a/95870470da2e4ec4b041f9a3041c2a33e793f983a91368114c7bd4cfe48d/superglobals-0.0.17.tar.gz",
"platform": null,
"description": "Easy access to globals() from inside a python module.\n\nSee: https://stackoverflow.com/questions/15959534/visibility-of-global-variables-in-imported-modules/69029612#69029612\n\nUsing superglobals\n==================\n\n.. code-block:: python\n\n import superglobals\n \n from superglobals import *\n\n superglobals()[var] = value\n\n setglobal('test', 123)\n defaultglobal('test', 456)\n assert(getglobal('test') == 123)\n\n setglobal('a.b.c', 7)\n > a['b']['c'] == 7\n\n setglobal('a\\.b\\.c', 8)\n > globals()['a.b.c'] == 8\n\n\nChangelog\n=========\n\n0.0.10: initial release (2021-09-02)\n0.0.13: added dotted object heirachy expansion (2021-09-13)\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "globals() access anywhere. \"We Do Anything, Anytime\"",
"version": "0.0.17",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "e202e25c830b6c13c630caab321bcd64",
"sha256": "2c2326a1322d076efb2e4b5597ce24a3bbba2535f71fa953f6b4dc70ed9c2938"
},
"downloads": -1,
"filename": "superglobals-0.0.17.tar.gz",
"has_sig": false,
"md5_digest": "e202e25c830b6c13c630caab321bcd64",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 4333,
"upload_time": "2022-12-05T23:01:01",
"upload_time_iso_8601": "2022-12-05T23:01:01.954925Z",
"url": "https://files.pythonhosted.org/packages/ea/8a/95870470da2e4ec4b041f9a3041c2a33e793f983a91368114c7bd4cfe48d/superglobals-0.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-05 23:01:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "sfinktah",
"github_project": "superglobals",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "superglobals"
}