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.22.tar.gz (8.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for public-0.0.22.tar.gz
Algorithm Hash digest
SHA256 41c78e4cf0d5371d6365d290833e6fa29196ece556ea8bfb62f95606b7b2c58c
MD5 e3a3534b05340f7ca6727888446a3e4d
BLAKE2b-256 2e09dc9c373174d8f0bec0a8c8526ae3be48b48b8972e9f84589ae650bf32444

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