Skip to main content

Compact representation of fixed width numeric values

Project description

named_bitfield lets you define fixed width bit fields within an integer, and address those fields as class attributes, while still providing access to the backing integer representation. The original use case for this is “intellignet IDs”. Essentially, this is a unique numeric id, sutiable for use as a database primary key, which encodes some information about the object it identifies. Obviously, this should be immutable information so your IDs don’t change or (worse) get out of sync with reality. Some suggestions are the object type, the create time, or the data source. Saving a few bits for a serial counter is also advisable, as timestamps aren’t reliable as unique ids.

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

named_bitfield-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for named_bitfield-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae1c75096b0b49bdbf9e57dac315375f5c00aa28ea8ada4e4a55be131b5700d6
MD5 e1980a3edb95a0820ef00a70fa825994
BLAKE2b-256 378cf934c6e5f10e61a769b7c6a16da712b6522173fcf4c415f4826a54c8624e

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