Skip to main content

Initable is a Python package that helps create DRY-er classes.

Project description

Initable




Initable is a Python package that helps create DRY-er classes.

Installation

Initable is available through pip.

pip install initable

Usage

Define an instance method you would like to be able to initialize the class with as well.

from initable import initializable

class Foo(object):
    @initializable
    def bar(self, arg):
        self.baz = do_something(arg)

You can now call that method on the class and receive an initialized instance upon completion:

foo = Foo.bar(arg)

Or call the method on an existing instance:

foo = Foo()
# do stuff...
foo.bar(arg)  # `bar()` is called on instance `foo`

Testing

To run tests, execute the following from the root of the project:

poetry run pytest tests/

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Code of Conduct

By participating in this project, you agree to abide by the terms of the Code of Conduct.

License

Initable is licensed under the Hippocratic License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

initable-0.2.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

initable-0.2.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file initable-0.2.1.tar.gz.

File metadata

  • Download URL: initable-0.2.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.6 Darwin/18.7.0

File hashes

Hashes for initable-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9b48fcddcfb97907607265b3ee14829210e509f513ecf28376597e6555e3e599
MD5 2ff5c75da9b0a93f501662f25c9d7cff
BLAKE2b-256 52749a1e146a876618c2cf4be581500fc7a9e93600fc85df77e856c929b36beb

See more details on using hashes here.

File details

Details for the file initable-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: initable-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.6 Darwin/18.7.0

File hashes

Hashes for initable-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ba07bfb56bec6b3cce62d951e92b75672fc8691ac4b5c132618a8c5eb4a80f6
MD5 76206916a835182762debdb3de286dbc
BLAKE2b-256 0f24e2cba94d958204bd1abb051d67b8c90df56887e51c09b5cc108739d6ecd5

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