Skip to content

Commit

Permalink
Python updates (#168)
Browse files Browse the repository at this point in the history
* add __version__ to python

* update cryo_python to cryo
  • Loading branch information
sslivkoff authored Jan 8, 2024
1 parent 5a1a3bf commit da6ce5e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions book/cryo_python/installation.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions crates/python/python/cryo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions crates/python/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

0 comments on commit da6ce5e

Please sign in to comment.