fysh


Namefysh JSON
Version 0.0.1.9 PyPI version JSON
download
home_pagehttps://github.com/flockfysh/ffysh
SummaryCommand Line Interface tool for flockfysh.
upload_time2023-08-22 04:14:19
maintainer
docs_urlNone
authorAnsh
requires_python>=3.8,<4.0
licenseMIT
keywords files manipulation data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Build and upload to PyPI

To build the package: 
```shell
pip install build
python -m build
```

To upload the package: 
```shell
pip install twine
python -m twine upload --repository pypi dist/*
```


<!-- # ffysh

[Download example dataset (**DO NOT EXTRACT
**)](https://drive.google.com/file/d/1oEETaG6Ra_Ajq5j2awcEXdwmYbW4d2zg/view?usp=sharing) -->


# General use

Everything you need is stored in the ffysh import or in the ffysh CLI - you don't need to worry about its submodules.

## Create a project and log in to Flockfysh

1. Ensure your current working directory is correct.
2. From the terminal, run these two commands:
    ```shell
    ffysh init
    ffysh login
    ```
3. Log in to Flockfysh using the new browser window and click `Approve` to allow ffysh to use your account.

## Datasets

1. You'll first need to create a Dataset object first, using the 24-character ID of the dataset you want.
   If the dataset does not exist, an error will be thrown.

   ```python
   from ffysh import Dataset
   
   dataset = Dataset("some_dataset_id")
   ```

2. From there, you can create a stream object.
   ```python
   stream = dataset.create_stream()
   ```

Additional dataset attributes and methods:

```python
# Print dataset ID.
print(dataset.dataset_id)
```

## Streams

Streams are the basic unit of operation in ffysh.
Each stream is a lazy-loaded snapshot of a dataset, and it expands as much as the user needs.
Alternatively, you can use it as if it is a Python list.

1. First, store the ID of the stream for later use.

   ```python
   with open("stream_id.json", "w") as file:
       json.dump({"id": stream.stream_id}, file)
   ```

2. This allows the stream to reload from disk.

   ```python
   from ffysh import Stream
   
   with open("stream_id.json", "w") as file:
      stream = Stream.load(json.load(file)["id"]
   ```

   Note that each stream instance can only be created or loaded once, and if it is load twice, the old stream instance
   will be returned.

   ```python
   with open("stream_id.json", "w") as file:
      stream2 = Stream.load(json.load(file)["id"]
   
   print(stream is stream2) # True
   ```

3. Stream methods:
   ```python
   from ffysh import Stream
   
   with open("stream_id.json", "w") as file:
       stream = Stream.load(json.load(file)["id"]
   
   # Iteration
   for asset in stream:
       print(asset)
   
   # Stream indexing and slicing
   print(stream[0:5:2])
   
   # Loads the next 5 items that has not been loaded yet 
   # into the cache, and return them. If the stream ends, 
   # an empty list is returned, and any more calls will raise 
   # a StopIteration exception.
   stream.next_assets(5)
   
   # Expands the stream until the stream ends or is at least 100 
   # items long by loading more items from the cache.
   stream.expand(100)
   
   # Expands the stream until the end.
   stream.expand()
   
   # Convert the entire stream to a PyTorch zip.
   stream.to_pytorch("./dataset.zip", confidence_level=0.6)
   ```

## Limitations
1. You must not use a stream in 2 Python programs at a time. If you want to, create a second 
stream or quit the first program. Although you still have to re-download labels, images will be 
cached in a separate directory, so that multiple streams can access the same asset.
2. Even if assets and their labels are deleted remotely, they will stay intact locally.
We'll introduce a way to discard unused streams and purge redundant images in the future.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/flockfysh/ffysh",
    "name": "fysh",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "files,manipulation,data science",
    "author": "Ansh",
    "author_email": "teamnebulaco@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6f/d2/c5d135e92a5a38e6aa8cb7722c97e175c03ff90df80f42e8083d64383306/fysh-0.0.1.9.tar.gz",
    "platform": null,
    "description": "# Build and upload to PyPI\n\nTo build the package: \n```shell\npip install build\npython -m build\n```\n\nTo upload the package: \n```shell\npip install twine\npython -m twine upload --repository pypi dist/*\n```\n\n\n<!-- # ffysh\n\n[Download example dataset (**DO NOT EXTRACT\n**)](https://drive.google.com/file/d/1oEETaG6Ra_Ajq5j2awcEXdwmYbW4d2zg/view?usp=sharing) -->\n\n\n# General use\n\nEverything you need is stored in the ffysh import or in the ffysh CLI - you don't need to worry about its submodules.\n\n## Create a project and log in to Flockfysh\n\n1. Ensure your current working directory is correct.\n2. From the terminal, run these two commands:\n    ```shell\n    ffysh init\n    ffysh login\n    ```\n3. Log in to Flockfysh using the new browser window and click `Approve` to allow ffysh to use your account.\n\n## Datasets\n\n1. You'll first need to create a Dataset object first, using the 24-character ID of the dataset you want.\n   If the dataset does not exist, an error will be thrown.\n\n   ```python\n   from ffysh import Dataset\n   \n   dataset = Dataset(\"some_dataset_id\")\n   ```\n\n2. From there, you can create a stream object.\n   ```python\n   stream = dataset.create_stream()\n   ```\n\nAdditional dataset attributes and methods:\n\n```python\n# Print dataset ID.\nprint(dataset.dataset_id)\n```\n\n## Streams\n\nStreams are the basic unit of operation in ffysh.\nEach stream is a lazy-loaded snapshot of a dataset, and it expands as much as the user needs.\nAlternatively, you can use it as if it is a Python list.\n\n1. First, store the ID of the stream for later use.\n\n   ```python\n   with open(\"stream_id.json\", \"w\") as file:\n       json.dump({\"id\": stream.stream_id}, file)\n   ```\n\n2. This allows the stream to reload from disk.\n\n   ```python\n   from ffysh import Stream\n   \n   with open(\"stream_id.json\", \"w\") as file:\n      stream = Stream.load(json.load(file)[\"id\"]\n   ```\n\n   Note that each stream instance can only be created or loaded once, and if it is load twice, the old stream instance\n   will be returned.\n\n   ```python\n   with open(\"stream_id.json\", \"w\") as file:\n      stream2 = Stream.load(json.load(file)[\"id\"]\n   \n   print(stream is stream2) # True\n   ```\n\n3. Stream methods:\n   ```python\n   from ffysh import Stream\n   \n   with open(\"stream_id.json\", \"w\") as file:\n       stream = Stream.load(json.load(file)[\"id\"]\n   \n   # Iteration\n   for asset in stream:\n       print(asset)\n   \n   # Stream indexing and slicing\n   print(stream[0:5:2])\n   \n   # Loads the next 5 items that has not been loaded yet \n   # into the cache, and return them. If the stream ends, \n   # an empty list is returned, and any more calls will raise \n   # a StopIteration exception.\n   stream.next_assets(5)\n   \n   # Expands the stream until the stream ends or is at least 100 \n   # items long by loading more items from the cache.\n   stream.expand(100)\n   \n   # Expands the stream until the end.\n   stream.expand()\n   \n   # Convert the entire stream to a PyTorch zip.\n   stream.to_pytorch(\"./dataset.zip\", confidence_level=0.6)\n   ```\n\n## Limitations\n1. You must not use a stream in 2 Python programs at a time. If you want to, create a second \nstream or quit the first program. Although you still have to re-download labels, images will be \ncached in a separate directory, so that multiple streams can access the same asset.\n2. Even if assets and their labels are deleted remotely, they will stay intact locally.\nWe'll introduce a way to discard unused streams and purge redundant images in the future.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Command Line Interface tool for flockfysh.",
    "version": "0.0.1.9",
    "project_urls": {
        "Homepage": "https://github.com/flockfysh/ffysh",
        "Repository": "https://github.com/flockfysh/ffysh"
    },
    "split_keywords": [
        "files",
        "manipulation",
        "data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79f01a7a95fc51baa798de0749435f6933b0b10e4b89de63c22fb2c85394d1d9",
                "md5": "afbdd7a5b03dc0a1b3c3326082479786",
                "sha256": "a79f0e286fa4b2c616f8ed11bac01a1c3c8740bbe01007c273e339ffae8d5f14"
            },
            "downloads": -1,
            "filename": "fysh-0.0.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afbdd7a5b03dc0a1b3c3326082479786",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 21866,
            "upload_time": "2023-08-22T04:14:17",
            "upload_time_iso_8601": "2023-08-22T04:14:17.683368Z",
            "url": "https://files.pythonhosted.org/packages/79/f0/1a7a95fc51baa798de0749435f6933b0b10e4b89de63c22fb2c85394d1d9/fysh-0.0.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fd2c5d135e92a5a38e6aa8cb7722c97e175c03ff90df80f42e8083d64383306",
                "md5": "7b0b51e96b24d1f7979ae475c5f30271",
                "sha256": "68308ce8864680641e5ebc524ca062a7f3d2f6fac813b43ffd9ae9fa1490f20d"
            },
            "downloads": -1,
            "filename": "fysh-0.0.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "7b0b51e96b24d1f7979ae475c5f30271",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 17235,
            "upload_time": "2023-08-22T04:14:19",
            "upload_time_iso_8601": "2023-08-22T04:14:19.342882Z",
            "url": "https://files.pythonhosted.org/packages/6f/d2/c5d135e92a5a38e6aa8cb7722c97e175c03ff90df80f42e8083d64383306/fysh-0.0.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-22 04:14:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "flockfysh",
    "github_project": "ffysh",
    "github_not_found": true,
    "lcname": "fysh"
}
        
Elapsed time: 1.01042s