Skip to main content

An API wrapper for Gofile API

Project description

Gofile2

from gofile2 import Gofile

g_a = Gofile()
print(g_a.upload(file="/home/itz-fork/photo.png"))

An API Wrapper for Gofile API.

About API

Gofile is in BETA version and this API will evolve over time. Check regularly if changes have been made.

Current version is compatible with 2021-06-22

Installation

Install via pypi

pip3 install gofile2

To install development version Gofile2, run the following command

pip install git+https://github.com/Itz-fork/Gofile2.git

Usage

1. Import Gofile2 in your python file

Synchronous version

from gofile2 import Gofile

Asynchronous version

from gofile2 import Async_Gofile

2. Create an instance of Gofile2

Synchronous version

g_a = Gofile()

Asynchronous version

g_a = Async_Gofile()

Above code will login as guest account (Some functions won't work in this mode). If you need to login to your own account then pass your api token as token argument like below code.

Synchronous version

g_a = Gofile(token="your_gofile_api_token_here")

Asynchronous version

g_a = Async_Gofile(token="your_gofile_api_token_here")

3. Everything Done! Now Play with it!

# Get current server
g_a.get_Server()

# Get account info
g_a.get_Account()

# Upload a file
g_a.upload(file="path_to_your_file")

# Create folder
g_a.create_folder(parentFolderId="your_root_folder_id", folderName="Folder Name")

# Set folder options
g_a.set_folder_options(folderId="id_of_the_folder", option="your_option", value="your_value")

# Delete file or folder
g_a.delete_content(contentId="id_of_the_file_or_folder")

Docs

For now there is no documentation for Gofile2. However you can get some help from Docstrings using,

from gofile2 import Gofile

# Replace upload with the function you want
print(help(Gofile().upload))

Thanks to

  • gofile - Base Project & Inspiration ❤️ (Gofile2 is a Re-built version of this)
  • Itz-fork (me) - For Fixing & Improving this project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gofile2-1.3.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file gofile2-1.3.1.tar.gz.

File metadata

  • Download URL: gofile2-1.3.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for gofile2-1.3.1.tar.gz
Algorithm Hash digest
SHA256 0f968d14d81ad38484bf6747e69e46597929274a4ec79f86ed48fda36e110ed0
MD5 79f32120a18050099c1e0fd309633d9b
BLAKE2b-256 7a40c3242018ba858c0dc242e6f003bc50900e69ce5f29cc95c1263c1f28484b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page