Skip to main content

CLI tool to download NoCFO attachments and organize them by document number.

Project description

NoCFO File Downloader

CLI tool to download all attachments from a NoCFO business and organize them by document number.

Features

  • Fetches all documents and maps document_number -> attachment_ids.

  • Downloads every attachment.

  • Files linked to a document are saved as:

    <document_number>/<document_number> <original_filename>

  • Files not linked to any document are saved under:

    UNCATEGORIZED/<original_filename>

  • Shows a progress bar while downloading.

Installation

pip install nocfo-file-downloader

Usage

nocfo-dl <business_slug> --output-dir ./downloads

Options

  • --output-dir/-o Output folder (default: ./downloads)
  • --base-url API base URL (default: https://api-prd.nocfo.io)
  • --page-size Page size for pagination (default: 200)
  • --token PAT token (if omitted, the tool will prompt)
  • --concurrency/-c Number of concurrent downloads (default: 4)

PAT token (Personal Access Token)

The API uses token-based authentication. The token must be passed in the Authorization header as:

Authorization: Token <your_token_here>

You can create and manage tokens in the NoCFO web app under Account Settings:

The CLI prompts for a token at startup if you do not provide --token.

Examples

Download attachments for business acme-corp to ./exports:

nocfo-dl acme-corp --output-dir ./exports

Use a custom API base URL:

nocfo-dl acme-corp --base-url https://api-prd.nocfo.io

Limit concurrency:

nocfo-dl acme-corp --concurrency 8

Development

python -m venv .venv
source .venv/bin/activate
pip install -e .

Run locally:

python -m nocfo_file_downloader <business_slug>

License

MIT

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

nocfo_file_downloader-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

nocfo_file_downloader-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nocfo_file_downloader-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.8 Darwin/24.0.0

File hashes

Hashes for nocfo_file_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60b97be1d51fd49bee8f51d89d0544c8445119f900c193891f40647f96f0524e
MD5 6adf58893ed9725e3ecd1ca841f4ae92
BLAKE2b-256 6c95db2d47c369f0e2a899dc753ccb735ce8f9f0366090a1f2521b48c988150c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nocfo_file_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c6d95d5feda122933367261c472b7e73bbb457a2314b9438c091b543a39ba73
MD5 6cce737b0a550877e702726bb1e51f60
BLAKE2b-256 9535dab859ead1c81d531f9128bab66b0fc916e3642c74dfa5804e0d956cda89

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