ariestools
Common tools
Install
pip install -U ariestools
Python version support
python3.7+
Function
graphql query
from ariestools import graphql_query
_res_json = graphql_query(query_url, payload)
json path
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
from ariestools import load_json
_json = load_json(json_file_path)
format obj to json str
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()))
{
"a": 1,
"b": 2,
"bar": {
"x": 1,
"y": 2
}
}
get relative path & load yaml
import os
from ariestools import replace_sys_path, load_yaml
_yaml = load_yaml(os.path.realpath('') + replace_sys_path("/.xxx/xxx.yaml"))
parse time
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
Metadata
Release files for ariestools 1.7.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ariestools-1.7.12.tar.gz | 7.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ariestools-1.7.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / ariestools-1.7.12.tar.gz
| Download URL | ariestools-1.7.12.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01042aa44b4670722ebea6815f81ad1027c3c2677b7653d93fa8dcc91bc6283d
|
|
BLAKE2b-256 checksum How to use checksums |
c1103f3d577b1c223b17e836696b9521ef35c9d0a9a2610111e2d220aadf194a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.3
|
Release files / ariestools-1.7.12-py3-none-any.whl
| Download URL | ariestools-1.7.12-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
587b00f2319160443ffdf2666694f4fa48bc2f87c8f139943987c01c2a0b4029
|
|
BLAKE2b-256 checksum How to use checksums |
50b77599af0354285a5b2d76b91d1cd52711d647f2b7a769dff44bd969287514
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.3
|
Security for ariestools 1.7.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.