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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for public-0.0.23.tar.gz
Algorithm Hash digest
SHA256 3fc545954028d3fa85a4a6a299675317099da3c60a064497adb4bcd04db11ae5
MD5 c8df1c1331a67f22dad46b6ac6ac5b70
BLAKE2b-256 4456454ae26406952e99356dd322e86b8bf751c53266df3420acdad645b3806c

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