ODPS Python SDK and data analysis framework
Project description
Elegent way to access ODPS API. Documentation
Installation
The quick way:
pip install pyodps[full]
To integrate with Mars:
pip install pyodps#egg=pyodps[mars]
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.table_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.table_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.11.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f90f8618115afe261fc38eda3976706d6a141c891bf200a2a695e4eb85a5af |
|
MD5 | 47922f3a2293877ae35bb91cc5be6d2d |
|
BLAKE2b-256 | 5dd0d11f16caa71505d62fe3bcebdd0ca165796bf8adce6635fff16e23daced4 |
Hashes for pyodps-0.11.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0331444524937540ec258bec72dd42c4737abe15e25031967a16164cad0f133a |
|
MD5 | 98be5d255d8fe174bb131dcc172e97b0 |
|
BLAKE2b-256 | e8f136c40ce9b6f3288b1e636bfc7bb4351ac37c454d488277ce5b0953ba8343 |
Hashes for pyodps-0.11.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3525b5d3be71d90139415745fa5098489b628d917c4563f8a922b3b167833b84 |
|
MD5 | 4b003d5524220179a5843cf985ffc08b |
|
BLAKE2b-256 | dc1e61b68c7232fa5702c20cec9913879206193695e423149ca296b9b6d0dd33 |
Hashes for pyodps-0.11.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9418aad79489cf8a8f23324dc5bf3d0a95e19181805ee3fe94d9d96a69fca4cc |
|
MD5 | ddff249c7ba9c2481e41b80628dc89ca |
|
BLAKE2b-256 | 21acb58c9bccd408199f4612577a822a68daeb0a1a5c7215d951901bb36d3776 |
Hashes for pyodps-0.11.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d217d9b7d3065e9dfa6e674bc86512ef0f75574f8d4740da38520181f4abc57 |
|
MD5 | c77c595db1bce6b0d7315cf76999739c |
|
BLAKE2b-256 | fc5a880a39da70414d53b97ee65096dac91d38b0489742a1dfb4e0b688dddc08 |
Hashes for pyodps-0.11.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 992ef1852a9cbeff2b0b7cc18e0ed1c7a34df0fbffc2532432434f06d8325a43 |
|
MD5 | d60ecc1d4a2d972efb836b3264ae7a4b |
|
BLAKE2b-256 | 3559659f7be5b5949905bb1508be07f73f8bd88fef358d20a814b43ef32c1a04 |
Hashes for pyodps-0.11.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 811e167a8b0fde9437fabda0c71a103a5470121b2b1d3cd7f7a27c4e957fdcc3 |
|
MD5 | 36556066e9b15c502c5c7df3d3baf685 |
|
BLAKE2b-256 | f57e42060f2b7efa9cb60761085d08f1f39c2903e36fbf56fd8aa9db3441d633 |
Hashes for pyodps-0.11.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60d052cbfc32e7a2462583b9aa1e9702041764e3fcd36728f2c98c769e80d113 |
|
MD5 | 2e74e0f55fef01a7710e364bcc5d747b |
|
BLAKE2b-256 | 81addb2ca84173815ff178091c0ef397ca6afa79cb4db98b7a6c30082d78fe08 |
Hashes for pyodps-0.11.3-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b01240494c66aa831f4df2de36514367fa4a7f5095381cee0eebb590ea4e26a3 |
|
MD5 | 15a858f032832e65e15ff17f287acbcb |
|
BLAKE2b-256 | a852e9518db578824c59c213e8e83b00c26b6c63abf6d87536be28be6d19672a |
Hashes for pyodps-0.11.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 990d2a9d04a0927a614eb5b1fe61dae3272bd1aa9cdb3e3f9dae44b13fba1ef1 |
|
MD5 | 2b1a955ac5faea51f64e92517270c09c |
|
BLAKE2b-256 | 9e4bd985d90600b433d7b08fdd44d91b366ee51bf5570acf3cfcf6b652f0da84 |
Hashes for pyodps-0.11.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de8ec658bc5cace02d79c157f5d7ee46fb0da4c770a9fee026d4f035afdcc450 |
|
MD5 | 5323ccf8f660b8737425c5bf212c95a6 |
|
BLAKE2b-256 | cd6876acff7513622fe42a59f665689fd80aa49cdc618971dbfa9be0aff5f6f1 |
Hashes for pyodps-0.11.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c49a9c9aa1310a12e078d751d72a80a5b0527df095bdf84cb26cc02453a34640 |
|
MD5 | 9498f8beeedf07379960e1c9bbc59bb7 |
|
BLAKE2b-256 | cda27c5404f814c7e437b343254e048dd07dda741106794d74432bd0ee82d50a |
Hashes for pyodps-0.11.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 570243090c3f4249017336adda990a805a6efae9ebc1397756baffeeb4ca42e3 |
|
MD5 | d434a2f290696f69894862604bf6fce4 |
|
BLAKE2b-256 | f47f220880f89a7254f62171857fe94ee62e55c4fe3e8eda17d3a6a1fd1f0af0 |
Hashes for pyodps-0.11.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f3bb384ebb0d86e576e6843d135b2943663870ed35d7f01ba4ee23dfe224b3 |
|
MD5 | 28e6113da3bb1f7fa9e28d8ea78d8e7b |
|
BLAKE2b-256 | b993101755e06948e5c7c0c6ada5ab1e69606f4c96db33c6abee87ccb38dceb6 |
Hashes for pyodps-0.11.3-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8380b4a3e26a718f8d0f89b67b7b6b9a58c53990dfbb94ba5e336bdcb44398e |
|
MD5 | 54168fb7564f798753972277efe0abf2 |
|
BLAKE2b-256 | 55846ac744e747fa50370b3a6608f62a305f46051aba02b76a412fb86c74b4a0 |
Hashes for pyodps-0.11.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd0eecaeed869816764edc3a29fac1a103aa4676a21db74bb087e3f2f0a4fdd |
|
MD5 | 27dbab36d17c99cad3c27b588498f1f2 |
|
BLAKE2b-256 | 99808ff19e079b31d8b0fc7d63bc2763b4a63f1a5aad53835dc1fdf8b462a607 |
Hashes for pyodps-0.11.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 011297744ad8a4525e81c767a7233894000244a5ed7d334ec5ffd477a8628147 |
|
MD5 | 30c407ea06e8e797ba783f665aa9b7b3 |
|
BLAKE2b-256 | bd6624dd3301867ce70fda4e51779e34b720bbd8ee05f298c4bc7f582200095e |
Hashes for pyodps-0.11.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6718c83f17ad9446cdaa55611f9ddcd93b6720331359c6219991b6f48930b7ee |
|
MD5 | ff329aec7910d56549c34dc9a6e58786 |
|
BLAKE2b-256 | 6450d4dacfd9c147c320ddedcc26272435de5017154025a3bce0b153b1b8959b |
Hashes for pyodps-0.11.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9164716b1387729026690c91bda032d712a1d625f92e76d90e4dd47b404ee890 |
|
MD5 | 84c6850fae258e6d814220653ac79b89 |
|
BLAKE2b-256 | 604ae96da2a1b0a1d96484b62141835ab46e2940edd9bb284c4a21776f8c8121 |
Hashes for pyodps-0.11.3-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b51c2751690cb201878e24cfac9b0037f63c06b65df0c8151b0125d953e6ff48 |
|
MD5 | edae5b9faa9e1ec5918273df643b3e8a |
|
BLAKE2b-256 | 280e8862ac3c73a9f0d6ffe7278f021325eb23d120ee5d0ca17d436a14502437 |
Hashes for pyodps-0.11.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ae216f0133c5e612c162d25be725885e68f0c1043ea578e3c03bf13d60295c |
|
MD5 | 81a5ff655d84f55b968cda8269ef00c9 |
|
BLAKE2b-256 | d340bad6db57ef128382913039cee61d609eb252b6ff7a7fefa5d9650134a477 |
Hashes for pyodps-0.11.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff73d4022f9505e13732a583b6ea79288b61f57c051f9720fe150af0ff8d8649 |
|
MD5 | a8b05af2b17fb388b4d4ee65bac64621 |
|
BLAKE2b-256 | dfabe27b71f1a0c0a18fb708e2da32f95e4d0c894f317a90772db58076c7a690 |
Hashes for pyodps-0.11.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aa7401dc3366649bb30aeac141458bd9962c86c7ca15831796727157679be86 |
|
MD5 | 8a1e52946befa566836e2fbbcc2fe7d0 |
|
BLAKE2b-256 | d9ac6a1e99b501b0a736fc61f9a853b1cbe37a7797ba130d7d812186508f2fcb |
Hashes for pyodps-0.11.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9f6553aaaccc0d90d2f8a4e67e2763051752db33fd45e8f37bf8ed4d01fa10e |
|
MD5 | a3e272fb0a99ba120109caf48f90e68f |
|
BLAKE2b-256 | cfd1b99b04b02b171edf5e2677bfda320b019cc7b4a12ca8004ef0c6121f5e39 |
Hashes for pyodps-0.11.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3773819f8979e96d7523520644517c3348b42171a04e583bc720622b16617dd |
|
MD5 | 238afb6affa2e0815879b79b1e7f217a |
|
BLAKE2b-256 | 35a24c3cc3359e9da28480d0961c1c26b0ee9b43f8f8c57e237340ec98aaaaf9 |
Hashes for pyodps-0.11.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5284539bdf02ccf6cb394fe42e9ce4fd7ef36dce4160fd62424b07e12ab88ddb |
|
MD5 | 7441cbc090d06d366ce4411596cfafcb |
|
BLAKE2b-256 | 4dab3c77c87ae7bf44db765ad774d21c60ad7213998cd582d55c16c6ad59d0ea |
Hashes for pyodps-0.11.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10fed732394916d8abd8fb033139705964deb78660197b29415a5f17995c81f9 |
|
MD5 | 562bc6df7b9be0b3eff17da4221ba641 |
|
BLAKE2b-256 | dd84665323d5c3c310afc98dc0bd9f2545545ebcc6489bc4196dc4762a372821 |
Hashes for pyodps-0.11.3-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceca7a9c19417852d4542eb2d983c0f1e7d0f352bb2317730ee0e226a62c8eb7 |
|
MD5 | f9174964ff91b6b787bfa556d609aefe |
|
BLAKE2b-256 | 2a2740437f82fadecf8330bb3538a0d1cb595d9cbabb8479d87fb79ea60178ff |
Hashes for pyodps-0.11.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698ab8838c626e6d9ae18885b9fdf7cf39640ba49097d92622d4e9c30113b58a |
|
MD5 | d71a775e7b6d9e2b274bf809e9680c83 |
|
BLAKE2b-256 | 09cc05094191de0734eeefc30ff427882b4dc8066d62cf43e83bd3b03daba37a |
Hashes for pyodps-0.11.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c19cfaab17ff12dee1f6c36af795e4dece7f69a922fde01e59492c4f21cc77b |
|
MD5 | 305bc7b238d08da9343b33b1eda67a8a |
|
BLAKE2b-256 | 42e1501f078f4c92a3e679880ef56dc03f97faeb2ed8ffe5d78e21164c7baa7f |
Hashes for pyodps-0.11.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d375ade1574a052b251f665f1985aeffa99d860a9a69de1996e2fa2e68b9eb |
|
MD5 | 068f3a546416e38d56db729918c29aac |
|
BLAKE2b-256 | 889caaa0d19660bf653f041ed45afb67efe2541487de635e04806dfe6539ad79 |
Hashes for pyodps-0.11.3-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b60d1fdb97284561923ac14e6a59ab41e10bc66733625b8584fec9e8464a7dfe |
|
MD5 | cf3bb7401f284656eeaf52fd230b4d62 |
|
BLAKE2b-256 | faf85f8e453b831a626d68a030f19be65b39fdd4ebfbf3f580939cadb1603319 |