New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cbitmap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbitmap

A C-based bitmap implementation.

0.0.5
PyPI
Maintainers
1

cbitmap

A C-based bitmap implementation.

Install

pip install cbitmap

Basic Usage

import

from cbitmap import Bitmap

init a bitmap

# pass a number to init a bitmap
size = 100
b = Bitmap(size)

# or load a bitmap from disk
path = '/path/data'
b = Bitmap.load(path)

set

b = Bitmap(100)
b.set(10)

get

b = Bitmap(100)
b.set(10)
print(b.get(10))  # True
print(b.get(1))   # False
print(b.get(100000)) # False

delete

b = Bitmap(100)
b.set(10)
print(b.get(10))  # True
b.delete(10)
print(b.get(10))  # False

set kmer

b = b = Bitmap((1<< 32) - 1)
seq = 'AAcgagtcatcgatgcAAcgagtcatcgatgctagtcgta'.upper()
b.set_kmers(seq, 16)

Persistence

b = Bitmap(1000)
path = '/path/data'
b.dump(path)
b = Bitmap().load(path)
len(b) == 1000  # True

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts