Skip to main content

Serializa um arquivo do tipo SPED Fiscal

Project description

PySpedFiscal

Lê e serializa um arquivo do tipo Sped Fiscal

Instalação

  • pip install pyspedfiscal

Dependencias

  • Pydantic

Como Usar

Lendo um arquivo:

# Importe a classe SpedFiscal
from pyspedfiscal import SpedFiscal

# Utilize o metodo da classe `importar` para carregar um arquivo sped
sped_fiscal = SpedFiscal.importar('caminho_arquivo')

# Utilize a hierarquia do arquivo para percorrer os registros
registros_0200 = sped_fiscal.bloco_0.resgistro_0001.registros_0200

for registro in registros_0200:
  ...

Lendo um bloco:

from pyspedfiscal.bloco_0 import Bloco0

bloco = """
|0000|016|0|01072022|31072022|EMPRESA TESTE|14028298000152||SP|009371438460|3550308|||A|0|
|0001|0|
|0002|00|
|0005|EMPRESA TESTE|25821270|RUA EMPRESA TESTE|1111||BAIRRO EMPRESA TESTE|2499999999|||
...
"""

registros = bloco.splitlines()

bloco_0 = Bloco0.ler_registros(registros)

Lendo um Registro

from pyspedfiscal.bloco_0.registro_0000 import Registro0000

registro = "|0000|016|0|01072022|31072022|EMPRESA TESTE|14028298000152||SP|009371438460|3550308|||A|0|"

registro_0000 = Registro0000.ler_registro(registro)

Registros Implementados

Bloco 0 Bloco B Bloco C Bloco D Bloco E Bloco G Bloco H Bloco G Bloco K Bloco 1 Bloco 9
0000 B001 C001 E001 9001
0001 B020 C100 E100 9900
0002 B025 C101 E110 9990
0005 B030 C105 E115 9999
0015 B035 C110
0100 B350 C111
0150 B420 C112
0175 B440 C113
0190 B460 C114
0200 B470 C115
0205 B500 C116
0206 B510 C120
0210 B990 C130
0220 C140
0221 C160
0300 C170
0305 C180
0400 C190
0450 C195
0460 C197
0500
0600
0990

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

pyspedfiscal1-0.2.13.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

pyspedfiscal1-0.2.13-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file pyspedfiscal1-0.2.13.tar.gz.

File metadata

  • Download URL: pyspedfiscal1-0.2.13.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyspedfiscal1-0.2.13.tar.gz
Algorithm Hash digest
SHA256 55fb781d3c5d9e8677614bcc017e8f3afb2de3e8564f649fdfa81e5b2316711c
MD5 89a2d1fd7cebc3d669500b7bf8f8f11d
BLAKE2b-256 13265467df84eb09420f8337230b8bae26057c452d6054438a372e997f02e0bf

See more details on using hashes here.

File details

Details for the file pyspedfiscal1-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: pyspedfiscal1-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyspedfiscal1-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 f80ed8f8daf79323e07b742fed7cbfa330f60b1cd32c51f3ac2708760668f1dc
MD5 190e487d55c7767d4652d1e0454847ba
BLAKE2b-256 5be273616e62f88d528dd1bf78739d24d51c2f0c09ea1104f6588ca10534edd6

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