Skip to main content

Python bindings for Rust's Ropey library.

Project description

PyRopey

CI Build Status Latest Release Python version Documentation

Python bindings for Rust's Ropey library.

From Ropey's repository: Ropey is a utf8 text rope for Rust, designed to be the backing text-buffer for applications such as text editors. Ropey is fast, robust, and can handle huge texts and memory-incoherent edits with ease.

PyRopey aims to provide the performance and accessible interface of Rope into Python's world.

Installing

PyRopey is available in any platform and can be installed with pip:

pip install ropey

Note: PyRopey is currently in pre-release status and major changes are to be expected.

Example Usage

Adapted from Ropey's example.

from ropey import Rope

# Load a text file.
let text = Rope.from_file("my_great_book.txt")

# Print the 516th line (zero-indexed).
print(text.line(515))  # Not implemented yet

# Get the start/end char indices of the line.
let start_idx = text.line_to_char(515)  # Not implemented yet
let end_idx = text.line_to_char(516)

# Remove the line...
text.remove(slice(start_idx, end_idx))

# ...and replace it with something better.
text.insert(start_idx, "The flowers are... so... dunno.\n")

# Print the changes, along with the previous few lines for context.
let start_idx = text.line_to_char(511)
let end_idx = text.line_to_char(516)
print(text.slice(slice(start_idx, end_idx)))  # Not implemented yet

# Write the file back out to disk.
text.write_to_file("my_great_book.txt")

PyRopey's philosophy is to provide an API that is as close as possible to the original methods in Ropey. This is why we recommend using their documentation for more details.

Contributing

Contributions are more than welcome! Here are a few objectives:

  • Implement (almost) every methods from ropey::Rope
  • Write Python tests for every method
  • Write stubs for every method
  • Document every method
  • Create docs, hosted on ReadTheDocs
  • Build automated benchmarks to compared ropey with builtin alternatives

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

ropey-0.0.3_alpha.tar.gz (10.6 kB view details)

Uploaded Source

Built Distributions

ropey-0.0.3_alpha-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

ropey-0.0.3_alpha-cp310-none-win_amd64.whl (198.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

ropey-0.0.3_alpha-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

ropey-0.0.3_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (589.8 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

ropey-0.0.3_alpha-cp39-none-win_amd64.whl (198.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

ropey-0.0.3_alpha-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

ropey-0.0.3_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (590.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

ropey-0.0.3_alpha-cp38-none-win_amd64.whl (198.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

ropey-0.0.3_alpha-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

ropey-0.0.3_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (590.2 kB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

ropey-0.0.3_alpha-cp37-none-win_amd64.whl (198.0 kB view details)

Uploaded CPython 3.7 Windows x86-64

ropey-0.0.3_alpha-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

ropey-0.0.3_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (590.2 kB view details)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

ropey-0.0.3_alpha-cp36-none-win_amd64.whl (197.6 kB view details)

Uploaded CPython 3.6 Windows x86-64

ropey-0.0.3_alpha-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

File details

Details for the file ropey-0.0.3_alpha.tar.gz.

File metadata

  • Download URL: ropey-0.0.3_alpha.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.9

File hashes

Hashes for ropey-0.0.3_alpha.tar.gz
Algorithm Hash digest
SHA256 e186ff3094260c730cca8b151aca27bd507bc7c7a83a5c7d063f833bb6c52125
MD5 808666e2680d22478da02f7f509e2bb9
BLAKE2b-256 6b0d602f4e1f7499d010ca216f1f877977ec0d70540d69aa0a0f23b5977993b9

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 86174bdb84f7e4e6fcfba556067dc20f4146f7853d3dfb9a7ab29eb4bdce1487
MD5 18635abfc5bb59cbc44e054212c22703
BLAKE2b-256 23433db45ebaeba0cdc789aa2a529e51f4813b0aae1b41b6c322d18edbb9303a

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 77b44e241aca58c5b052cec470845024fdaab44e67b48b22aac8330afb297de4
MD5 92c7521717ea833506fd316163684ab7
BLAKE2b-256 73bd6776fc8965decb5a79983c218bd94e3add1fa0f2cff759a4909fb0db719e

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7e602c8b7541fd89844f63ad534f44cd0d6363b2b168587162dec0ae854ff6f5
MD5 10270e5105171bf1d13db5c6f47ca6ea
BLAKE2b-256 cea93d03fbf9d67cc6e65fcf8a1aa466682166fb52efebb1ae20873b4c6bd200

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0868d01ef398e436532a779eada472cf3999b3d3cac7e4e0942a285520a0f79a
MD5 3dc1fb2c41f30fb9d280e287302e258e
BLAKE2b-256 4a3363090cf79125702f64a1b5fccd3a0e9c8f22b34aee42ab6ca3dd0c1c8dc3

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 04f6e90f3699ec5612138005bfebdb2756113f96ac300eba84b295d569b7a21d
MD5 d107cf1658cc4492f01ec4f574eb48b3
BLAKE2b-256 942c243b6b3f96a59c8c6697a4a41d9f8f8b4581c1085326e1269f4e0d534664

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6528093a65f87c669855f9a5f01d6516182d1fb5a635bd226322dcbdea057f26
MD5 176c06f2a9e6351b56527dc79fe7088f
BLAKE2b-256 fe8e7de8d8d2bfcc27a497a4aa3fd094ae265703200b74dfc5dbda902d0bf4c1

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bac6e2d1761bde4ef5a08bb3f89757155b70dc2731effcce3a105d151250c3f7
MD5 9084b53e9f4f68b5eb1cb18236ae1114
BLAKE2b-256 e31cb3423a8727444a71b9a96c23e5080ac0739a01fd77844d6f4900060798d8

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 3298062bda3e7cd67231cee70e077017c82cc77917c55cef3361be0cad002ce0
MD5 e1db6507d8c1bb47b9466c5039f11f82
BLAKE2b-256 7be4d02b80653949d92cb785055c16919e9f1d54774123f2300913f710c1a388

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c974a83b04f6c90cd8c22908e02dc52bb1c049a78f8a93ffef4e8959289d3b41
MD5 9841c24c93cff87ff2d79d9ef890dbcd
BLAKE2b-256 e17aa7e651032418d0477ecd213d4b01235e95deebd4e2f691ead493ad33affd

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d6ddea91a5c1392b4ca7b9e89d4d7360b21c43d80949e57e8c5b139f6249f851
MD5 fbc6bd6b6286ae2be173cfa081bdeedf
BLAKE2b-256 36e3c9bcd50f9467b82324cbc31b343c3481ae3a17be47da03a12ea05fda2349

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a29b0d388da259a881be13b2a728573f442221f6ed54f6ea2e7c43eb2dc2e9d
MD5 28dc939183b86bc5c066b780f26eec1b
BLAKE2b-256 88f9dd4f33378f658d3f913f4047bb9350c9294da17f1f9fa818282246834bd3

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3555febe44fe25c172bd1cdb9f9eb6492717b086fc2385f6c44b923023d9e3a5
MD5 c24d0725fa102f65e4130cda0df3d426
BLAKE2b-256 fcdb4ed2a19acd44f98ffc610a0dc1bc4de83f58485249295a8b69c9bd69345b

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 091e80387c926db6c8f127ca10ae94547b01e4a050fe81ce2ca2c193ce4f541f
MD5 31797fe8f9c25b71042f2fb580500c6a
BLAKE2b-256 d38cc7576ac9f512af8f75f620b2440cf58c90821d23e02c2996731be30a3ebb

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp36-none-win_amd64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 ad0157aaaac938c92ef9b603611f969e7ebfbb3f5a3c11aa4c85582406f71f1f
MD5 1e82b59721c3c3bd1d795066a78f5e26
BLAKE2b-256 71b4376ab60cf16b9bb8ac2e7ff72e0f36c77e01e53f97e24155461d023502ec

See more details on using hashes here.

File details

Details for the file ropey-0.0.3_alpha-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ropey-0.0.3_alpha-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fd5ace002ceccbf35ae0e34a1923cc172321e435dafc21da51d4cba188607557
MD5 35ad7f19203b63d9abfc4e036d8a0b11
BLAKE2b-256 a75de8ededa0a972a22175ff035f5aad6f575da64b63a694d5f562d032436942

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