semvec/pypi-packages huggingface dataset:
nfetoolkit 0.3.3
Toolkit para manipulação de notas fiscais eletrônicas
License: MIT
Requires Python: >=3.9

# nfetoolkit

Ferramenta de linha de comando para organizar, corrigir, ler e exportar arquivos XML de Nota Fiscal Eletrônica (NF-e).

---

## 📦 Instalação de dependências

Certifique-se de ter o Python 3.9+ instalado.

Instale as dependências com:

```bash
pip install -r requirements.txt
```

---

## ▶️ Como usar

Execute a ferramenta com o comando:

```bash
python manage.py <comando> [opções]
```

---

## 🔁 Comandos disponíveis

### 🗂️ `organize`

Organiza os arquivos XML em subpastas por tipo: `nfe`, `canc`, `cce`, `inut`.

```bash
python manage.py organize <source_dir> <dest_dir> [--no-verbose]
```

**Exemplo:**

```bash
python manage.py organize C:\xmls_originais C:\xmls_organizados
```

---

### 📤 `export`

Exporta os dados estruturados dos XMLs encontrados para um arquivo `.txt`.

```bash
python manage.py export <xml_dir> [--output <arquivo_saida>] [--no-verbose]
```

**Exemplo:**

```bash
python manage.py export C:\xmls_organizados --output export.txt
```

Se não especificar `--output`, será gerado `./nfe_data.txt` no diretório atual.

---

### 🛠️ `fix`

Aplica correções definidas em um arquivo `config.json` a todos os XMLs de um diretório.

```bash
python manage.py fix <input_dir> <config.json> [--output_dir <destino>] [--no-verbose]
```

**Exemplo:**

```bash
python manage.py fix C:\xmls_organizados config.json --output_dir C:\xmls_corrigidos
```

Se `--output_dir` não for informado, os arquivos corrigidos serão salvos no mesmo diretório de origem.

---

### 📄 `read`

Gera o DANFE (arquivo PDF) de uma NF-e.

```bash
python manage.py read <xml_file> [--output <arquivo_pdf>]
```

**Exemplo:**

```bash
python manage.py read nfe.xml --output nota.pdf
```

---

## 🔧 Exemplo de `config.json` para o comando `fix`

```json
{
  "rules": [
    {
      "namespace": {
        "ns": "http://www.portalfiscal.inf.br/nfe"
      },
      "path": ".//ns:det",
      "tag": ".//ns:imposto/ns:ICMS/ns:ICMS00/ns:orig",
      "condition": {
        ".//ns:prod/ns:NCM": "85142011",
        ".//ns:imposto/ns:ICMS/ns:ICMS00/ns:orig": "0"
      },
      "new_value": "2"
    }
  ]
}
```

---

## 📌 Observações

- O padrão é exibir barra de progresso (`verbose=True`). Use `--no-verbose` se quiser ocultar.
- A estrutura esperada dos XMLs segue o padrão da SEFAZ.
- Os dados exportados seguem o layout dos blocos SPED (`RegistroN100`, `N170`, `Z100`, etc.).

---

## 📁 Estrutura recomendada do projeto

```
nfetoolkit/
├── core/
│   ├── handler.py
│   ├── fix.py
│   ├── organizer.py
│   ├── repository.py
├── manage.py
├── config.json
├── requirements.txt
```

---

## 🔗 Licença

Este projeto é distribuído sob a licença MIT.
invenio-jsonschemas 2.1.0
"Invenio module for building and serving JSONSchemas."
License: MIT
Requires Python: >=3.7
Keywords: invenio json schema jsonschema

..
    This file is part of Invenio.
    Copyright (C) 2015-2018 CERN.

    Invenio is free software; you can redistribute it and/or modify it
    under the terms of the MIT License; see LICENSE file for more details.

=====================
 Invenio-JSONSchemas
=====================

.. image:: https://img.shields.io/github/license/inveniosoftware/invenio-jsonschemas.svg
        :target: https://github.com/inveniosoftware/invenio-jsonschemas/blob/master/LICENSE

.. image:: https://github.com/inveniosoftware/invenio-jsonschemas/workflows/CI/badge.svg
        :target: https://github.com/inveniosoftware/invenio-jsonschemas/actions

.. image:: https://img.shields.io/coveralls/inveniosoftware/invenio-jsonschemas.svg
        :target: https://coveralls.io/r/inveniosoftware/invenio-jsonschemas

.. image:: https://img.shields.io/pypi/v/invenio-jsonschemas.svg
        :target: https://pypi.org/pypi/invenio-jsonschemas

Invenio module for building and serving JSONSchemas.

Further documentation is available on
https://invenio-jsonschemas.readthedocs.io/

..
    This file is part of Invenio.
    Copyright (C) 2015-2018 CERN.
    Copyright (C) 2024 Graz University of Technology.

    Invenio is free software; you can redistribute it and/or modify it
    under the terms of the MIT License; see LICENSE file for more details.

Changes
=======

Version v2.1.0 (released 2025-07-14)

- global: use entry_points wrapper

Version 2.0.0 (release 2024-12-05)

- setup: bump major dependencies

Version 1.1.5 (release 2024-11-30)

- fix: SphinxWarning
- global: remove examples directory
- global: remove six usage
- setup: change to reusable workflows
- setup: pin dependencies
- fix extlinks warning of compatibility with version 6
- global: clean test infrastructure
- increase minimal python version to 3.7
- move check_manifest configuration to setup.cfg.
- fix docs compatibilty problem with Sphinx>=5.0.0
- add .git-blame-ignore-revs
- migrate to use black as opinionated auto formater
- migrate setup.py to setup.cfg

Version 1.1.4 (released 2022-02-28)

- Changes from pkg_resources to importlib for entry points iteration.

Version 1.1.3 (released 2021-06-17)

- Fix string interpolation on error messages.

Version 1.1.2 (released 2021-04-06)

- Adds method to build a ref resolver store from the registry with a local
  URI scheme (e.g. local://).

Version 1.1.1 (released 2020-12-09)

- Migrates CI to GitHub actions.
- Fixes issue related to nested `allOf` being ignored, and added tests for it.

Version 1.1.0 (released 2020-03-12)

- Removes support for Python 2.7
- Changes Flask dependency to centrally managed by invenio-base

Version 1.0.1 (released 2019-09-04)

- Adds config ``JSONSCHEMAS_SCHEMAS`` to whitelist entrypoint names

Version 1.0.0 (released 2018-03-23)

- Initial public release.