Skip to main content

@public decorator, public(*objects) function - add objects names to __all__

Project description

.. image:: https://img.shields.io/badge/language-python-blue.svg

.. image:: https://img.shields.io/pypi/pyversions/public.svg
:target: https://pypi.python.org/pypi/public

.. image:: https://img.shields.io/pypi/pyversions/public.svg
:target: https://pypi.python.org/pypi/public

|codacy| |landscape| |codeclimate| |scrutinizer|

.. |scrutinizer| image:: https://scrutinizer-ci.com/g/russianidiot/public.py/badges/quality-score.png?b=master
:target: https://scrutinizer-ci.com/g/russianidiot/public.py/master
:alt: scrutinizer-ci.com

.. |codacy| image:: https://img.shields.io/codacy/None.svg
:target: https://www.codacy.com/app/russianidiot-github/public-py/dashboard
:alt: codacy.com

.. |codeclimate| image:: https://img.shields.io/codeclimate/github/russianidiot/public.py.svg
:target: https://codeclimate.com/github/russianidiot/public.py
:alt: codeclimate.com

.. |landscape| image:: https://landscape.io/github/russianidiot/public.py/master/landscape.svg?style=flat
:target: https://landscape.io/github/russianidiot/public.py/master
:alt: landscape.io

Install
```````

:code:`[sudo] pip install public`

Usage
`````

.. code:: python

# @public decorator
>>> from public import public

>>> @public
def func(): pass

>>> print(__all__)
['func']

>>> @public
>>> class CLS: pass

>>> print(__all__)
['CLS',func']

# public(*objects) function
>>> from public import public

>>> public("name")

>>> print(__all__)
['name']

>>> public("name1","name2")

>>> print(__all__)
['name','name1','name2']


`Examples/`_

.. _Examples/: https://github.com/russianidiot/public.py/tree/master/Examples

Sources:

* `py_modules/public.py`_

.. _`py_modules/public.py`: https://github.com/russianidiot/public.py/blob/master/py_modules/public.py

Feedback |github_issues| |gitter| |github_follow|

.. |github_issues| image:: https://img.shields.io/github/issues/russianidiot/public.py.svg
:target: https://github.com/russianidiot/public.py/issues

.. |github_follow| image:: https://img.shields.io/github/followers/russianidiot.svg?style=social&label=Follow
:target: https://github.com/russianidiot

.. |gitter| image:: https://badges.gitter.im/russianidiot/public.py.svg
:target: https://gitter.im/russianidiot/public.py

----

`russianidiot.github.io/python/`_ - Python packages

.. _russianidiot.github.io/python/: http://russianidiot.github.io/python/

`russianidiot.github.io/cli/`_ - command line scripts

.. _russianidiot.github.io/cli/: http://russianidiot.github.io/cli/

`README.rst`_ - generated with `readmemako.py`_ (python+ `mako`_ templates) and `.README`_ dotfiles

.. _README.rst: https://github.com/russianidiot/public.py/blob/master/.README/pypi.python.org/README.rst
.. _readmemako.py: http://github.com/russianidiot/readmemako.py/
.. _mako: http://www.makotemplates.org/
.. _.README: https://github.com/russianidiot-dotfiles/.README

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

public-0.0.24.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file public-0.0.24.tar.gz.

File metadata

  • Download URL: public-0.0.24.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for public-0.0.24.tar.gz
Algorithm Hash digest
SHA256 afc1ecc9514ef50263d294bd5651069310e902a84b744acd9cabcbf41b0e6a3c
MD5 64e6a094a50f50124b107cebf3420b7e
BLAKE2b-256 a3993d0a62b9059e93bd323cd98833d47f9d149165f3a09fb7d415a31b3c2cf7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page