Skip to main content

package for file storage

Project description

This package is used to store files in mongodb

filestostorage

Packages included

$ pip install pymongo For connecting python to mongodb $ pip install gridfs-fuse For performing read/write operations on mongodb $ pip install rich For text formatting and progress display

Installation

$ pip install filestostorage NOTE:This package currently supports upto Python version 3.9

Project is still under development :) Currently supported for storing files in mongodb

Usage

Import statement:

import filestostorage as ft

Mongo Connection

Create a Database object db = ft.mongo_conn() This function will prompt to Enter MongoUrl

Upload File

To upload file use the below command ft.upload_file("FILE PATH","FILENAME",db)

ft.upload_file("/Users/Desktop/test/image1.jpeg","file_name",db)

Download File

To download_files use the below command: ft.download_file("DOWNLOAD LOCATION","FILE NAME",db)

ft.download_file("/Users/Desktop/myimage.jpeg","file_name",db) In 2nd parameter use the same file name which was used while uploading the file

Overall

import filestostorage as ft

db = ft.mongo_conn()   #connect to database via url

ft.upload_file("file_path","file_name",db) #command to upload file

ft.download_file("download_location","file_name(same as upload)",db)#command to download file

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

filestostorage-0.0.2.5.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file filestostorage-0.0.2.5.tar.gz.

File metadata

  • Download URL: filestostorage-0.0.2.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for filestostorage-0.0.2.5.tar.gz
Algorithm Hash digest
SHA256 cb3001718f7ce2ef0c340ffd28bbc0ea9fb7bee7291e2493a16c9c9b0b1ef3fa
MD5 077d2821d3c795252ad1fa65f6982498
BLAKE2b-256 d25b73fbdfdc264b7bc995cdfc4ed1c7c893bcd97fc6e5e937c9d879fcce346d

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