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 is 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.2_alpha.tar.gz (8.9 kB view details)

Uploaded Source

Built Distributions

ropey-0.0.2_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.2_alpha-cp310-none-win_amd64.whl (192.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

ropey-0.0.2_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.2_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (579.7 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.2_alpha-cp39-none-win_amd64.whl (192.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

ropey-0.0.2_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.2_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (579.6 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.2_alpha-cp38-none-win_amd64.whl (192.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

ropey-0.0.2_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.2_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (579.5 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.2_alpha-cp37-none-win_amd64.whl (192.2 kB view details)

Uploaded CPython 3.7 Windows x86-64

ropey-0.0.2_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.2_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (579.4 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.2_alpha-cp36-none-win_amd64.whl (191.9 kB view details)

Uploaded CPython 3.6 Windows x86-64

ropey-0.0.2_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.2_alpha.tar.gz.

File metadata

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

File hashes

Hashes for ropey-0.0.2_alpha.tar.gz
Algorithm Hash digest
SHA256 a352fb23cfafb4d7af62ef34a6ed8e7cf854450dc0b9ac1a94e21d24d9cf5975
MD5 ace69a64da21351d2e362096f0d53130
BLAKE2b-256 c4ce368207e6caa24aa2215e2cca87c3ca9374913726e2bdf773b97c2e5c313e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 263aa5f7090eb5ed0768344a5712b6399c07e0bd976e956bc780a5f7e87db462
MD5 d03c4c059cbc32ee3beab584fd4b1c60
BLAKE2b-256 d777aab1a3a94407116ba63ea33dd5da0623a7acc57cee1f65870d48725b66b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 c0b30cdc8eee9906e63e7c260a1966419d047f889fe48efb7b20c8be732b5d52
MD5 03fb5dbc754e0f7c59e1d412951fcb93
BLAKE2b-256 944959ff419fb797f4cb062bcdf48f747d3829cc2869d362cbfc828cd3d77a02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 96b3b83ba9f5f58578e16bb13f618ee8df76046616ebfacdecd57159c405b5a6
MD5 023aa7c7276c7e707eb5f3f431a50ba5
BLAKE2b-256 010e62410723e6d25a877688ead9ab1f82783553e585e67d4829e08dcfe45148

See more details on using hashes here.

File details

Details for the file ropey-0.0.2_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.2_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8ae9958d3efbf1539b0d09976f6fda690cac6765b32c7cc73b250cfd275a18fe
MD5 ada09e62ac91bd75e1c893be96e48058
BLAKE2b-256 2923106f05e2ff850a3ef3836897914a253c121712e2152aabca0e9dc196ca6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 20c5e81a79c06cc0748843538d850a616e5bd041db63fcb84f9a7fd4bc117f94
MD5 4bb1b6d79684f62d59374f67442a3309
BLAKE2b-256 9fd270d13e757aa1a3daf12512666d2905aa3e2ba1b37f27be31a4e82d091a06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ba4cd5e4cbd7b7ea0b13bf107254b07c070f4c84ec6b9e5d190291c2d54fe30d
MD5 463ba8ad531cb6deb56672dbdef4b89d
BLAKE2b-256 b3da3dfa7f855aada917030ecaa20373b4398d07b96e140eb522373fbfa4e05c

See more details on using hashes here.

File details

Details for the file ropey-0.0.2_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.2_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2f0966c84a61fb2cbfa43203c408a2aafa5afb9a0542c17d994a04a71deb3458
MD5 6c5e6b7b47b02104519714a03e48f0d9
BLAKE2b-256 ab477ba8a5ced952be478f3de93e959e8017ab849ec6500378a462efc261962e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 f82b2dc9be600b2418cf32ab4758ea92affc89cf9e43d3007c8fa8d4033cfd69
MD5 ca120bcf2f4a24450ade9af1f53d549e
BLAKE2b-256 9b6bf7ae30fcc9acdebf9073c896fb934aed7986428058b992907f8579a59396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e746ed05468d2939d53b16d4a03289de4f36d659dbfdf9f4a893c75d596258be
MD5 ceb00d8409eb07213323d9ce9fa2b7cb
BLAKE2b-256 c14224c7732ce78149a75f5da742a3ad98c654586ce04a9609d6d3940b659390

See more details on using hashes here.

File details

Details for the file ropey-0.0.2_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.2_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 705952a12a2bd5bc0bdd91405e4d2e0983fcd1351f617c6c03d942a71f95f47f
MD5 de1f1d3bf88a5fca6f5bb107a5727144
BLAKE2b-256 98af80f7e1069bb73130b230bd1657604cfcb880275a68e99b84ac3495bf26bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 920796021f73010bc3986db0d1a509378cbecf4d7ba79dd09b79d9dd5ae68c97
MD5 3910d398f80fc1c64dbb2c4a7246747d
BLAKE2b-256 43d45eaa66b6025ffb43b81f1314d05ed9359a38626f93444fabf6d2223626a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e7df9bf9c50a7746b08408be0bd51b3dc8bd78121b45487386f5b720ce42dd8e
MD5 f1c464a9356518b199c8ac5d5067a7bc
BLAKE2b-256 1d5e70615f149f4315c4dd092b89d7f4b9ada3b5660922befe233acf989ab7b9

See more details on using hashes here.

File details

Details for the file ropey-0.0.2_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.2_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a3ff1ab2cf85e9e301f8100c90c0912d4e15dd14f4bb0dc770a6b523757fa2cb
MD5 84769659bbbb7e41fd44481dd30de81c
BLAKE2b-256 09be0a5dbd2c669b2d73b8a96da5f657db9a70912e8f4496fdca175d1354d7ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 b77e76d239dc18c0241411be5a7b5bf36cd6deaba09475eb6bfc686cd8595a13
MD5 83c5b4c31d02f22efb23d4cd9a5ff380
BLAKE2b-256 44f66bdcac67c9be9a49f14723d1b20d54e67785722be168158a79dde14ee72f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.2_alpha-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ed546adbef7e23b0631832d80c2c6cf2e2329b8f6e68427fceabf38206d1de90
MD5 c5c95e140b81e85f00ebdb1f789df82b
BLAKE2b-256 93774a59987aace8625786b644b672f7505a2f8a5c41c0c0e1f54ee9541fdac2

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