Skip to main content

An example package. Replace this with a proper project description. Generated with https://github.com/ionelmc/cookiecutter-pylibrary

Project description

Travis-CI Build Status AppVeyor Build Status Coverage Status PYPI Package PYPI Package

Container class boilerplate killer.

Features:

  • Human-readable __repr__

  • Complete set of comparison methods

  • Keyword and positional argument support. Works like a normal class - you can override just about anything in the subclass (eg: a custom __init__). In contrast, hynek/characteristic forces different call schematics and calls your __init__ with different arguments.

Installation

pip install fields

Usage

>>> from fields import Fields
>>>
>>> class Pair(Fields.a.b):
...     pass
...
>>> p = Pair(1, 2)
>>> p.a
1
>>> p.b
2
>>> class Node(Fields.value.left(None).right(None)):
...     pass
...
>>> p = Node(1, left=Node(2), right=Node(3, left=Node(4)))
>>> p
<Node(left=<Node(left=None, right=None, value=2)>, right=<Node(left=<Node(left=None, right=None, value=4)>, right=None, value=3)>, value=1)>

Documentation

https://python-fields.readthedocs.org/

Development

To run the all tests run:

tox

Changelog

0.1.0 (2014-06-08)

  • First release on PyPI.

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

fields-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

fields-0.1.0-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fields-0.1.0.tar.gz.

File metadata

  • Download URL: fields-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fields-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eace88c4ba89388c54039743c4a5fe8efb2f610120cfd8caca18f766bf03d582
MD5 10d1f8d7fcf5b94ff33d0bb5776dc226
BLAKE2b-256 9fea95dba455c643b71a9e363b71f9106672269309725846b82b532739a2bbf8

See more details on using hashes here.

Provenance

File details

Details for the file fields-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fields-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 914e02eef2badf017bc058c769ffdbb708dbf5ed0f91bcf0c3bd08f3f19e861e
MD5 44801211e03f262a5c53d8e1487f47f6
BLAKE2b-256 bbe878c2013d8cb36508dd0876fec3aa80221309bbc7b54d297905c51f5b4510

See more details on using hashes here.

Provenance

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