Skip to main content

Instance-Builder - Instance builder library for Python inspired by Lombok

Python Versions PyPI version CI

Installation

pip install instance-builder

Usage

Builder

@builder("id", "name", "age", "email")
class User:
    def __init__(self, id: int, name: str, age: int, email: str) -> None:
        self.id = id
        self.name = name
        self.age = age
        self.email = email

user = User.Builder().id(0).name("Shuntaro Shimizu").age(99).email("ut.s.shimizu@gmail.com").build()

Getter

@getter
class User:
    __id: int = 0
    __name: str = "Shuntaro Shimizu"

user = User()
user.get_id()  # 0
user.get_name()  # "Shuntaro Shimizu"

Setter

@setter
class User:
    __id: int = 0
    __name: str = "Shuntaro Shimizu"

user = User()
user.set_id(1)  # user._User__id == 1
user.set_name("New Name")  # user._User__name == "New Name"

© Copyright 2021 to Shuntaro Shimizu, under the MIT license

Metadata

Release files for instance-builder 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instance-builder 0.1.8
File Size Uploaded
instance-builder-0.1.8.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instance-builder 0.1.8
File Interpreter ABI Platform
instance_builder-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / instance-builder-0.1.8.tar.gz

Download URL instance-builder-0.1.8.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3f3ad2b176c28d83f841d07b142d7b24d8543c0a2166196d5fc3596ee0006f33
BLAKE2b-256 checksum
How to use checksums
034619c3cac56c33c580065ac4b56bd3dc61b90543c58881b9f3438d5c81edf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.4 Darwin/20.5.0

Release files / instance_builder-0.1.8-py3-none-any.whl

Download URL instance_builder-0.1.8-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcf9da9228ec7b6bea2b2d0e278b723111edf31fcb4cb58e9d284055c3b6e036
BLAKE2b-256 checksum
How to use checksums
d6bfd1e13cd5b9d02023b505c7015684e2d02ce17b8d1cfee7656d217d8f5c09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.4 Darwin/20.5.0

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page