From 07d30f14cde8569ac83004f84a391860686b5906 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 8 Jan 2024 11:51:43 -0800 Subject: [PATCH 1/2] add __version__ to python --- crates/python/python/cryo/__init__.py | 1 + crates/python/rust/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/python/python/cryo/__init__.py b/crates/python/python/cryo/__init__.py index f762ca4..ac472a4 100644 --- a/crates/python/python/cryo/__init__.py +++ b/crates/python/python/cryo/__init__.py @@ -2,6 +2,7 @@ # ruff: noqa: F401 +from ._cryo_rust import __version__ from ._freeze import async_freeze from ._freeze import freeze from ._collect import async_collect diff --git a/crates/python/rust/lib.rs b/crates/python/rust/lib.rs index 1fe06a2..6eea1dc 100644 --- a/crates/python/rust/lib.rs +++ b/crates/python/rust/lib.rs @@ -17,5 +17,6 @@ fn cryo_rust(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; m.add_function(wrap_pyfunction!(freeze_adapter::_freeze, m)?)?; m.add_function(wrap_pyfunction!(collect_adapter::_collect, m)?)?; + m.add("__version__", env!("CARGO_PKG_VERSION"))?; Ok(()) } From 5c45c1703cb341706dabf1eb3956f72878e86564 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 8 Jan 2024 11:52:00 -0800 Subject: [PATCH 2/2] update cryo_python to cryo --- README.md | 12 +++++++++--- book/cryo_python/installation.md | 4 ++-- crates/python/pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4e8c564..61e2320 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ For a more complex example, see the [Uniswap Example](./examples/uniswap.sh). ## Installation +The simplest way to use `cryo` is as a cli tool: + #### Method 1: install from source ```bash @@ -62,16 +64,20 @@ This method requires having rust installed. See [rustup](https://rustup.rs/) for Make sure that `~/.cargo/bin` is on your `PATH`. One way to do this is by adding the line `export PATH="$HOME/.cargo/bin:$PATH"` to your `~/.bashrc` or `~/.profile`. -#### Installing `cryo_python` from pypi +### Python Instalation + +`cryo` can also be installed as a python package: + +#### Installing `cryo` python from pypi (make sure rust is installed first, see [rustup](https://www.rust-lang.org/tools/install)) ```bash pip install maturin -pip install cryo_python +pip install cryo ``` -#### Installing `cryo_python` from source +#### Installing `cryo` python from source ```bash pip install maturin diff --git a/book/cryo_python/installation.md b/book/cryo_python/installation.md index ca9d2b7..bd73f79 100644 --- a/book/cryo_python/installation.md +++ b/book/cryo_python/installation.md @@ -1,7 +1,7 @@ ## Installation -There are two main options for installing `cryo_python`. +There are two main options for installing `cryo`. Installing from pip is faster and does not require rust to be installed. @@ -10,7 +10,7 @@ Installing from source allows using the latest unreleased version of cryo. #### Option 1: Install from pip ``` -pip install cryo_python +pip install cryo ``` #### Option 2: Install from source diff --git a/crates/python/pyproject.toml b/crates/python/pyproject.toml index 5891433..2d2ce6c 100644 --- a/crates/python/pyproject.toml +++ b/crates/python/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.1,<2.0"] build-backend = "maturin" [project] -name = "cryo_python" +name = "cryo" description = "cryo is the easiest way to extract blockchain data to parquet, csv, json, or a python dataframe." requires-python = ">=3.7" classifiers = [