ODPS Python SDK and data analysis framework
Reason this release was yanked:
Private release not verified
Project description
Elegent way to access ODPS API. Documentation
Installation
The quick way:
pip install pyodps[full]
If you don’t need to use Jupyter, just type
pip install pyodps
The dependencies will be installed automatically.
Or from source code:
$ virtualenv pyodps_env
$ source pyodps_env/bin/activate
$ git clone <git clone URL> pyodps
$ cd pyodps
$ python setup.py install
Dependencies
Python (>=2.6), including Python 3+, pypy, Python 2.7 recommended
setuptools (>=3.0)
requests (>=2.4.0)
Run Unittest
copy conf/test.conf.template to odps/tests/test.conf, and fill it with your account
run python -m unittest discover
Usage
>>> from odps import ODPS
>>> o = ODPS('**your-access-id**', '**your-secret-access-key**',
... project='**your-project**', endpoint='**your-end-point**')
>>> dual = o.get_table('dual')
>>> dual.name
'dual'
>>> dual.schema
odps.Schema {
c_int_a bigint
c_int_b bigint
c_double_a double
c_double_b double
c_string_a string
c_string_b string
c_bool_a boolean
c_bool_b boolean
c_datetime_a datetime
c_datetime_b datetime
}
>>> dual.creation_time
datetime.datetime(2014, 6, 6, 13, 28, 24)
>>> dual.is_virtual_view
False
>>> dual.size
448
>>> dual.schema.columns
[<column c_int_a, type bigint>,
<column c_int_b, type bigint>,
<column c_double_a, type double>,
<column c_double_b, type double>,
<column c_string_a, type string>,
<column c_string_b, type string>,
<column c_bool_a, type boolean>,
<column c_bool_b, type boolean>,
<column c_datetime_a, type datetime>,
<column c_datetime_b, type datetime>]
DataFrame API
>>> from odps.df import DataFrame
>>> df = DataFrame(o.get_table('pyodps_iris'))
>>> df.dtypes
odps.Schema {
sepallength float64
sepalwidth float64
petallength float64
petalwidth float64
name string
}
>>> df.head(5)
|==========================================| 1 / 1 (100.00%) 0s
sepallength sepalwidth petallength petalwidth name
0 5.1 3.5 1.4 0.2 Iris-setosa
1 4.9 3.0 1.4 0.2 Iris-setosa
2 4.7 3.2 1.3 0.2 Iris-setosa
3 4.6 3.1 1.5 0.2 Iris-setosa
4 5.0 3.6 1.4 0.2 Iris-setosa
>>> df[df.sepalwidth > 3]['name', 'sepalwidth'].head(5)
|==========================================| 1 / 1 (100.00%) 12s
name sepalwidth
0 Iris-setosa 3.5
1 Iris-setosa 3.2
2 Iris-setosa 3.1
3 Iris-setosa 3.6
4 Iris-setosa 3.9
Command-line and IPython enhancement
In [1]: %load_ext odps In [2]: %enter Out[2]: <odps.inter.Room at 0x10fe0e450> In [3]: %sql select * from pyodps_iris limit 5 |==========================================| 1 / 1 (100.00%) 2s Out[3]: sepallength sepalwidth petallength petalwidth name 0 5.1 3.5 1.4 0.2 Iris-setosa 1 4.9 3.0 1.4 0.2 Iris-setosa 2 4.7 3.2 1.3 0.2 Iris-setosa 3 4.6 3.1 1.5 0.2 Iris-setosa 4 5.0 3.6 1.4 0.2 Iris-setosa
Python UDF Debugging Tool
#file: plus.py
from odps.udf import annotate
@annotate('bigint,bigint->bigint')
class Plus(object):
def evaluate(self, a, b):
return a + b
$ cat plus.input 1,1 3,2 $ pyou plus.Plus < plus.input 2 5
Contributing
For a development install, clone the repository and then install from source:
git clone https://github.com/aliyun/aliyun-odps-python-sdk cd pyodps pip install -r requirements.txt -e .
If you need to modify the frontend code, you need to install nodejs/npm. To build and install your frontend code, use
python setup.py build_js python setup.py install_js
License
Licensed under the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pyodps-0.8.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21111c4e0de620d41417fce4b0f64257de38b8fd8b1f6ccaae6dd3629c3fdf34 |
|
MD5 | b50d7065b0a3a475f380137503cd5284 |
|
BLAKE2b-256 | 8c4ae23db151baff8b32673329300dbc0d1e20a1f03fadb0799b007ab7fd7f9e |
Hashes for pyodps-0.8.5.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6853302018dddebd134c1096a3840ff38af15f2e2d2c354ca6b0a6a36ab00d2 |
|
MD5 | fb8ac0b5e713e1a15c88dfcc2ac0eb9b |
|
BLAKE2b-256 | 665067e80d3058f344dba2d8368e3d52bb5cbc992fa1de49112be9fa15301d11 |
Hashes for pyodps-0.8.5.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4247f73dbe14866e2ea11ed562bcd9a5c851b0b487c544f020f5ae8fc0ad460 |
|
MD5 | 6a63676dd78a2819c1393a00ba9aa988 |
|
BLAKE2b-256 | 048d7a3403fc6272fb751aaf7dd01c9d5ceed5f659c3ed590b32f18992051089 |
Hashes for pyodps-0.8.5.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e10fd0e083759220e7a54e5c553c507f31f39eba4d02bab20bc27c221a6b000 |
|
MD5 | 6abbcf4898912428f554d4a71e350ee7 |
|
BLAKE2b-256 | 22977f51dff4e5de31096d5bd741e9c9cbb88daf8bc250222bed365ba20de87e |
Hashes for pyodps-0.8.5.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 233f2084d2c3178882bff909510497b8f2575759d0f8f19562a4a0248b33fbc2 |
|
MD5 | ccb75e75be2ff8d63c1ba771da890796 |
|
BLAKE2b-256 | f959767c9a35317616be99eda93038ca80f5e2189305631aed7819bbfe0de20c |
Hashes for pyodps-0.8.5.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d96be842d4080b70261294d57d299c645ba0ae21a886c373de20690ae93d2e |
|
MD5 | 229399cce92dd36822795104525802c6 |
|
BLAKE2b-256 | 4535c01c85ed64a824f402cf48f77e25d2c068523492d179eb03b86d98b26833 |
Hashes for pyodps-0.8.5.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123fd243ea09942a17e841bc01da4bb3fdacbfb247346ba4a0fb4967884c6c80 |
|
MD5 | 026bf32c465256cb46ed64896089e1b2 |
|
BLAKE2b-256 | b73404149db3516b5efc087040df45db19823f644a12a2d2be25601ce45a438f |
Hashes for pyodps-0.8.5.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48922468328b46c866120750e8c87da315cc27a220b575f51633c2724c2e6ca9 |
|
MD5 | 4a853b8899881cfd2b6fa13f1b011c8d |
|
BLAKE2b-256 | 4c67af07fa3dbc157a50be7d5e0280a6883f9566dbd78fc487ae191246fa6d3a |
Hashes for pyodps-0.8.5.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 475cec9ce11cb8c0e9137afc7c939b5a2912ac750fd5bad4512b137d2d451129 |
|
MD5 | a74691074f56bd9e6d8ee88eeae4cac6 |
|
BLAKE2b-256 | 54de4fc37ded803d750fbc017c63f7c09797184476e3f7c617839bb5e87560a2 |
Hashes for pyodps-0.8.5.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5de0f28fd7be5ec816b54934fc8ba0ab0d523d528853c073b445bdaf25bb478d |
|
MD5 | 2d120ed221ba7710da70e5908d34fbb1 |
|
BLAKE2b-256 | 8429e9102d53ac703c329c4ebecf15d0ae41ff6452f2898d0bcd3cab8291ac32 |
Hashes for pyodps-0.8.5.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18d371f78cb72926e035c24e3e4a267411feb7102fed4277c7f23ec4cd027ef9 |
|
MD5 | d6aaa4fb627174011b3d210c618a271b |
|
BLAKE2b-256 | 554851a6d62299118e5bebe742623b1281026379f69bcca081c142425837618c |
Hashes for pyodps-0.8.5.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1f825c2f99132a162e69c2ca11e5b29a9d692d797993b78896c42920733faf2 |
|
MD5 | 682e2decb3263f82f0631fccbe7bdd00 |
|
BLAKE2b-256 | 6326c7ea0ae04d0a94b53464454111d1979e128c459e44bc683cfa0bd83525ab |
Hashes for pyodps-0.8.5.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba28fabb719a80a73700be8574892c9638b763e9b9fe58bb45cdfe52537508a |
|
MD5 | ace8cb489a3fc7b8f3ed42aea6fea28c |
|
BLAKE2b-256 | 181ddff180a38f1ce3bb2614dbdf9eb3b1bec3129452539ac566ee91a877ee19 |
Hashes for pyodps-0.8.5.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d90f48c1df8b1f61dcf45c11cd91114959fba1ba1d3a188a6ef3e143d9037b57 |
|
MD5 | 05fd04a1feed0bf0e6bed23116f30b64 |
|
BLAKE2b-256 | 4a4ed7849dd28e191a322840261c965b343cebf03c3b4401d8da410c37da5756 |
Hashes for pyodps-0.8.5.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c8843abb44fcc18612fa6b9574aa46438cd705ebde277d73200e56dedb9e8d |
|
MD5 | 69843ec2ba43a638841918bbef9f09a4 |
|
BLAKE2b-256 | e6ca90162a93dfe549560d3dc9c043e744ab22343522a4ea33c205c28ad82c6c |
Hashes for pyodps-0.8.5.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41aa7b44b11cf698985795018ab2a147cf16f6265c98ef07b8b35ec29106fae8 |
|
MD5 | 76d51444877231a14fa3eafddc0ed81c |
|
BLAKE2b-256 | fcb2e65e95f7116a9eb2c225c299a6a1312b9d6a6bafdb6ddf93f6012e0e3109 |
Hashes for pyodps-0.8.5.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2359a2bae92343d4e7c024b034580ab8d06b9fcdd080f760c46387d24b1f0af3 |
|
MD5 | c7d2dd04d1256997cc41ab41adcd95a2 |
|
BLAKE2b-256 | d4a7dc5e5532b766f1a157f4b6c02a5025a5eea8f9a6e6443cc1a020fb8e1862 |
Hashes for pyodps-0.8.5.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2a62a2449be3b7ebc41926425cd6e06ba19fc9869bdc1aaba0b4184ff09928 |
|
MD5 | c737cf217ce845bd2e558611515f11e0 |
|
BLAKE2b-256 | 94f5ecf4f44531a428a8b4be858514f22d1ef0a276c4df01a0c796b474500857 |
Hashes for pyodps-0.8.5.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e773de568683a73222604bc21c8af7e22cd19662191abb994755d64574df8cd9 |
|
MD5 | 699e4f61df3d6ac59a590e39bc135d37 |
|
BLAKE2b-256 | 83dc19f757f522ebae8b140b4c65c220b159a13239775b84062c4c1e9237cb1b |
Hashes for pyodps-0.8.5.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c412ebdc2b5f6f971636af61179e08437f45269a5f56f753aa8b0ddeaa241a8 |
|
MD5 | 468866470ff1e7f4a0aca8f3e37a691a |
|
BLAKE2b-256 | 2c3b70200136361b0b7cda36a9152b3638aafc0863b38640d6cd45e1e2c27e8e |
Hashes for pyodps-0.8.5.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a12747471e23e6918e7c1a05ccf282932fe9366b2a25c95f4841c8511b402d |
|
MD5 | 022a75b449a28eb72aa2ad620c15ec40 |
|
BLAKE2b-256 | 3e096c59727da17a07dc875265023a0b1bb34f45486ef40f98385d24fa23f07f |
Hashes for pyodps-0.8.5.1-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c94950bbc7c156f59e83272b2ac5091b0d4e6aedf36eb3a4ebfcd7d3fc8345b8 |
|
MD5 | c7f403b77ddef70997cf064983ab5932 |
|
BLAKE2b-256 | 73e66f92219dcdc825486337c6c440b31d70a9c34f0f3325450a2b3401fa38db |