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.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.11.2.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1224377b7e00b8b38a728409c8894214f5eb97ad3978cc7d55c961e54947f496 |
|
MD5 | 5045a2adcbdeb59a6b601b0b5e4abe53 |
|
BLAKE2b-256 | c0c6a8965edab91d0e707fbe92320d7bc16209fa5300fcfb093b3db6898ac88d |
Hashes for pyodps-0.11.2.4-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e1619dbf423e7901c21efd5a234cbd0b100e98c2eb5792c12b4d53c383d93e0 |
|
MD5 | fea6820d8ab701fe6e655f4f7d68fe1b |
|
BLAKE2b-256 | 9b026d85f96d26e186ff7d9a1203177956fac52f61fb86ea8abf1e93ba6de0ec |
Hashes for pyodps-0.11.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646c6f4219fe4e9dea318f3134b2edba2b01c5b17d488b79372ee0eadd557a42 |
|
MD5 | 998d1a9415b030da16eb608dacfc2aca |
|
BLAKE2b-256 | e9e608b8aac8c489384bc67fb3ea2bf357e3d098ccdb5b3b13c290ec28f14988 |
Hashes for pyodps-0.11.2.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa8486ed975dd13d2e757767de33b2d6fec12dcfb3b4eb24ce785378cbc7d639 |
|
MD5 | e804df0abf3c7f3f0040e5b880ccc569 |
|
BLAKE2b-256 | 60704fd6ea6a6c912e19735fe410ec67694285b8ad7fb7db615623ae400fbd89 |
Hashes for pyodps-0.11.2.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8ed65118a1a6e0c7e0e2c208a59accaeab3e0801014ddcb278ef9d00bd7aa6e |
|
MD5 | a1a20a67bba4e3953d92b8b3a699a4a0 |
|
BLAKE2b-256 | 02752d8d7b5725311dacfd415f5cd0560fc2c11a87ea3107a0393b81222ab423 |
Hashes for pyodps-0.11.2.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb8af0ea4a3970e48ef6eb021460e8bd0fd1c4274748729b8fabd60bd4e1a3f |
|
MD5 | 4d35d04cb7b4de7b205bcca138e8e2e2 |
|
BLAKE2b-256 | bf95aae637f3895936c6450556907cafc1e454d1bf2ca1ee84bd990104d5de52 |
Hashes for pyodps-0.11.2.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4481b0853f3c8a2d8fdaace6a5778fafc8c794fdf96f4b072e8261aa0c2a72 |
|
MD5 | a792cb07f2710775531022ed8245da51 |
|
BLAKE2b-256 | 3ed2df2c7c66da14518c9c112bed51ff986c48cf062fcf6bb271501c46a6cb80 |
Hashes for pyodps-0.11.2.4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729337f22660c8202af9e6b44f171b2ff5ed22322b24947db1e0b058c1a9696d |
|
MD5 | 36ed443b0c97c6ba7c89b2bae2c73df2 |
|
BLAKE2b-256 | 779960cc400ac86e872603c0263a8d96e847940f07f5b28e6c5d7f2d18c6d043 |
Hashes for pyodps-0.11.2.4-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4de7bac9a66715ccb0379bfef69c449d97004d78c65397e5de3b4f897ab019be |
|
MD5 | 5ddde06e99f1e04eb899850e80f89ef1 |
|
BLAKE2b-256 | 7ff86d1fdc058eed3e2008cbb086c1e0d48c6e6ba65e18c1ba14deea793e9ecf |
Hashes for pyodps-0.11.2.4-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b49894f27b038532b23bd27501f9961c8bada24d53459ac3e064e548f4b546 |
|
MD5 | 06f2f20271087dabf1eeabeab894f242 |
|
BLAKE2b-256 | 7c79aaeebde0736f241d4087c42e0df1d7513057afc4994198d747709072ea4e |
Hashes for pyodps-0.11.2.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6985e45275b6891598c730dd57ee58a5a0e1885f94bd453b49402fb6070bb8d4 |
|
MD5 | 3430f559791bd29fe078ea58b26d4568 |
|
BLAKE2b-256 | 505185e25d056fd673b31551b24f9235955a3e4a4ba857b34da0a89864c34ae3 |
Hashes for pyodps-0.11.2.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c105c8578ee3881e2b63deae59f419bf7e6aee5f445856719be741600d17e1ba |
|
MD5 | 4899e8e6b8de1b5f97d5a49a2b3c8718 |
|
BLAKE2b-256 | 85371140493a959db293850e2334609e9a6a529aef98778fef0a5842b283b3ce |
Hashes for pyodps-0.11.2.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38bf45ec9f79c660edaf255fa293f87e2fdb5f3d4a50133bff55ff21ab810b98 |
|
MD5 | 9e01bbbc0f2bd169a7532a3b6154a746 |
|
BLAKE2b-256 | d0b076645337e5ca596817fab7366ec1293f9c58e00ea15391947a4d5ae8cbe9 |
Hashes for pyodps-0.11.2.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef0dae7e7161ffc0d36a25abec7d2088978e05cea1fc5b63ab968f8a956f75ef |
|
MD5 | 1189583f2cd643d5813a5cc9abbb8a37 |
|
BLAKE2b-256 | 06897ea2521d19d951396d1fde297b9b6b6e9a21971fc51804afb210bab8ee3b |
Hashes for pyodps-0.11.2.4-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8eec82a27c1c01e074d55add23b1973e9f10a38e719d85c9a4de159c0f4d50 |
|
MD5 | 651739cb5718a805b050e72736761cfb |
|
BLAKE2b-256 | bcc5012fe7639fb6a7fb7812a010d14d6d4212c0d68115e89ee2b9bbeafbcf92 |
Hashes for pyodps-0.11.2.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 500041ad4cb9020d13ad41454893e9f7b18e4c2a6bc6e1b81f8dc6e7fd0d8b5a |
|
MD5 | 3016577b1d0420cfca29e5d27fd3f2bd |
|
BLAKE2b-256 | 5f303ecbb7b0e62f2a7ea395b6ff852f59d885eebd13792b24d7349725e165ac |
Hashes for pyodps-0.11.2.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99406b5702e7bbb9cba07ea3d01b57166534b5e22dcd26c7701c3a7a1929bf79 |
|
MD5 | 9970400b3fe3c3f8cd245127d8aca4f9 |
|
BLAKE2b-256 | e1ab93d4f1898aabbec2efba083f8f7bd89dca195be71bf6f19f84ab2f030c3e |
Hashes for pyodps-0.11.2.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc1ce725ea6fd16b2c476faf710045c5a5c5b34cb6c505d2e89b8e1db8fdb77 |
|
MD5 | afd30ff4482cc472d78e08626a98cf8c |
|
BLAKE2b-256 | dbccb82e8556e9fc313780577d9ea9c1e6d4fba7a39d97876778ff014fe1959f |
Hashes for pyodps-0.11.2.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28bc64260f1d7c43388889c1c499a0a19bfd2ac407e76631268485c7e0dca847 |
|
MD5 | 0cc5ebc46e42642b7920891a86b549aa |
|
BLAKE2b-256 | ebf96a38e0c996c58741bde00cf46cd28b0d4dc837d3674af68393bd7124ae2f |
Hashes for pyodps-0.11.2.4-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179ddb9e790a5f937016610b6bf7dcc15e9aa74fd9ee5b656b776a77494ae467 |
|
MD5 | 33c5f47f8eb9e4200306d7c8c578a74b |
|
BLAKE2b-256 | 2270498159aa481bbf48e16c11386fc6c7f70dc65fd71d405b0f343ed9e0b5e5 |
Hashes for pyodps-0.11.2.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2515cb63e52a95fa9546bb25573d5469aa4a379c014a0871cdb97862998d1201 |
|
MD5 | be948d92e74063ef299c21a797691b01 |
|
BLAKE2b-256 | ef4c8e22f243c9d37f2cbee2b6cbf294d2362d2257d4968e5b0e1b94a296506e |
Hashes for pyodps-0.11.2.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3205808f7cdde70e57f9b0e8a8b83ea263f8fa0365206c4ec1ee3ea8d79dac79 |
|
MD5 | c73f4d7a63af8cc3876e47b51fed0bd9 |
|
BLAKE2b-256 | 33b13c937cb534166274fd670b47cc39956d5e977688ee9829b62e846681f2de |
Hashes for pyodps-0.11.2.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac6ad124068bf3783fe7465471e85f4f2f85e329d63d9baab1d8b29f15825fa7 |
|
MD5 | e3d6c6ab0fab79cde655d7ca9cf99d18 |
|
BLAKE2b-256 | fdcc694f39cbf382183b5d9b6c0b8d9c4a43c2d2bebc574f708a57bcd238fa66 |
Hashes for pyodps-0.11.2.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40ad47c3edb72b388d8dd51783c9ab1ba5fd4856811f07ae56e90a88784ddeca |
|
MD5 | 0ca48d930b29978f7aeced3705d6bcdb |
|
BLAKE2b-256 | 2960f8162c7c1442ac470fb268863d65aba13072cd57ce87d2ca9f9c0f44c8cc |
Hashes for pyodps-0.11.2.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e49583b2f4ff1f823b761576c805664ea803441eeba329f558bd3158d02a8e5 |
|
MD5 | 913d436889eac73d1d37a9c255875538 |
|
BLAKE2b-256 | df8684be33489f0e3647e1333b704f1aaa98eb71f19d34b213511b4cf8bd3f82 |
Hashes for pyodps-0.11.2.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c034124dc3e621ca3feebcd12205d55351e2047c4f5fcaa30810e47a949600f |
|
MD5 | d0c08b6c09626fe8fb10cce1767e75cb |
|
BLAKE2b-256 | 7e7b21c8bdc6e24b9273d39c2367ae164d15599523d18fabf4df97d4b956f8ce |
Hashes for pyodps-0.11.2.4-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 492d36e3c236f7df82133167cbde8f5d298bcc1d8d2e44f329d8e7054d95be80 |
|
MD5 | f1387ad7aa6f983fc1c48bcf5392389c |
|
BLAKE2b-256 | f39e2e79d74d7de3b1cbd7a97fb3c2ee3b5a0be4d6435d9e44750f44d6e96650 |
Hashes for pyodps-0.11.2.4-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d7e263ba30d842e4312a6a640d5bd922c397feb8b59d15d0544a3a1e33f7016 |
|
MD5 | bac732df745ec871a0d6d0bf7ab9393e |
|
BLAKE2b-256 | afcdf9ccefa4b4a4023511fcdbd98477f09590eb013e215965b223c9b780df2b |
Hashes for pyodps-0.11.2.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd0637ddb77a86faf54c88ef725601c9a11af3907e839f8b723affc56bd1d1a0 |
|
MD5 | f98ee429dadfe6a3804a503b318d6140 |
|
BLAKE2b-256 | 9354a86f1ab117d1655ef4b5e840d1dc154ba1767b28034f260173a43ac0e348 |
Hashes for pyodps-0.11.2.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 416eb3d6c0a09d754d7bede6a380c17f8029ced743fad052c6a3733551bd8b2c |
|
MD5 | 82b0d5d4002f803c5e904d0270fb793c |
|
BLAKE2b-256 | 892a1bf1bc766ad44fed68ec140717d61fc92d326f6c563ccea24c988bfca55e |
Hashes for pyodps-0.11.2.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae32b4b56d273c9e5b6c46517e0ae46ae56016517fac8089acb22d2e1f604f7 |
|
MD5 | 3ec598e8b653701942de46c2771b26b8 |
|
BLAKE2b-256 | d9d4c15e1b35290d2a42daafab876edc74a3d55ed895c3d03b43a0a1573a4431 |
Hashes for pyodps-0.11.2.4-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920383319eb82595ea5596d8b1bfc6db9abbb1b87595111a112d134c8a57c078 |
|
MD5 | f0a423d207de5c672b6d7cb834f175b1 |
|
BLAKE2b-256 | 0d722315e55a257fa5a73481400abc6b3e09cf7fed153c497e341822bda3959c |