Skip to main content

README.md

bit-common

bit-common is a Python library that provides types and utilities for working with bits. It allows you to easily convert data to and from bits, making it a handy tool for low-level programming, data analysis, and more.

Installation

You can install bit-common using pip or poetry.

Using pip

pip install bit-common

Using poetry

poetry add bit-common

Usage

Here are some examples of how you can use bit-common.

Converting data to bits

from bit.type import int8, UTF8StringWithPrefix

# Converting data to bits
data = int8(3)
bits = data.to_bits()
print(bits)  # Output: [1, 1, 0, 0, 0, 0, 0, 0]

# Converting bits to data
bits = [1, 1, 0, 0, 0, 0, 0, 0]
data = int8.from_bits(bits)
print(data)  # Output: 3

# Converting string to bits
string = UTF8StringWithPrefix("Hello")
bits = string.to_bits()
print(bits)  # Output: [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0]

# Converting bits to string
bits = [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0]
string = UTF8StringWithPrefix.from_bits(bits)
print(string)  # Output: "Hello"

License

bit-common is licensed under the MIT License.

Metadata

Release files for bit-common 0.1.15

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

Source distribution (sdist)

Source distribution for bit-common 0.1.15
File Size Uploaded Provenance Actions
bit_common-0.1.15.tar.gz 9.8 kB Without provenance Details for bit_common-0.1.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bit-common 0.1.15
File Interpreter ABI Platform Actions
bit_common-0.1.15-py3-none-any.whl Python 3 none any Details for bit_common-0.1.15-py3-none-any.whl

Total release size: 23.2 kB

Release files / bit_common-0.1.15.tar.gz

Download URL bit_common-0.1.15.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4cecdaabe01e542f7a1dd0bbf85a839ed8a1b77f481135fef76d2fe863b6679e
BLAKE2b-256 checksum
How to use checksums
b24348a05fb28933934ac87febad438b12e5d042533e49d8aec0d20c2026e553
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Darwin/23.3.0

Release files / bit_common-0.1.15-py3-none-any.whl

Download URL bit_common-0.1.15-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b1631f20a24fc2dc5449f64e6b4bacca46a6d512e90db10aab4dc928f8b99ca
BLAKE2b-256 checksum
How to use checksums
baa6f96181c0f4a3a86b2e9310403a2fbc23c8821978ab3ea73e92857c2b7f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Darwin/23.3.0

Security for bit-common 0.1.15

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