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.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0690bd256a66186a7f5448bcd56fb8095effc35a272c1e7f015c33dd07942100 |
|
MD5 | e1c8fe06212cd7ed40c0fe00833af57a |
|
BLAKE2b-256 | a12211933dc47fd3f85d33de4385487d7c0e3ae2940f0d78fa2c906c64cb28e5 |
Hashes for pyodps-0.11.3.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38124647ef275cee89ca338043923ffe7978734a32dd959d4d55489eb87c3107 |
|
MD5 | a9a1522a3cff3f8bf996c2d7581c9866 |
|
BLAKE2b-256 | a4d4481de26155d8eaa3d889d9d1157bc885b9dcf428eea2ee8a00ec706f47d7 |
Hashes for pyodps-0.11.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd7017f77fe0d8f252c9a3a5fb71f324ec64dce78a4496bdc69dc7372adf1c8 |
|
MD5 | 77d17ab785833f4a65adc737875c0cd9 |
|
BLAKE2b-256 | 712565d0747a89624908379b7ec706a293d6c95d4560dfa1c832116e16faa384 |
Hashes for pyodps-0.11.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1372b65da91d06786b223681c7de70da9686e4fc0981d54f82d31b9a75fb919c |
|
MD5 | 6cc204cde00a3a4f81e067752e96784c |
|
BLAKE2b-256 | ffa6d4cb5aa13c7d5af578ce8da7ddff3ac9e7e8358040852a6cf93b4c6fc657 |
Hashes for pyodps-0.11.3.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eafb158ee899fe9b3888ca59f69c45065678ac9fae4ef96a574debaa0eb1b73d |
|
MD5 | f05c02eaf3126af9cc72b8371e74ac2a |
|
BLAKE2b-256 | 582edb3ce48c403b22502db5266b269887881e0ea0381f1fb90cd1c579ef774a |
Hashes for pyodps-0.11.3.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0418c08326b4a5212d401ddd5bf913182df0e55182007746c6e79628c22ea87 |
|
MD5 | 962e9842c5e70b4f6349ec48ed152bf1 |
|
BLAKE2b-256 | 5c82e74c6ffdf056f689f856264b59def7d23c889b5056fd99206bde465c822a |
Hashes for pyodps-0.11.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10b8cfd053ccf2a39b2bf9d59e500bdd48b21b7e0824eba3769c66eb027674b2 |
|
MD5 | 2f2da21f2d5ebc0e8a5eb8c73a25d73f |
|
BLAKE2b-256 | 212c669492875eb284072511e94a85d75a8fefffac902e19e8b01ae480313a2d |
Hashes for pyodps-0.11.3.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d476e28103f4dc0af1ccf877ecebc613845be9948a65b8e06aed67ed73fd55da |
|
MD5 | 70d4ac2b13bdf04b68f21b57fd2670e8 |
|
BLAKE2b-256 | b1ae9a56cb16217fcdf6f09de13e33d3dfc1c4d6ae314da849450deb6689e397 |
Hashes for pyodps-0.11.3.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cce7aa94fa1ea67011ab6368a64f3e184539a9a132821941c531ff7b5aff9e65 |
|
MD5 | 62c205c1c0ecc4747cce11e3397f0900 |
|
BLAKE2b-256 | 8274d0af0d8446de6d4bb70abe9a83f495294f4b8f9d838819fba63612483005 |
Hashes for pyodps-0.11.3.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec23c6e125dce6daac37899176e414b3f974d519e906eebc8cca3f88409fe2e5 |
|
MD5 | 5a79b1051a5151c722d1cd0d0e88d95b |
|
BLAKE2b-256 | 0eb8ee3c0376bab1476b64d066f32a4ec3a94986cf0eb259f63c828c1151f9aa |
Hashes for pyodps-0.11.3.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 628d948f7191f6c12b1dc388e0a1408cdcd113116e9bd67dfe5cf5a8e1438aa5 |
|
MD5 | 2b2808be66cbdc4e3f6622c40f9d9c22 |
|
BLAKE2b-256 | a5c7c16fb3f3faa83e26cdaea733cfb0302dea41a6bc007dba3cd28feedc9230 |
Hashes for pyodps-0.11.3.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a2e7214c88e87501f8b1edadb7868c648a8f844139d8403f64ee31de61ab979 |
|
MD5 | 438e7b833dfae48bdfe640eeb90bd6e6 |
|
BLAKE2b-256 | c04a0812d30c5246e3512b87133fe8df32c9c975ec68cfad59947dc1c32dd16b |
Hashes for pyodps-0.11.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 818a092aeafd74e9745af5c1c0b285892c4211c0cfa62ef6598d97e9015b38e6 |
|
MD5 | ce09db5899578ff0df5fa5b9a95f66b3 |
|
BLAKE2b-256 | e422765b0bd994ef4c5e9ef27fcdd1c206690ca876dc744595eaf5ccf3e16781 |
Hashes for pyodps-0.11.3.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4911ebe8dd19ac55d289a9097d558af6a42ef226090822eb97a5d037fc8619c |
|
MD5 | 2281d81a9cb3a574e5ee906b5f161b58 |
|
BLAKE2b-256 | 96ef251ff69fa97879919b65f4da88d1cd575e6ae0fa6e7b472288b0ba9f00d6 |
Hashes for pyodps-0.11.3.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e82da08de5e729ba96ae98b67145800cdbd1f4e828cb12970f6b82f3d9b18fb |
|
MD5 | 9c040e3488fbaa85c14bcb520d05d8af |
|
BLAKE2b-256 | 28e8d3a8b3517044b69340ec80145501fdcfad14687d3a4f3d208d4076f3b3d5 |
Hashes for pyodps-0.11.3.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e1d5ee403fc0e27f6125226974323b546b23790405bda5d23b3d9bced77b331 |
|
MD5 | 727495556affb803b05da1e19ff79ba8 |
|
BLAKE2b-256 | 146cb70edfd0f1eb689b54852b35ec6d4d366a40203cabf600d6fa54f457fbaf |
Hashes for pyodps-0.11.3.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80f16bb5ab9b2ec760dcd3bb12bb29b0c3c9899da69e35e65403c0c98aa350a8 |
|
MD5 | 105192a01267f84c584018d83f1911b0 |
|
BLAKE2b-256 | a9bc12d906abcadd3a59f7088dd77175f1718a803c8e897f92dbcbf622de1489 |
Hashes for pyodps-0.11.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31cc553141df18657c1c95c49c23fedb2ddd8c0b3a24dc256feae2b889d4c1e2 |
|
MD5 | c2f1de99b72bc66b4bdbff5dd316ed68 |
|
BLAKE2b-256 | d215c47fd539e3e6a0770163298c7c005efe2a580dcd5b5d87ce02d2d3f657cc |
Hashes for pyodps-0.11.3.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a709d1a4281e671950fe034cff2d48d8ac5822dc3563947d6a43b2083d9a528a |
|
MD5 | 19cc5c1399292e4246211f685ae442f2 |
|
BLAKE2b-256 | 9b7c0129fd35130da0a41981a9b7d32860d517d379cb7d89deda36b15ccf3e32 |
Hashes for pyodps-0.11.3.1-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a25b2287fd7221a5ce534475c9c3074e7ade5b57544576057549ce93df1f4972 |
|
MD5 | 2f429a950e24fba713917a54edda8c8e |
|
BLAKE2b-256 | 26ce5769bb42b41eeaa48e25bd54ce1badad9c02f643babb6963228282e378ae |
Hashes for pyodps-0.11.3.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c132db8c4936228d8dc8432f6cc5fae6bf6b40ea740017f59934533cc28970e9 |
|
MD5 | 22a2be550c630fbf00c07851f7c19e15 |
|
BLAKE2b-256 | b1f531c47f1061e8d55691fcc8a3523787e4f71693f6b1106dc93415b0450a5f |
Hashes for pyodps-0.11.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a42d9d220c4d5a53f47098353ef3a4042b37ee7235f6fca90c5ec29031e26f |
|
MD5 | 29f50841025b7aa7f30f0e07b747e9d0 |
|
BLAKE2b-256 | f1bf42156bc96058197409c5eadc34aa08cf1246182e8e1ddf930e3519eb1be9 |
Hashes for pyodps-0.11.3.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2b6ed6cb5ea0d17f6c9d27f3186b119f8a21464cda559ae771958afc1f3d31d |
|
MD5 | 814fd22c29cce7c18f3a9d8b84c5acef |
|
BLAKE2b-256 | c856dbb3b48de7b58b2aadde005bfccfe9e58ce3f07af1af43933a82fa7ee564 |
Hashes for pyodps-0.11.3.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5c83b9087ec9d2602735ba5f6d7859cdb4a47bb9979d23f3b63a1c1bc33471 |
|
MD5 | a7e5bd8830b27e33ad121bafd00ca0b9 |
|
BLAKE2b-256 | ee281a8569b5483cad775f5fe70863c853d303d4677e6ef9ef91808a219c7745 |
Hashes for pyodps-0.11.3.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da7d76c3fe788353f4a4138818440d5f8fec8261063bef227ce730ba5017eb57 |
|
MD5 | edbd53e1b41eef2ca5500bbfa180e2e3 |
|
BLAKE2b-256 | 2d1d04eb7236a90e9f53350cd5d2045d97530347b3817d49a2324f232c8e6acc |
Hashes for pyodps-0.11.3.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b4f1663975633f060e792be8cc002686738ed70b73481248bfa9a453b7e965 |
|
MD5 | 53eae20c7ee00add7edf6faf901c123f |
|
BLAKE2b-256 | ba980ca4a2062178826881bea9f198d8f83a1dd637a5c7e883f10ffecc6384c2 |
Hashes for pyodps-0.11.3.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e265171e0b00b4981d0ed6e9cdf0fb370896a2fc0bfa846a9990a41b1761076 |
|
MD5 | 4fd7cbd1cbae06bd7f389605e0ebdc62 |
|
BLAKE2b-256 | 190a7928059463625680f0b64b9b574b3edfd54b8e715e77679596c0bba0b639 |
Hashes for pyodps-0.11.3.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfefb8787b36446ca00937dd2e7fb8722d76e5194d170b984c7f3bc6d07df63f |
|
MD5 | bffc445ce92f3a350bb3241b1f2aa3eb |
|
BLAKE2b-256 | de55dd126615edbef9e749ec4e4805aa127b42f1e18363bbd904201fa15aba74 |
Hashes for pyodps-0.11.3.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75235d1d8661f5de45dcecec1032b9af00230d69c7f021099ee547334a567cfa |
|
MD5 | a516f078fee7c5ea5351c8541dabce0f |
|
BLAKE2b-256 | 229a9b93c89bece594b6b41331a88e280746842e80845ea9b91676bacfe5e77c |
Hashes for pyodps-0.11.3.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b41a446f6baab15d74ab719de67dfc4e8ed4a0e5510469b8d38a1b43c183e9 |
|
MD5 | 94919578da4d6a5434ab24572c2301b0 |
|
BLAKE2b-256 | 44e39ee97d2b7ccef666eacd9b27b9e9bf21812105d7c0716b7958a78c054f98 |
Hashes for pyodps-0.11.3.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b4a5739731c9903f2721ba8ab2c322f1cca40a83c4768cf23bc36d29f73f3b0 |
|
MD5 | 46dc6e3a544e4dcdbfce1f89e92b7a52 |
|
BLAKE2b-256 | 0a4dbdc50e494a6488d6ca258cf3a4f04a2a19a78ef1f09de5df1cb5b3c7879b |
Hashes for pyodps-0.11.3.1-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad934b47ae81958d76375f865b3d347d3625d136ea0679998ce6817a1810fd3d |
|
MD5 | db5f05d0e234b308db68002e182eeb29 |
|
BLAKE2b-256 | ba9bbaa6b273170a0bdbc2f6a3cd04c8a70a5a33a304c1e34f128793f4eabed9 |