semvec/pypi-packages huggingface dataset:
ariestools 1.7.12
Common Tools for python lib

# ariestools

Common tools

[source code](https://github.com/JFRabbit/ariestools)

### Install
pip install -U ariestools

### Python version support
python3.7+

### Function

> graphql query
```python
from ariestools import graphql_query

_res_json = graphql_query(query_url, payload)
```

> json path
```python
from ariestools import JsonPath

_json_dict = {'k': 'v'}
_jp1 = JsonPath(_json_dict)
print(_jp1.path("$.k"))

_json_list = [{'k': 'v'}]
_jp2 = JsonPath(_json_list)
print(_jp2.path("$.[0].k"))

_json_complex = {'k': [{'k': 'v'}]}
_jp3 = JsonPath(_json_complex)

print(_jp3.path("$.k.[0].k"))
```

> load json file
```python
from ariestools import load_json
_json = load_json(json_file_path)
```

> format obj to json str
```python
from ariestools.json_util import obj2jsonstr


class Foo:
    def __init__(self):
        self.a = 1
        self.b = 2
        self.bar = Bar()

class Bar:
    def __init__(self):
        self.x = 1
        self.y = 2


print(obj2jsonstr(Foo()))
```
``` json
{
    "a": 1,
    "b": 2,
    "bar": {
        "x": 1,
        "y": 2
    }
}
```

> get relative path & load yaml
```python
import os
from ariestools import replace_sys_path, load_yaml

_yaml = load_yaml(os.path.realpath('') + replace_sys_path("/.xxx/xxx.yaml"))
```

> parse time
```python
t_time_str = '2019-08-01 00:00:00.000'
t_dt = parse(t_time_str) # 2019-08-01T00:00:00+08:00

print(get_local_time(t_dt)) # 2019-08-01 00:00:00.000
print(get_cloud_time(t_dt)) # 1564588800000000000

t_time_str2 = '2019-08-01 00:00:05.000'
t_dt2 = parse(t_time_str2)

print(get_dt_duration_seconds(t_dt2, t_dt)) # 5

print(t_dt2 > t_dt) # True

print(now()) # 1576224515111
```
pypion 1.1.0
Python package to open Silo data files from PION
Requires Python: >=3.6

# Python Library for PION
Created - 26|08|2019,
Modified - 31|05|2022

Welcome to the Python Library that does post-processing on the .Silo simulation data files outputted from PION. The library works on nested-grid and uniform-grid, and 3D and 2D Silo files.

The relevant files can be found in src/pypion. You can use PlotData.py as a test script, it can call a 2D and a 3D function from PlottingClasses.py. See comments insted the python script on how to use it and change for your needs.

# Install via pip:

You can now install PyPion via PyPi:

* Just run `python3 -m pip install pypion`

In some cases you may need to use `sudo` or install pip with: `sudo apt install python3-pip`

*Note: This is still in testing phase so errors may occur when installing. Please report problems to green@cp.dias.ie

# Install Silo package for python3:

The install script for Silo can be found at /src/silo/ in this repository. Please download it to ~/.local/silo on your computer and install it there using `bash install_silo.sh` 

# Info on how to get started

* Example usage can be found at: [https://www.pion.ie/docs/python.html](https://www.pion.ie/docs/python.html)

* Check out the [Wiki](https://git.dias.ie/compastro/pion_python/-/wikis/home) for more detailed usage.

* How to use the PyPion docker image at: [https://www.pion.ie/docs/python.html](https://www.pion.ie/docs/python.html)


# Developers/Maintainers:

* Samuel Green - green@cp.dias.ie
* Jonathan Mackey