Skip to main content

Enjoy the flexibility of structs with esu!

Project description

Welcome to Esu Struct!

Build Status Documentation Status PyPI PyPI - Python Version PyPI - License

Enjoy the flexibility of structs with esu!

You can create types on the fly with previously declared fields and methods by using esu struct.
The created type additionally contains methods for equation, hashing and string representation.

Install

pip install esu

Usage

from esu import Struct

Dog = Struct('Dog', 
             'name', 'age', 
             methods={
                 'say': lambda self: print("Hello {}".format(self.__dict__['name']))
            })

d = Dog()
d.name = 'Rex'
d.age = 5
d.say() # => Hello Rex

Documentation

For further information, read the documentation that can be found: https://esu.readthedocs.io

Contribution

  1. Fork it!
  2. Make your changes!
  3. Send a PR!

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

esu-1.0.5.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file esu-1.0.5.tar.gz.

File metadata

  • Download URL: esu-1.0.5.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for esu-1.0.5.tar.gz
Algorithm Hash digest
SHA256 07eb4228bbd105d9a7e996bfad19b532a2fc39812891ccdd50a7cd5d1b90f77d
MD5 c5954cc528df7c35edf9d0dafcaf3c10
BLAKE2b-256 47e44eeec7abadb3bd5f9248efd23a7d88207aa414c3294069e3f6bcfb84a5f1

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