Skip to main content

ofxstatement-directa

Plugin per ofxstatement per importare transazioni dal broker finanziario italiano Directa.

Questo plugin converte i file CSV esportati da Directa in formato OFX, compatibile con software di contabilità come GnuCash, HomeBank, e altri.

📋 Requisiti

  • Python 3.9 o superiore
  • ofxstatement (installato automaticamente come dipendenza)

🚀 Installazione

Installazione da PyPI (consigliata)

pip install ofxstatement-directa

Installazione dal sorgente

git clone https://github.com/Alfystar/ofxstatement-directa.git
cd ofxstatement-directa
pip install -e .

Aggiornamento

Per aggiornare il plugin all'ultima versione:

pip install --upgrade ofxstatement-directa

⚙️ Configurazione

Prima di utilizzare il plugin, è necessario configurare il conto predefinito:

ofxstatement edit-config

Nel file di configurazione, aggiungi:

[DirectaConfig]
plugin = directa
account = K1234  # Il tuo numero conto Directa

Se hai più conti, puoi creare più configurazioni (DirectaConfig) e variare il codice account. Per specificare la configurazione che vuoi usare, vedi la sezione Utilizzo.

📖 Utilizzo

1. Scarica il file CSV da Directa

  1. Accedi al tuo account Directa
  2. Vai alla sezione "Movimenti" o "Estratto conto"
  3. Esporta i movimenti in formato CSV
  4. Salva il file (es. Movimenti.csv)

2. Converti il CSV in formato OFX

Usa il comando ofxstatement per convertire il file CSV:

ofxstatement convert -t DirectaConfig Movimenti.csv output.ofx

Dove:

  • -t DirectaConfig: specifica di usare la configurazione DirectaConfig
  • Movimenti.csv: il file CSV scaricato da Directa
  • output.ofx: il file OFX di destinazione

3. Importa il file OFX nel tuo software di contabilità

Ora puoi importare il file output.ofx in GnuCash, HomeBank, o altri software compatibili.

Verifica della configurazione

Per verificare le impostazioni correnti:

ofxstatement list-plugins

Dovresti vedere directa nell'elenco dei plugin disponibili.

🐛 Risoluzione dei problemi

Errore: Plugin 'directa' non trovato

Assicurati che il plugin sia installato correttamente:

pip list | grep ofxstatement-directa

Se non appare, reinstalla:

pip install --force-reinstall ofxstatement-directa

Errore: Account non configurato

Verifica che il file di configurazione contenga la sezione [directa]:

ofxstatement edit-config

🔄 Alias (opzionale)

Per semplificare l'uso del comando di conversione puoi creare un alias (Linux / terminale emulato).
L'esempio seguente usa la configurazione DirectaConfig. Se usi un nome diverso, modificalo nell'alias.

printf '\n# Directa CSV -> OFX\nalias ofxDirecta="ofxstatement convert -t DirectaConfig"\n' >> ~/.bash_aliases

Poi ricarica il terminale (chiudi e riapri) oppure esegui:

source ~/.bash_aliases

Uso semplificato:

ofxDirecta Movimenti.csv output.ofx

Nota: se dopo il riavvio gli alias non sono attivi, verifica che in ~/.bashrc sia presente:

# Alias definitions.
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

📝 Licenza

Questo progetto è distribuito sotto licenza GPLv3. Vedi il file LICENSE per i dettagli.

👤 Autore

Alfystar

🤝 Contributi

I contributi sono benvenuti! Sentiti libero di:

  1. Fare un fork del progetto
  2. Creare un branch per la tua feature (git checkout -b feature/AmazingFeature)
  3. Committare le modifiche (git commit -m 'Add some AmazingFeature')
  4. Fare push del branch (git push origin feature/AmazingFeature)
  5. Aprire una Pull Request

📜 Changelog

v1.0.0 (2025-10-06)

  • Prima release pubblica
  • Supporto per conversione CSV di Directa in formato OFX
  • Supporto per transazioni di trading e movimenti bancari
  • Configurazione account tramite ofxstatement config

Metadata

Release files for ofxstatement-directa 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ofxstatement-directa 1.0.1
File Size Uploaded Provenance Actions
ofxstatement_directa-1.0.1.tar.gz 11.5 kB Without provenance Details for ofxstatement_directa-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ofxstatement-directa 1.0.1
File Interpreter ABI Platform Actions
ofxstatement_directa-1.0.1-py3-none-any.whl Python 3 none any Details for ofxstatement_directa-1.0.1-py3-none-any.whl

Total release size: 20.0 kB

Release files / ofxstatement_directa-1.0.1.tar.gz

Download URL ofxstatement_directa-1.0.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bf5f6c12c8aeec7b0339f1deeff488ac6b12e90bf22e5347b430c10bb4f3e66f
BLAKE2b-256 checksum
How to use checksums
ccb9fa110afc7c30171978accebcc7f3e310c52de819fe08374a59cac204dae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / ofxstatement_directa-1.0.1-py3-none-any.whl

Download URL ofxstatement_directa-1.0.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c9f40328c31d4c5f4419d9eb3a4fcd7e2739a85fbbd8f29b0def410e57c7ded
BLAKE2b-256 checksum
How to use checksums
1ac1db669cfea1121296f10d8f8cc33e308305115b960aa0e39ccfda8d9c25bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for ofxstatement-directa 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page