Metadata-Version: 2.1
Name: nbox
Version: 0.10.4rc4
Summary: ML Inference 🥶
Home-page: https://github.com/NimbleBoxAI/nbox
License: Apache-v2
Author: NBX Research
Author-email: research@nimblebox.ai
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: compute-basic
Provides-Extra: full
Provides-Extra: serving
Requires-Dist: GitPython (==3.1.27)
Requires-Dist: Jinja2 (==3.0.3)
Requires-Dist: cloudpickle (==2.1.0)
Requires-Dist: fastapi (>=0.78.0,<0.79.0); extra == "serving" or extra == "full"
Requires-Dist: gputil (==1.4.0)
Requires-Dist: grpcio (==1.43.0)
Requires-Dist: mypy-protobuf (==3.2.0)
Requires-Dist: numpy (==1.22.3); extra == "compute-basic" or extra == "full"
Requires-Dist: protobuf (==3.20.2)
Requires-Dist: psutil (==5.9.0)
Requires-Dist: python-json-logger (==2.0.2)
Requires-Dist: randomname (>=0.1.3,<0.2.0)
Requires-Dist: redis (==4.3.4); extra == "compute-basic" or extra == "full"
Requires-Dist: requests (>=2.25.1,<3.0.0)
Requires-Dist: tabulate (==0.8.9)
Requires-Dist: tqdm (==4.64.0)
Requires-Dist: uvicorn (>=0.18.2,<0.19.0); extra == "serving" or extra == "full"
Project-URL: Documentation, https://nimbleboxai.github.io/nbox/
Project-URL: Repository, https://github.com/NimbleBoxAI/nbox
Description-Content-Type: text/markdown

<a href="https://nimblebox.ai/" target="_blank"><img src="./assets/built_at_nbx.svg" align="right"></a>
[![PyPI - Python
Version](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue)](https://pypi.org/project/nbox/)
[![Downloads](https://pepy.tech/badge/nbox)](https://pepy.tech/project/nbox)
![GitHub](https://img.shields.io/badge/license-Apache--2.0-blueviolet)

## 🧐 What is Nbox?

`nbox` provides first class support API for all NimbleBox.ai infrastructure (NBX-Build, Jobs, Deploy) and services (NBX-Workspaces) components. Write jobs using `nbox.Operators`

# 🤷Why NimbleBox

- Write and execute code in Python
- Document your code that supports mathematical equations
- Create/Upload/Share notebooks
- Import notebooks from your local machine
- Import/Publish notebooks from/to GitHub
- Import external datasets (e.g. from Kaggle)
- Integrate PyTorch, TensorFlow, Keras, OpenCV
- Share your projects
- Collaborate with your team

# 🎚 Features

### 🏗️ Freedom To Build
![Build Landing Page (2)](https://user-images.githubusercontent.com/89596037/181773716-ba63f167-af0d-48aa-921a-02e13238c0f2.gif)


### 🦾 Automate with Ease
![Jobs Landing Page](https://user-images.githubusercontent.com/89596037/181774553-99120354-72f5-4064-9216-4f8a5aa050be.gif)


### 🚀 Intuitive Dashboard
![Deploy Landing Page](https://user-images.githubusercontent.com/89596037/181775468-cc342a30-d87e-4576-8bdd-8ffdd75ff759.gif)


# 🏁 Get Started


**Install the package from pipy:**

```pip install nbox```


For convinience you should add nbox to your path by setting up an alias. Throughout the rest of the documentation we will be using nbx as the CLI:

```# go to your .bashrc or .zshrc and add
alias nbx="python3 -m nbox"
```



When loading nbox for the first time, it will prompt you the username and password and create a secrets file at ```~/.nbx/secrets.json. ``` This file then contains all the information that you don’t have to fetch manually again.


## APIs

Our APIs are deep, user functions are kept to minimum and most relavant. This documentation contains the full spec of everything, but here’s all the APIs you need to know:

```
nbox
├── Model          # Framework agnostic Model
│   ├── __call__
│   ├── deploy
│   ├── train_on_instance (WIP)
│   └── train_on_jobs (WIP)
├── Operators      # How jobs are combinations of operators
│   ├── __call__
│   └── deploy
├── Jobs           # For controlling all your jobs
│   ├── logs       # stream logs right on your terminal
│   └── trigger    # manually trigger a job
└── Instance
   ├── __call__    # Run any command on the instance
   └── mv (WIP)    # Move files to and from NBX-Build
```

## NBX-Jobs and NBX-Deploy

Create a simple folder:

```
nbx jobs new moonshot
```

### Run any Batch Process

Add the following code to `foobar.py`:

```python
from nbox import operator, Operator
from nbox.lib.shell import ShellCommand

# define your function and wrap it as an operator
@operator()
def foo(x: Dict):
  return "bar"

# or use OOPs like torch, etc.
class MyJob(Operator):
  def __init__(self):
    super().__init__()
    self.foo = foo
    self.shell = ShellCommand("echo 'hello {text}'")
  
  def forward(self):
    text = self.foo()
    self.shell(text = text)
```

# How to get help?

Join our [discord](https://discord.gg/qYZHxMaCsE) and someone from our community or engineering team will respond!

## 🔖Read our [Blog](https://nimblebox.ai/blog).


# 🧩 License

The code in thist repo is licensed as [Apache License 2.0](./LICENSE). Please check for individual repositories for licenses.

