Skip to main content

Scalable Python data science, in an API compatible & lightning fast way.

Project description


Xorbits: scalable Python data science, familiar & fast.

PyPI Latest Release License Coverage Build Status Doc Slack

What is it?

Xorbits is a scalable Python data science framework that aims to scale the whole Python data science world, including numpy, pandas, scikit-learn and many other libraries. It can leverage multi cores or GPUs to accelerate computation on a single machine, or scale out up to thousands of machines to support processing terabytes of data. In our benchmark test, Xorbits is the fastest framework among the most popular distributed data science frameworks.

As for the name of xorbits, it has many meanings, you can treat it as X-or-bits or X-orbits or xor-bits, just have fun to comprehend it in your own way.

Where to get it

The source code is currently hosted on GitHub at: https://github.com/xprobe-inc/xorbits

Binary installers for the latest released version are available at the Python Package Index (PyPI).

# PyPI
pip install xorbits

API compatibility

As long as you know how to use numpy, pandas and so forth, you would probably know how to use xorbits.

Here is an example.

pandas Xorbits
import pandas as pd

ratings = pd.read_csv('ratings.csv')
movies = pd.read_csv('movies.csv')

m = ratings.groupby(
    'MOVIE_ID', as_index=False).agg(
    {'RATING': ['mean', 'count']})
m.columns = ['MOVIE_ID', 'RATING', 'COUNT']
m = m[m['COUNT'] > 100]
top_100 = m.sort_values(
    'RATING', ascending=False)[:100]
top_100 = top_100.merge(
    movies[['MOVIE_ID', 'NAME']])
print(top_100)
import xorbits.pandas as pd

ratings = pd.read_csv('ratings.csv')
movies = pd.read_csv('movies.csv')

m = ratings.groupby(
    'MOVIE_ID', as_index=False).agg(
    {'RATING': ['mean', 'count']})
m.columns = ['MOVIE_ID', 'RATING', 'COUNT']
m = m[m['COUNT'] > 100]
top_100 = m.sort_values(
    'RATING', ascending=False)[:100]
top_100 = top_100.merge(
    movies[['MOVIE_ID', 'NAME']])
print(top_100)

Codes are almost identical except for the import, replace import pandas with import xorbits.pandas will just work, so does numpy and so forth.

Lightning fast speed

Xorbits is the fastest compared to other popular frameworks according to our benchmark tests.

We did a benchmark for TPC-H at scale factor 100 and 1000. The performances are shown as below.

Deployment

Local

On a single machine e.g. your laptop, optionally, you can initialize Xorbits on your own:

import xorbits
xorbits.init()

Or Xorbits will try to init for you when the first time some computation is triggered.

Bare metal

Deploy to bare metal machines is dead easy as well. Ensure xorbits is installed on each machine, then:

For supervisor which schedules tasks to workers.

# for supervisor
python -m xorbits.supervisor -H <host_name> -p <supervisor_port> -w <web_port>

For workers which run actual computations.

# for worker
python -m xorbits.worker -H <host_name> -p <worker_port> -s <supervisor_ip>:<supervisor_port>

Then connect to the supervisor anywhere that can run Python code.

import xorbits
xorbits.init("http://<supervisor_ip>:<supervisor_web_port>")

Replace the <supervisor_ip> with the supervisor host name that you just specified and <supervisor_web_port> with the supervisor web port.

License

Apache 2

Documentation

The official documentation is hosted on: https://doc.xorbits.io

Roadmaps

Main goals we want to achieve in the future include:

  • Transitioning from pandas native to arrow native for data storage,
    it will reduce the memory cost substantially and is more friendly for compute engine.
  • Introducing native engines that leverage technologies like vectorization and codegen to accelerate computations.
  • Scale as many libraries and algorithms as possible!

More detailed roadmaps will be revealed soon, stay tuned!

Relationship with Mars

The creators of Xorbits are mainly those of Mars, we built Xorbits currently on Mars to reduce duplicated work, but the vision of Xorbits suggests that it's not appropriate to put everything into Mars, instead, we need a new project to support the roadmaps better. In the future, we will replace some core internal components with other upcoming ones we will propose, stay tuned!

Getting involved

Platform Purpose
Discourse Forum Asking usage questions and discussing development.
Github Issues Reporting bugs and filing feature requests.
Slack Collaborating with other Xorbits users.
StackOverflow Asking questions about how to use Xorbits.
Twitter Staying up-to-date on new features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xorbits-0.0.1.tar.gz (1.8 MB view hashes)

Uploaded Source

Built Distributions

xorbits-0.0.1-cp310-cp310-win_amd64.whl (3.8 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

xorbits-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

xorbits-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

xorbits-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl (4.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

xorbits-0.0.1-cp310-cp310-macosx_10_9_universal2.whl (5.1 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

xorbits-0.0.1-cp39-cp39-win_amd64.whl (3.8 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

xorbits-0.0.1-cp39-cp39-win32.whl (3.7 MB view hashes)

Uploaded CPython 3.9 Windows x86

xorbits-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

xorbits-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

xorbits-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl (4.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

xorbits-0.0.1-cp39-cp39-macosx_10_9_universal2.whl (5.1 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

xorbits-0.0.1-cp38-cp38-win_amd64.whl (3.8 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

xorbits-0.0.1-cp38-cp38-win32.whl (3.7 MB view hashes)

Uploaded CPython 3.8 Windows x86

xorbits-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

xorbits-0.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

xorbits-0.0.1-cp38-cp38-macosx_10_9_x86_64.whl (4.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

xorbits-0.0.1-cp38-cp38-macosx_10_9_universal2.whl (5.1 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

xorbits-0.0.1-cp37-cp37m-win_amd64.whl (3.8 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

xorbits-0.0.1-cp37-cp37m-win32.whl (3.6 MB view hashes)

Uploaded CPython 3.7m Windows x86

xorbits-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

xorbits-0.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

xorbits-0.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (4.0 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page