https://github.com/gisce/face_lib
FACe interface to simplify the interaction with the FACe's WS
https://github.com/gisce/face_lib
efactura face hacktoberfest python spain webservices
Last synced: 7 months ago
JSON representation
FACe interface to simplify the interaction with the FACe's WS
- Host: GitHub
- URL: https://github.com/gisce/face_lib
- Owner: gisce
- Created: 2017-12-15T11:24:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T14:58:45.000Z (about 1 year ago)
- Last Synced: 2025-01-15T07:02:18.230Z (9 months ago)
- Topics: efactura, face, hacktoberfest, python, spain, webservices
- Language: Python
- Homepage:
- Size: 5.27 MB
- Stars: 1
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# FACe lib
It provides a FACe interface to simplify the interaction with the FACe's WS
## How to install
Just install it using pip:
```
$ pip install FACe_lib
```## Usage
Initialize the face interface passing the desired *PEM* certificate and an email
to receive notifications from FACe servers:```
from face.face import FACeour_certificate = 'path_to/cert.pem'
face = FACe(certificate=our_certificate, email='example@example.com')
```Call the requested service (see all available methods), ie:
```
result = face.nifs.list()
```## Integrated FACe services
- [Invoices](#invoices)
- [x] [Fetch Invoice](#fetch-invoice)
- [x] [Send Invoice](#send-invoice)
- [x] [Cancel Invoice](#cancel-invoice)
- [x] [List Invoice Status](#list-invoice-states)
- [Administration](#Administration)
- [x] [List administrations](#list-administrations)
- [NIFs](#NIFs)
- [x] [List NIFs](#list-nifs)### Invoices
#### Fetch Invoice
```
result = face.invoices.fetch(invoice="213091309123")
print (result.errors)
print (result.data)
```#### Send Invoice by Filepath
```
result = face.invoices.send_by_filename(invoice="an_invoice.xsig")
print (result.errors)
print (result.data)
```#### Send Invoice
```
result = face.invoices.send_by_filename("Facturae.xsig", b64content)
print (result.errors)
print (result.data)
```#### Cancel Invoice
```
result = face.invoices.send(invoice="213091309123", reason="Mistake at generation process")
print (result.errors)
print (result.data)```
#### List Invoice States
```
result = face.invoices.list_states(invoice="213091309123")
print (result.errors)
print (result.data)
```### Administrations
#### List Administrations
```
result = face.administrations.list()
print (result.errors)
print (result.data)
```### NIFs
#### List NIFs
```
result = face.nifs.list()
print (result.errors)
print (result.data)
```