import export
A Python package methods decorator
Let me show here
1. install
pip install -U import-export
2. use
"""mypack.py"""
import export
def fee():
return 'twee'
@export
def moo():
return 'moow'
@export
class C(object):
pass
> from mypack import *
> print(fee())
NameError: name 'fee' is not defined
> print(moo())
moow
> print(C())
<mypack.C object at 0x00********>
NB:
> import mypack
> print(mypack.fee())
twee
How it work
- just add decorated resource name to the tuple
module.__all__
Implementation features
- no requirements, but
sysonly - uses some hack
from sys import modulesand so won't leave beta - does not store itself in module variables
- runs for all version python
License
- It's free software, see the LICENSE for more details.
Credits
- This project is inspired export v.0.1.2 by http://github.com/zsiciarz/export
- Written in CudaText by @Alexey-T
- Lot a thnx SO topic authors https://stackoverflow.com/q/44834
TODO
-
export(None)== raise Exception('doesn't work') -
may be implementprivate()public()etc decorator to classes as new version of competing library - next part coming soon!
Metadata
Release files for import-export 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| import-export-0.3.1.tar.gz | 5.1 kB | Without provenance | Details for import-export-0.3.1.tar.gz |
Release files / import-export-0.3.1.tar.gz
| Download URL | import-export-0.3.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e47906ef2cb35bedaf5082e37ead4f332f35757005a7eff85bf9aef85ea6a7b
|
|
BLAKE2b-256 checksum How to use checksums |
d0cd1a8c0719058ad9869758a3b4b2417519241c2c9f57ebc074730dbf664adf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for import-export 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.