Skip to main content
# pyrst

The Python wrapper to the Birst API.
- No token repetition: once you obtain a token, Pyrst will manage it for you
until you tell it to stop.
- Super easy querying
- Even easier output using handlers

# How to install

Until we release this project to PyPI, the best way to install is:

```
git clone --recursive https://github.com/rbonedata/pyrst.git
python setup.py install
```

On OS X and Linux, unless you're installing in a venv, you might need to run
the install scripts as a privileged user (`sudo`).

# How to use

## General usage

### Importing the client and create a client object

You can store configuration in a config file - a template of the config file is
under the `pyrst` folder. You can name the config file anything you want. To
keep the password somewhat safe, use `base64` encoding and set the
`password_is_encrypted` flag to `True`.

```python
from pyrst.client import BirstClient

client = BirstClient(configfile='pyrst/config.yaml')
```

Alternatively, you can manually create the client:

```python
from pyrst.client import BirstClient

client = BirstClient(user = "MyUsername",
password = "MyPassword")
```

### Login

```python
client.login()
```

```
You have been successfully logged in, DOMAIN\Username.
Your token is: 9b4081fa4b9f3d8d15f77271b7e83902
```

### Logout

Once you're done, simply use `client.logout()` to log out.


## Querying

To query a space, use `executequery()`. Before querying, it makes sense to
import the handler that you want to use to display the data, if any:

```python
from pyrst.handlers import DfHandler
```

Now you can use it in your query:

```python
table = executequery(space = "12345678-abcd-9012-efab-345678901234",
query = "SELECT [# sales_total] from [ALL]",
handler = DfHandler)
```


# Development roadmap

The current functionality doesn't do much beyond querying, but we'll be
steadily developing `Pyrst`'s capabilities. In particular, multipart querying
and more handlers will be implemented soon.

Current priorities are:
- better handlers,
- better query handling,
- JSON output,
- tests,
- documentation,
- more functionality.

# Credits

Written by Chris von Csefalvay with the generous support of RB.

Release files for pyrst 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrst 0.6.1
File Size Uploaded
pyrst-0.6.1.tar.gz 7.9 kB Details

Release files / pyrst-0.6.1.tar.gz

Download URL pyrst-0.6.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4bdf03040da6d898220c1ac75154304f009022ffa6c7a70e0a0b384ce69bb291
BLAKE2b-256 checksum
How to use checksums
0b09485755d34b60689f1025d0ae1990e3f5250f72b51f3611f02876b23a68ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.1 This release

1 release file

0.6.0

1 release file

0.5.9

1 release file

0.5.3

1 release file

0.5.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page