This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A Python bytearray work alike which uses a gap buffer as underlying storage. It is a data structure optimised for locally coherent insertions and deletions. It is the usual data structure in text editors.

A utility class, codedstring, is provided which provides a string-like view on a bytegapbuffer transparently encodes and decodes Unicode strings. It provides efficient common-case indexing.

Installation

Installation is via pip. To install the latest release version:

$ pip install bytegapbuffer

To install the current development version from git:

$ pip install git+https://github.com/rjw57/bytegapbuffer

Usage

The bytegapbuffer collection aims to behave just like a bytearray. For example:

from bytegapbuffer import bytegapbuffer

a = bytegapbuffer(b'hello')
a.insert(3, 65)
a.insert(4, 66)
assert a == b'helABlo'

Status

This project is used as part of a personal project of mine and, as such, implements just enough of the sequence, mutable sequence and bytearray interface for my needs. Pull requests adding missing functionality are welcome. Please also add a test for the functionality.

Current features:

  • Retrieving element(s) via [i], [i:j] and [i:j:k] style slicing.
  • Deletion of element(s) via [i], [i:j] style slicing.
  • Insertion/replacement of element(s) via [i], [i:j] style slicing.
  • Insertion of element via insert().
  • Length query via len().
  • Sub-sequence search via index() and find() methods.
  • Equality (and inequality) testing.
  • Iteration over contents.
  • Efficient codedstring wrapper allowing bytegapbuffer to be used as underlying storage in a text editor.

All of the above should work exactly as the bytearray object does. (This is tested in the test suite.) Additional non-bytearray features:

  • Deep copying via copy() method.

Test suite

The test suite may be run via the tox utility. The Travis builds are set up to run the test suite on the latest released Python 2 and Python 3 versions.

Licence

Copyright (C) 2015 Rich Wareham

This code is licensed under a BSD-style licence. See the LICENSE file for details.

Release History

Release History

0.9.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bytegapbuffer-0.9.4.tar.gz (11.0 kB) Copy SHA256 Checksum SHA256 Source Sep 3, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting