Skip to main content

basicstruct

https://travis-ci.org/Nurdok/basicstruct.svg https://coveralls.io/repos/Nurdok/basicstruct/badge.svg?branch=master&service=github

A simple struct-like object for Python. Compatible with Python 2.6+, 3.x, pypy and pypy3.

Installation

pip install basicstruct

Usage

To create your own struct, inherit from BasicStruct and define the field with the __slots__ class member. BasicStruct are efficient objects that are automatically comparable, hashable, picklable, printable and reprable.

from basicstruct import BasicStruct

class Point(BasicStruct):
    __slots__ = ('x', 'y')

p1 = Point(2, 3)
p2 = Point(1, y=6)
p3 = Point(x=0, y=0)

print(p1)  # prints: Point(x=2, y=3)

Metadata

Release files for basicstruct 1.0.3

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

Source distribution (sdist)

Source distribution for basicstruct 1.0.3
File Size Uploaded Provenance
basicstruct-1.0.3.tar.gz 3.0 kB Without provenance Details

Release files / basicstruct-1.0.3.tar.gz

Download URL basicstruct-1.0.3.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7d394a95da8d8e7aedea40ce5158b863770a3f304533a3986b28bdc604873458
BLAKE2b-256 checksum
How to use checksums
9c0298d511452a752895f1d77495911d2b957dbb5c5c87b37db26371c88348ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for basicstruct 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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