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.4_alpha.tar.gz (815.8 kB view details)

Uploaded Source

Built Distributions

ropey-0.0.4_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.4_alpha-cp310-none-win_amd64.whl (198.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

ropey-0.0.4_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.4_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.4_alpha-cp39-none-win_amd64.whl (198.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

ropey-0.0.4_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.4_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (590.3 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.4_alpha-cp38-none-win_amd64.whl (198.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

ropey-0.0.4_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.4_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.4_alpha-cp37-none-win_amd64.whl (197.9 kB view details)

Uploaded CPython 3.7 Windows x86-64

ropey-0.0.4_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.4_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.4_alpha-cp36-none-win_amd64.whl (197.5 kB view details)

Uploaded CPython 3.6 Windows x86-64

ropey-0.0.4_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.4_alpha.tar.gz.

File metadata

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

File hashes

Hashes for ropey-0.0.4_alpha.tar.gz
Algorithm Hash digest
SHA256 a3af13e6ab006149de448d49c04c70f83df426174e8474c08277a3e552ca4a46
MD5 7069d17b8c72d82e20b6f4ed6c1a5433
BLAKE2b-256 b683995b872f625b797ba62ad49dbbdcc11014209a413dedac75b22682a361d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 10892e577755afb51320a146802266e1f69a20a57b6352606fe0a0536ddae6ba
MD5 07b0b4c59dc9969309ab75ef72fb1e10
BLAKE2b-256 e0a408b3ba99b1b0927bef4530516207b907edfe2b519c57115c471246ef4350

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 d7f8ea0e9862e2b8a502aa0e69b9959aea6047cbec9d61ae3b841267a387b674
MD5 ac807438c4d2d87d4a19a34ebda1c171
BLAKE2b-256 f9dd874d999d4d50e8a4cf26f0de9edfdfc99768518cfa09437ab462038d22f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c02f22d48e5ea5f830dd015bba22e4bbed131d6672b632bd236160aad732bf19
MD5 7588136ab9f8af5d8295d5a7f5fb4f4a
BLAKE2b-256 11ee304351e829c188b86f397a389521f2bef2649319980d4a059c1245ba4f07

See more details on using hashes here.

File details

Details for the file ropey-0.0.4_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.4_alpha-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bd68efa3dfc60ff204b36ffee4c19a4500af9b1620820ceb2015523cb3e3cd31
MD5 038d9a6501b4e3612af6c2fecd01934c
BLAKE2b-256 a04f0b79294310ff25d60938466e312b0de0322b9478689525c83289bc7589f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 c260bd35d0cf424ebb2126ebca95f1714c67695240bf8bf3231539bb57774086
MD5 0c69754d1599aba487c168668abf16cc
BLAKE2b-256 6ca2b22b7dfd0eb8fd52e8b982d58cab66cb62ac2f8d0fb80247395f970231e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd92ff40e4dc232bfb39690fd30f3aad2732b2c38a3e3d8576d4a1689cb240e0
MD5 d65d1dbfd78a6f510a6243354ab53101
BLAKE2b-256 26b4a8b9cfec6333e91d0a0058df64bfa8913a33f17dc22d65532e7833481ce6

See more details on using hashes here.

File details

Details for the file ropey-0.0.4_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.4_alpha-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 92e0ec7428bda2530212aba21228d374687eed2b884d892c6a375d993e5adcec
MD5 3726421901aacd21d5374c366d00095e
BLAKE2b-256 73439775e61f28d54db3a84e1af890d189008ef5453b3e302f643720c295fd16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 53ca38286b8370f3ab73d2388b5848223926c196c14ee2c540b2e5c8683877e4
MD5 67edd59e21d3dbfecc503abe5f3fbdc8
BLAKE2b-256 40cb36b307000daaf8c173dcc4d96a81a97b08f07a1a6ae903d976c5b203a608

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd8e9da03ace2cb2219a6e042fc0901220c205237df462075f66aa1b3ed955ee
MD5 b93ab4eea31b38d72f7e8f488b40ce16
BLAKE2b-256 85c427f2237adc3f5f5a97d34bdc139ed1d4334c67a36b31b637770e034cafd9

See more details on using hashes here.

File details

Details for the file ropey-0.0.4_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.4_alpha-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bb9b5dd05ca44a79c677d9cafb1128eba1e681ecd2b1401fcdb6f4ba4ee2a630
MD5 acafcc0a336f31156bc501a6c112a11c
BLAKE2b-256 1cc92140fc6fa7b30e0f24d1f11818642554e5d79d145d3cfebb03e072ae82d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 53870709971e475813254a9a8514d165e26a24915eb456c8c5585ee3391a0e07
MD5 07e0450264656732615bc05bce364fcd
BLAKE2b-256 e95dfcbb1df6880d8687c99126d4256fa8050b3a98f424cf6f93520afda46302

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6d940c8375308c02e1323085d13c346f8a493854a0308996b9aa49d4083425f4
MD5 cd865e0879a2dd054ce10e60c5bbb9d7
BLAKE2b-256 0b61af3167e79dfde6e209682fa2c51208fe574e3a6a1a091b00cb4bc3d36d16

See more details on using hashes here.

File details

Details for the file ropey-0.0.4_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.4_alpha-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cb74fea912e81cde1765970a0f33c4ad805a48ccf04e5c36438ed5bd5ab8adea
MD5 2b9ac177faaa8b37a4882c2180b9a5f4
BLAKE2b-256 0ddfd5873b83f26c509432f1796f16b2488a3466fc85b895a8743679631a228b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 6e37f3f9b869d47097eb8c4338035cd4c4f56fd42f311123536aca1be25512cd
MD5 2574e2cce364f6305e36b880793f49cd
BLAKE2b-256 6801356326070387294d16abcf02e4272e0641811570a1acec8d7fc81e043d9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ropey-0.0.4_alpha-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cbf0ebe79bfb73b81ecc8f8705f56536e58523e8a24fb396b0e2670cec76f89b
MD5 637b7db788e7f5bfe39a9d21087ed69c
BLAKE2b-256 9032c72538956c58735e9689d10182c212bf3780683f5b82db17981e88e99325

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