- Updated file checksum.

- Readme and other files are now in markdown.
This commit is contained in:
Franco Masotti 2022-05-18 11:15:57 +02:00
parent ac9361192a
commit 38c66f6cec
Signed by: frnmst
GPG Key ID: 24116ED85666780A
9 changed files with 135 additions and 138 deletions

2
.gitignore vendored
View File

@ -1,6 +1,4 @@
Pipfile.lock
*.md
*.MD
*.XML
*.xml
*.XSD

View File

@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@ -28,7 +28,7 @@ repos:
additional_dependencies: [flake8-docstrings]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.2' # Use the sha / tag you want to point at
rev: '1.7.4' # Use the sha / tag you want to point at
hooks:
- id: bandit
args: ['--skip', 'B320,B404,B410,B603', '--level', 'LOW']
@ -51,11 +51,17 @@ repos:
args: ['--configuration-file', '.allowed_licenses.yml']
- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
rev: "0.48"
hooks:
- id: check-manifest
args: ['--ignore','docs/*,docs/assets/*,Pipfile,Makefile,asciinema/*,*.yaml,*.yml,assets/*,fattura_elettronica_reader/tests/*,packages/aur/*']
- repo: https://codeberg.org/frnmst/md-toc
rev: '8.1.3' # or a specific git tag from md-toc
hooks:
- id: md-toc
args: [-p, 'cmark', '-l6'] # CLI options
- repo: local
hooks:
- id: build-docs

3
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,3 @@
# Contributing
See https://docs.franco.net.eu.org/md-toc/contributing.html

View File

@ -1,3 +1,3 @@
global-include LICENSE.txt
global-include README.rst
global-include CONTRIBUTING.rst
global-include README.md
global-include CONTRIBUTING.md

View File

@ -59,13 +59,15 @@ dist:
# https://github.com/pypa/setuptools/issues/2133
# https://reproducible-builds.org/docs/source-date-epoch/
SOURCE_DATE_EPOCH=$$(git -c log.showSignature='false' log -1 --pretty=%ct) pipenv run python setup.py bdist_wheel
pipenv run pipenv run twine check dist/*
pipenv run twine check dist/*
upload:
pipenv run twine upload dist/*
clean:
rm -rf build dist *.egg-info
# Remove all markdown files except the readme.
find -regex ".*\.[mM][dD]" ! -name 'README.md' ! -name 'CONTRIBUTING.md' -type f -exec rm -f {} +
pipenv run $(MAKE) -C docs clean
.PHONY: default doc install uninstall install-dev uninstall-dev update test clean

111
README.md Normal file
View File

@ -0,0 +1,111 @@
# fattura-elettronica-reader
![PyPI md-toc version](https://img.shields.io/pypi/v/fattura-elettronica-reader.svg)
[![PyPI - License](https://img.shields.io/pypi/l/fattura-elettronica-reader.svg?color=blue)](https://raw.githubusercontent.com/frnmst/fattura-elettronica-reader/master/LICENSE.txt)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fattura-elettronica-reader.svg)
[![Downloads](https://pepy.tech/badge/fattura-elettronica-reader)](https://pepy.tech/project/fattura-elettronica-reader)
[![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/pypi/fattura-elettronica-reader.svg)](https://libraries.io/pypi/fattura-elettronica-reader/dependents)
[![Buy me a coffee](assets/buy_me_a_coffee.svg)](https://buymeacoff.ee/frnmst)
Validate, extract, and generate printables of electronic invoice files
received from the *Sistema di Interscambio*.
<!--TOC-->
- [fattura-elettronica-reader](#fattura-elettronica-reader)
- [Documentation](#documentation)
- [API examples](#api-examples)
- [CLI helps](#cli-helps)
- [License](#license)
- [Changelog and trusted source](#changelog-and-trusted-source)
- [Crypto donations](#crypto-donations)
<!--TOC-->
## Documentation
<https://docs.franco.net.eu.org/fattura-elettronica-reader>
## API examples
fattura-elettronica-reader has a
[public API](https://docs.franco.net.eu.org/fattura-elettronica-reader/api.html).
This means for example that you can you easily read invoice files within
another Python program:
```python
>>> import fattura_elettronica_reader
>>> data = {
'patched': True,
'configuration_file': str(),
'write_default_configuration_file': False,
'extract_attachments': True,
'metadata_file': 'myfile.xml',
'invoice_xslt_type': 'ordinaria',
'no_invoice_xml_validation': False,
'force_invoice_schema_file_download': False,
'generate_html_output': True,
'invoice_filename': str(),
'no_checksum_check': False,
'force_invoice_xml_stylesheet_file_download': False,
'ignore_attachment_extension_whitelist': False,
'ignore_attachment_filetype_whitelist': False,
'ignore_signature_check': False,
'ignore_signers_certificate_check': False,
'force_trusted_list_file_download': False,
'keep_original_file': True,
'ignore_assets_checksum': False,
'destination_directory': '/dev/shm/invoices',
}
>>> fattura_elettronica_reader.assert_data_structure(source='invoice', file_type='p7m', data=data)
>>> fattura_elettronica_reader.pipeline(
source='invoice',
file_type='p7m',
data=data,
)
```
Have a look at the
[invoices](https://docs.franco.net.eu.org/ftutorials/en/content/desktop/download/invoices.html)
page in the [ftutorials](https://software.franco.net.eu.org/frnmst/ftutorials) repository.
## CLI helps
```shell
$ fattura_elettronica_reader --help
```
## License
Copyright (c) 2018 Enio Carboni - Italy
Copyright (C) 2019-2022 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
fattura-elettronica-reader is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
fattura-elettronica-reader is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with fattura-elettronica-reader. If not, see
<http://www.gnu.org/licenses/>.
## Changelog and trusted source
You can check the authenticity of new releases using my public key.
Changelogs, instructions, sources and keys can be found at
[blog.franco.net.eu.org/software](https://blog.franco.net.eu.org/software/).
## Crypto donations
- Bitcoin: bc1qnkflazapw3hjupawj0lm39dh9xt88s7zal5mwu
- Monero:
84KHWDTd9hbPyGwikk33Qp5GW7o7zRwPb8kJ6u93zs4sNMpDSnM5ZTWVnUp2cudRYNT6rNqctnMQ9NbUewbj7MzCBUcrQEY
- Dogecoin: DMB5h2GhHiTNW7EcmDnqkYpKs6Da2wK3zP
- Vertcoin: vtc1qd8n3jvkd2vwrr6cpejkd9wavp4ld6xfu9hkhh0

View File

@ -1,126 +0,0 @@
fattura-elettronica-reader
==========================
|pypiver| |license| |pyver| |downloads| |dependentrepos| |buymeacoffee|
.. |pypiver| image:: https://img.shields.io/pypi/v/fattura-elettronica-reader.svg
:alt: PyPI md-toc version
.. |license| image:: https://img.shields.io/pypi/l/fattura-elettronica-reader.svg?color=blue
:alt: PyPI - License
:target: https://raw.githubusercontent.com/frnmst/fattura-elettronica-reader/master/LICENSE.txt
.. |pyver| image:: https://img.shields.io/pypi/pyversions/fattura-elettronica-reader.svg
:alt: PyPI - Python Version
.. |downloads| image:: https://pepy.tech/badge/fattura-elettronica-reader
:alt: Downloads
:target: https://pepy.tech/project/fattura-elettronica-reader
.. |dependentrepos| image:: https://img.shields.io/librariesio/dependent-repos/pypi/fattura-elettronica-reader.svg
:alt: Dependent repos (via libraries.io)
:target: https://libraries.io/pypi/fattura-elettronica-reader/dependents
.. |buymeacoffee| image:: assets/buy_me_a_coffee.svg
:alt: Buy me a coffee
:target: https://buymeacoff.ee/frnmst
Validate, extract, and generate printables of electronic invoice files received
from the "Sistema di Interscambio".
Documentation
-------------
https://docs.franco.net.eu.org/fattura-elettronica-reader
API examples
------------
fattura-elettronica-reader has a `public API`_.
This means for example that you can you easily read invoice files within another
Python program:
::
>>> import fattura_elettronica_reader
>>> data = {
'patched': True,
'configuration_file': str(),
'write_default_configuration_file': False,
'extract_attachments': True,
'metadata_file': 'myfile.xml',
'invoice_xslt_type': 'ordinaria',
'no_invoice_xml_validation': False,
'force_invoice_schema_file_download': False,
'generate_html_output': True,
'invoice_filename': str(),
'no_checksum_check': False,
'force_invoice_xml_stylesheet_file_download': False,
'ignore_attachment_extension_whitelist': False,
'ignore_attachment_filetype_whitelist': False,
'ignore_signature_check': False,
'ignore_signers_certificate_check': False,
'force_trusted_list_file_download': False,
'keep_original_file': True,
'ignore_assets_checksum': False,
'destination_directory': '/dev/shm/invoices',
}
>>> fattura_elettronica_reader.assert_data_structure(source='invoice', file_type='p7m', data=data)
>>> fattura_elettronica_reader.pipeline(
source='invoice',
file_type='p7m',
data=data,
)
Have a look at the `archive_invoice_files <https://software.franco.net.eu.org/frnmst/automated-tasks/raw/branch/master/automated_tasks/archiving/archive_invoice_files.py>`_
script in the `automated tasks <https://software.franco.net.eu.org/frnmst/automated-tasks>`_ repository.
.. _public API: https://docs.franco.net.eu.org/fattura-elettronica-reader/api.html
CLI helps
---------
::
$ fattura_elettronica_reader --help
License
-------
Copyright (c) 2018 Enio Carboni - Italy
Copyright (C) 2019-2022 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
fattura-elettronica-reader is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
fattura-elettronica-reader is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with fattura-elettronica-reader. If not, see <http://www.gnu.org/licenses/>.
Changelog and trusted source
----------------------------
You can check the authenticity of new releases using my public key.
Changelogs, instructions, sources and keys can be found at `blog.franco.net.eu.org/software <https://blog.franco.net.eu.org/software/>`_.
Crypto donations
----------------
- Bitcoin: bc1qnkflazapw3hjupawj0lm39dh9xt88s7zal5mwu
- Monero: 84KHWDTd9hbPyGwikk33Qp5GW7o7zRwPb8kJ6u93zs4sNMpDSnM5ZTWVnUp2cudRYNT6rNqctnMQ9NbUewbj7MzCBUcrQEY
- Dogecoin: DMB5h2GhHiTNW7EcmDnqkYpKs6Da2wK3zP
- Vertcoin: vtc1qd8n3jvkd2vwrr6cpejkd9wavp4ld6xfu9hkhh0

View File

@ -143,7 +143,7 @@ checksum[paths['invoice_file']['xslt']['ordinaria']] = '2c315cbb04126e98192c0afa
checksum[paths['invoice_file']['xsd']['default']] = 'a1b02818f81ac91f35358260dd12e1bf4480e1545bb457caffa0d434200a1bd05bedd88df2d897969485a989dda78922850ebe978b92524778a37cb0afacba27'
# TSL-IT.xml
checksum[paths['trusted_list_file']] = 'd6b8c13a5574fb34f658f1122c3c4cd72fd7f9b59f51b3ab9e3972e6aebc19ab432de4706b4473d467f4bd6966fe49296389b3f9164ba593cac9c81843a83155'
checksum[paths['trusted_list_file']] = 'e13668b025d15c079c5d741addca074b903fd8f2e1682207cb7c156a051bafaef74c94d78cc6c7103ecc7d4ff298cad7ead69282a7c0c0485c95164a7162c608'
docs = dict()
docs['assets_url'] = 'https://docs.franco.net.eu.org/fattura-elettronica-reader/assets.html'

View File

@ -22,14 +22,17 @@
from setuptools import find_packages, setup
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
setup(
name='fattura_elettronica_reader',
version='3.0.1',
packages=find_packages(exclude=['*tests*']),
license='GPL',
description='A utility that is able to check and extract electronic invoice received from the Sistema di Interscambio.',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
long_description=readme,
long_description_content_type='text/markdown',
package_data={
'': ['*.txt', '*.rst'],
},
@ -55,7 +58,7 @@ setup(
'appdirs>=1.4,<1.5',
'atomicwrites>=1.4,<2',
'filetype>=1,<2',
'fpyutils>=2,<3'
'fpyutils>=2.1,<3'
'lxml>=4.6.5,<4.9',
'PyYAML>=6,<7',
'requests>=2.27,<3',