Giter Club home page Giter Club logo

nephelai's Introduction

nephelai logo

nephelai

Actions Status Documentation Status Stable python versions Code style: black

A helper library to upload/download files to/from a password-protected shared nextcloud folder. The link and password are read from your .env to enable project-specific shared folders. Because Nextcloud does not enable chunked uploads for shared folders and your files can hit the size limit, your files are uploaded in chunks if needed and reconstructed after download.

Usage

Create a .env file in your project root. Remember to add this file to your .gitignore and always keep it secure to keep your secrets! Your .env should contain:

NEXTCLOUD_FOLDER_URI="uri_of_the_shared_folder"
NEXTCLOUD_FOLDER_PW="pw_of_the_folder"

Then you can interact with the folder in a variety of ways. Alternatively, you can set this environment variables yourself with your preferred method.

Via CLI:

nephelai upload mytestfile.txt anextcloud/path/thatwillbecreatedifneeded/
nephelai download anextcloud/path/thatwillbecreatedifneeded/mytestfile.txt

You can also upload folders including the file structure:

tests/resources
โ”œโ”€โ”€ mymatrix.npy
โ””โ”€โ”€ subfolder
    โ””โ”€โ”€ testfile.txt

Using the upload-with-fs command:

nephelai upload-with-fs tests/resources

Which is just syntactic sugar for:

nephelai upload tests/resources tests/resources

Downloading can be done accordingly:

nephelai download tests

Which will download it to your current directory. You can also specify the download path:

nephelai download tests --local-path /tmp/

This download the folder as:

/tmp/tests
โ””โ”€โ”€ resources
    โ”œโ”€โ”€ mymatrix.npy
    โ””โ”€โ”€ subfolder
        โ””โ”€โ”€ testfile.txt

Using

nephelai ls tests

you can show the files in the tests directory.

You can get help for each command via the --help flag.

Via Python:

from nephelai import upload, download

upload("tests/resources", "tests/resources")
file_dl_path = "/tmp/mymatrix.npy"
download("tests/resources/mymatrix.npy",file_dl_path)

import numpy as np

mymatrix = np.load(file_dl_path)

Installation

pip install nephelai

nephelai's People

Contributors

dobraczka avatar

Stargazers

Maximilian Joas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.