pyglotaran-alias
Convenience module which allows to use pyglotaran as an alias in the CLI and imports, when working with pyglotaran.
Since the python implementation of glotaran was renamed to pyglotaran to prevent ambiguity, about which glotaran was used,
at times one might be tempted to use import pyglotaran instead of import glotaran.
Usage
import pyglotaran
Or
from pyglotaran import ParameterGroup
For autocompletion to work in an interactive session (i.e. python repl, jupyter-console or jupyter-notebooks) you need to first import the pyglotaran-alias i.e. with import pyglotaran.
After this is done glotaran is registered under the alias pyglotaran, and autocomplete should work.
How does it work?
When you use import pyglotaran the following happens:
pyglotaran-alias's__init__.pyis called.- The module cache (
sys.modules) is populated with allglotaranmodules. - For each
glotaranmodule an additional corresponding entry withpyglotaranis added to the module cache. - The local variables used to modify the module cache are deleted, so they won't pollute your globals.
- The
pyglotaranglobal variable replaces itself with theglotaranpackage.
Known problems
Linter shows error "No name '<module or attribute name>' in module 'pyglotaran'", when using a text editor
Since most linters use a static file analysis, they won't understand the live swapping of modules at runtime and think that pyglotaran is defined inpyglotaran-alias, where <module or attribute name> most likely doesn't exist.
Thus you have a Schrödinger-Linter, which is right and wrong at the same time.
Autocomplete doesn't work, when using a text editor
This is due to the fact that autocomplete engines (similar to linters) use a static file analysis and thus think that pyglotaran is defined in pyglotaran-alias. Sadly I didn't find a way to fix this issue yet, since it also strongly depends on the used autocomplete engine.
Autocomplete in interactive session shows attributes on pyglotaran which aren't part of glotaran
When using an interactive session (i.e. python repl, jupyter-console or jupyter-notebooks), the autocomplete will pick up the replaced module and allow you to get autocompletion for modules and attributes defined in glotaran.
But due to static file analysis it will also pick up modules and attributes defined in pyglotaran-alias
Metadata
Release files for pyglotaran-alias 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyglotaran_alias-0.0.5.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyglotaran_alias-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.9 kB
Release files / pyglotaran_alias-0.0.5.tar.gz
| Download URL | pyglotaran_alias-0.0.5.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b4c8501669213ce5e94efc53480c3fd4b85228973dce97b343651bb7ce7d4a5
|
|
BLAKE2b-256 checksum How to use checksums |
d568b071a94f79b14dbe145e90fd6333acf7da62aa0dd4e53b1ff25c17276f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Release files / pyglotaran_alias-0.0.5-py3-none-any.whl
| Download URL | pyglotaran_alias-0.0.5-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4b407e4af9a39d6175784cadf29a6c489c98c290fa72b5b7ea1535ea3c8c3bf
|
|
BLAKE2b-256 checksum How to use checksums |
fefbc697225d76bd76b976e7b0be2ab2e2e479a6ab1b88b64ead03a8ebda621f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|