frapy


Namefrapy JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://frapy.net
SummaryClient for frapy cloud
upload_time2022-12-08 09:20:49
maintainer
docs_urlNone
authorAleksander Peczot
requires_python
licenseapache-2.0
keywords cloud computing cloudcomputing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # frapy.net cloud
```pip install frapy```

### Usage
Before you will be able to use cloud client, you need to create account on:  frapy.net

FraPy lets you run your code on powerfull cloud computing instances right from your code editor.
You need to just decorate function that you want to execute with "flask-style" decorator.
Function will be skipped by local execution but will be real-time executed on one of our servers and results of your function will be returned back to your code.

### Example
#

```
from frapy import Client
client = Client(api_key, api_secret)

@client.run(compute_on='GPU')
def add(a, b):
    c = a + b
    return c

c = test(a=10, b=20)
```
```
>>> c
30
```
### Limitations
1. Supported function argument types (DATAFRAME, int, float, str, list, tuple, set, dict, bool)
2. If you are using 3rd party packages (that can be downloaded using pip) - you HAVE TO specify imports in decorator (imports=['pandas'])
3. You CAN'T use anything outside of function scope (beside 3rd party packages).

## Documentation
##### api_key and api_secret: You can generate api_key and api_secret on account dashboard and you have to pass it to client while initialization.
#
```
Client(api_key='key', api_secret='secret')
```
##### Requirements: You can pass your requirements as a path to requirements.txt file:
#
```
Client(..., requirements_filename='./requirements.txt')
```

##### Or you can pass it as a tuple of requirements:
#
```
Client(..., requirements=('pandas', 'numpy==1.0'))
```

##### Compute On: You can choose between CPU and GPU as your computing instance. By default is CPU as we suggest using (if you using cuda=True, use GPU instead). You can specify compute_on globally in client and in run decorator.
#
```
Client(..., compute_on='GPU')
```
```
@client.run(..., compute_on='GPU')
def add(a, b):
  ...
```
##### Imports: You can specify 3rd party packages that will be imported.
#
```
@client.run(..., imports=['pandas'])
def add(a, b):
  df = pandas.DataFrame('[1, 2]')
```
```
@client.run(..., imports=['pandas.DataFrame'])
def add(a, b):
  df = DataFrame('[1, 2]')
```
### Another Example
```
from module import df, filename

@client.run(compute_on='GPU')
def ctgan(dataset, number_of_epochs): 
    model = CTGAN(
            epochs=number_of_epochs,
            batch_size=100,
            cuda=False
            )
    
    model.fit(dataset) 
    return model

model = ctgan(df, 150)
pandas.dump(model, open(filename, 'wb')
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://frapy.net",
    "name": "frapy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "CLOUD,COMPUTING,CLOUDCOMPUTING",
    "author": "Aleksander Peczot",
    "author_email": "peczot.a@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9e/cc/1de8e3ecf1c2a1a74c14a0775d210be4752eac86da46748653594a9b08e2/frapy-1.0.1.tar.gz",
    "platform": null,
    "description": "# frapy.net cloud\n```pip install frapy```\n\n### Usage\nBefore you will be able to use cloud client, you need to create account on:  frapy.net\n\nFraPy lets you run your code on powerfull cloud computing instances right from your code editor.\nYou need to just decorate function that you want to execute with \"flask-style\" decorator.\nFunction will be skipped by local execution but will be real-time executed on one of our servers and results of your function will be returned back to your code.\n\n### Example\n#\n\n```\nfrom frapy import Client\nclient = Client(api_key, api_secret)\n\n@client.run(compute_on='GPU')\ndef add(a, b):\n    c = a + b\n    return c\n\nc = test(a=10, b=20)\n```\n```\n>>> c\n30\n```\n### Limitations\n1. Supported function argument types (DATAFRAME, int, float, str, list, tuple, set, dict, bool)\n2. If you are using 3rd party packages (that can be downloaded using pip) - you HAVE TO specify imports in decorator (imports=['pandas'])\n3. You CAN'T use anything outside of function scope (beside 3rd party packages).\n\n## Documentation\n##### api_key and api_secret: You can generate api_key and api_secret on account dashboard and you have to pass it to client while initialization.\n#\n```\nClient(api_key='key', api_secret='secret')\n```\n##### Requirements: You can pass your requirements as a path to requirements.txt file:\n#\n```\nClient(..., requirements_filename='./requirements.txt')\n```\n\n##### Or you can pass it as a tuple of requirements:\n#\n```\nClient(..., requirements=('pandas', 'numpy==1.0'))\n```\n\n##### Compute On: You can choose between CPU and GPU as your computing instance. By default is CPU as we suggest using (if you using cuda=True, use GPU instead). You can specify compute_on globally in client and in run decorator.\n#\n```\nClient(..., compute_on='GPU')\n```\n```\n@client.run(..., compute_on='GPU')\ndef add(a, b):\n  ...\n```\n##### Imports: You can specify 3rd party packages that will be imported.\n#\n```\n@client.run(..., imports=['pandas'])\ndef add(a, b):\n  df = pandas.DataFrame('[1, 2]')\n```\n```\n@client.run(..., imports=['pandas.DataFrame'])\ndef add(a, b):\n  df = DataFrame('[1, 2]')\n```\n### Another Example\n```\nfrom module import df, filename\n\n@client.run(compute_on='GPU')\ndef ctgan(dataset, number_of_epochs): \n    model = CTGAN(\n            epochs=number_of_epochs,\n            batch_size=100,\n            cuda=False\n            )\n    \n    model.fit(dataset) \n    return model\n\nmodel = ctgan(df, 150)\npandas.dump(model, open(filename, 'wb')\n```",
    "bugtrack_url": null,
    "license": "apache-2.0",
    "summary": "Client for frapy cloud",
    "version": "1.0.1",
    "split_keywords": [
        "cloud",
        "computing",
        "cloudcomputing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "1c0a268b4c7a115e05ce9117fe1f59be",
                "sha256": "f4f42c5865da842928befde95ea09771b66f83ea71f5d34c1563de7d86b6e159"
            },
            "downloads": -1,
            "filename": "frapy-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1c0a268b4c7a115e05ce9117fe1f59be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4492,
            "upload_time": "2022-12-08T09:20:49",
            "upload_time_iso_8601": "2022-12-08T09:20:49.195842Z",
            "url": "https://files.pythonhosted.org/packages/9e/cc/1de8e3ecf1c2a1a74c14a0775d210be4752eac86da46748653594a9b08e2/frapy-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-08 09:20:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "frapy"
}
        
Elapsed time: 0.02233s