Pretty dict generating plugin for potc.
Project description
potc_typing
A simple demo of potc
plugin, which can make the dict prettier.
Installation
You can simply install it with pip
command line from the official PyPI site.
pip install potc-typing
Or install this plugin by source code
git clone https://github.com/potc-dev/potc-typing.git
cd potc-typing
pip install .
Effect show
We prepare a python script named test_data.py
, like this
import math
b = {
'a': {'a': 3, 'b': None, 'c': math.e},
'b': (3, 4, 'dfg'),
'x0': {'a': 3, '02': 4, None: 2},
}
Before the installation mentioned above, we try to export the b
in test_data.py
by the following CLI command
potc export -v 'test_data.b'
We can get this dumped source code.
import math
__all__ = ['b']
b = {
'a': {
'a': 3,
'b': None,
'c': math.e
},
'b': (3, 4, 'dfg'),
'x0': {
'a': 3,
'02': 4,
None: 2
}
}
BUT, after the installation, we try the CLI command which is exactly the same again, we get the new code
import math
from builtins import dict
__all__ = ['b']
b = dict(a=dict(a=3, b=None, c=math.e),
b=(3, 4, 'dfg'),
x0={
'a': 3,
'02': 4,
None: 2
})
That is all of this demo. When you need to build your own plugin, maybe this demo can help you :smile:.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
potc-typing-0.0.1.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for potc_typing-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64e7500386d3babb922704b44b1a639a3516086ae300a1f6931373a9df48c509 |
|
MD5 | 3fb1234bc8f0a03753e021787884eae9 |
|
BLAKE2b-256 | ea11aee4ddd68190aa6b937a4f8440b72ae6a8b9e7c37f5875b6a7562f810b24 |