Skip to main content

A python package that allows software to connect to the Philippine Jesuit Foundation's Donations Dropbox through various data stores like the dropbox cloud, file system, and a custom database.

Project description

pjf_donation_dropbox_api

A python package that allows software to connect to the Philippine Jesuit Foundation's Donations Dropbox through various data stores like the dropbox cloud, file system, and a custom database.

Installation

$ pip install pjf_donation_dropbox_api

Usage

pjf_donation_dropbox_api can be used to connect to the dropbox account and cache it as a sqlite database in a local mount as follows:

DROPBOX_ACCESS_TOKEN = os.getenv("DROPBOX_ACCESS_TOKEN")

dropbox_fs = pjf_donation_dropbox_api.DropboxCloudFileSystem(DROPBOX_ACCESS_TOKEN)

# We create a CachedFilesDatabase object from this package that will reference and read the dropbox object.
db = pjf_donation_dropbox_api.CachedFilesDatabase(dropbox_fs_reference=dropbox_fs, autosave=False)

sqlite_db_to_store_dropbox = "/path/to/db.sqlite" # you could also store in sqlite memory.

# The database object copies the entire dropbox starting from the root. It then places each file and excel file as a database record in the table. Knowing the schema of the underlying db is not required for the API user. You can still access the cached files through methods like .read() below.
db.save_entire_state(destination_path=sqlite_db_to_store_dropbox)

# Read back the file to verify
file = db.read("/test_data_folder/test_file.txt")

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

pjf_donation_dropbox_api was created by Kenneth Salanga. It is licensed under the terms of the Proprietary license.

Credits

pjf_donation_dropbox_api was created with cookiecutter and the py-pkgs-cookiecutter template.

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

pjf_donation_dropbox_api-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pjf_donation_dropbox_api-0.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file pjf_donation_dropbox_api-0.2.0.tar.gz.

File metadata

  • Download URL: pjf_donation_dropbox_api-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Windows/10

File hashes

Hashes for pjf_donation_dropbox_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fbe971804f1a93a2deb1b71c252bca7b9720c219574a3515227d62f2e01ce2f3
MD5 b2fa89bf4a4f8eab08aaf1bd9a191000
BLAKE2b-256 ba80403df8baad207543f44e6f5ea2cf56fd525ee54d6b367c295312819e4c90

See more details on using hashes here.

File details

Details for the file pjf_donation_dropbox_api-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pjf_donation_dropbox_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4203825ff852b0bd6d139c5e8b6601c2650a635b1deaa6ed7a5d272a4ec4489e
MD5 6ec9309a804fc0fe1b6fa267b7a789f6
BLAKE2b-256 d535e36fb447930ed540991843450c34c7fe42eb5ce1eb8ee95e46e7b4afdc3f

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