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.1.0.tar.gz (11.7 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.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pjf_donation_dropbox_api-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.2 Windows/11

File hashes

Hashes for pjf_donation_dropbox_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 777b7fc7f0864a404396175a52393375180664aec5c5d3ed835f73b06fd2ee2c
MD5 46d0806b62aca0dfd7d81b09e5efaede
BLAKE2b-256 f470ea06d58c94c28c3a8fa919285b74ec78ccdba1c11d0489988e6c9e424a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pjf_donation_dropbox_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3622b4331a898ff995ce2e11f07fb0ad90ac1f7141b17f274be6140ec3f9658
MD5 0dc0668651343c882aca7ac481a9087b
BLAKE2b-256 730fa46a98b91198b84158c6ea15bcc283f3640aeffd41c48efde220c9858a8a

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