Skip to main content
### What is this repository for? ###

* python based SDK
* v0.1

This repo implements the SDK to manage projects and models on a local fitchain pod

### Feedback ###
Reach out and tell us how we can improve this SDK to make it easier for you to work with the pod and build your models.

You may always drop us a mail at ``` code@fitchain.io ```


### Getting Started ###
#### Prequisites

Create a virtual environment

``` virtualenv -p python3 venv ```

``` . venv/bin/activate ```

and install all requirements in it

```pip3 install -r requirements.txt```

from this virtualenv run the code submitted by data scientist as in

```python ../../fitchain/machine-learning-models/mlp-reuters/train_mlp.py```


Make sure libmagic is installed:

```
brew install libmagic
```

####Fitchain sdk

First install the fitchain sdk using pip:
```bash
pip install fitchain
```

Once the fitchain sdk has been installed, you can use the library:

```python
from fitchain import Runtime

fc = Runtime()
```

Call the ```projects()``` method to get an overview of all available projects. You may even enter a query string to
filter your results.

```python
projects = fc.projects()
```

Once a project has been chosen, the datasources linked to the project can be retrieved using the ```datasources``` property

```python
project = projects[...]
project_datasources = project.datasources
```

Data for a specific datasource can be loaded by calling the ``` load(<datasource_id) ``` method on the project
```python
project_datasource_id = ...
project.load(project_datasource_id)
```

### Extracting schema and generating data
#### From data owner's pod

```
# Loading data and generating schema
df = dt.DataTemplate()
df.load_data(parentdir+ '/data/titanic_train.csv')
data_schema = df.get_template()

# Save schema to json file
schema_filepath = parentdir+'/data/titanic_schema.json'
print('Saving schema to disk at %s'%schema_filepath)
with open(schema_filepath, 'w') as outfile:
json.dump(data_schema, outfile)
del data_schema
```

#### From model owner's pod


```
# Generating dummy data from local schema
# load schema from json file
print('Loading schema from %s' % schema_filepath)
with open(schema_filepath) as json_data:
schema = json.load(json_data)
json_data.close()
pprint.pprint(schema)

dummy = dd.DummyData(schema)
dummy_df = dummy.generate_data()

# Write model on dummy_df
dummy_df.to_csv(parentdir+'/data/dummy_titanic.csv')
```


### Reference
The following methods are available as part of the SDK

##### Pod Identity #####
```python
identity = fc.identity()
```

##### List projects #####
```python
projects = fc.projects()
```

##### List workspaces #####
```python
workspaces = fc.workspaces()
```

##### List providers #####
```python
providers = fc.providers()
```

##### List Owned Datasources #####
```python
datasources = fc.datasources()
```

##### List jobs #####
```python
jobs = fc.jobs()
```


Metadata

Release files for fitchain 0.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fitchain 0.0.20
File Size Uploaded
fitchain-0.0.20.tar.gz 22.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fitchain 0.0.20
File Interpreter ABI Platform
fitchain-0.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 48.2 kB

Release files / fitchain-0.0.20.tar.gz

Download URL fitchain-0.0.20.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c2381c143ef6dc248c3b53199d75df5dadf04d15f6a0d4dd34b0fdadcef20552
BLAKE2b-256 checksum
How to use checksums
66b68642390b625a4f28be4cd6cf73daccc99a3dd49f0b6567a482157baa160f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / fitchain-0.0.20-py3-none-any.whl

Download URL fitchain-0.0.20-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e3b0a602064a0aa9e94a1417c9c5c9e33a1daea61e97e3097c2d1aa193c0d05
BLAKE2b-256 checksum
How to use checksums
a9072d734acfdf54ee7a4b4a5092866ca4b2633e146266d6dd3d061ba1b5f3d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

3 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

1 release file

0.0.9

2 release files

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page